views:

1616

answers:

3

i am getting this error does some one knows about it??? 2009-07-08 18:42:36.778 FlashCards[1297:20b] Category Id=1 FlashCards(1297,0xa0690fa0) malloc: * error for object 0x4fd78a0: pointer being freed was not allocated FlashCards(1297,0xa0690fa0) malloc: * error for object 0x4fdc200: double free *** set a breakpoint in malloc_error_break to debug

+11  A: 

No, an NSInteger is not an object; it is simply a typedef for an int (for 32-bit apps) or a long (for 64-bit apps):

#if __LP64__
typedef long NSInteger;
#else
typedef int NSInteger;
endif
Perspx
tell me about the error how do i find which object is giving error?
Rahul Vyas
Well you appear to be calling release on an NSInteger which you can't do, because it isn't an object.
Perspx
+2  A: 

NSInteger is a typedef for a primitive type, it's not an object that can respond to methods like retain or release. Even though it's named similarly to Cocoa classes like NSNumber or NSValue it's actually treated the same as int, float, etc.

Marc Charbonneau
tell me about the error how do i find which object is giving error?
Rahul Vyas
A: 

The error message gives you a good hint in how to debug this problem: set a break point at malloc_error_break. In Xcode, open the breakpoints window (option-cmd-B). In the field that says "Double-Click for Symbol", enter malloc_error_break. Re-run your app in the debugger (select Debug from the Run menu). The debugger will stop at the point of the error you reported. I would examine the stack trace at that point to find where you've doubly-freed this memory.

Barry Wark
set a break point at malloc_error_break. In Xcode, open the breakpoints window (option-cmd-B). In the field that says "Double-Click for Symbol", enter malloc_error_break. Re-run your app in the debugger (select Debug from the Run menu).please explain it in more detail..where do i set a break point at malloc_error_break.
Rahul Vyas
In Xcode, choose Run->Show->Breakpoints (from the Run menu) or press the option, cmd and B buttons simultaneously. In the Breakpoints panel that appears, double click in the box that says "Double-Click for Symbol" and type "malloc_error_break" (no quotes).
Barry Wark
what is the location of the breakpoint "malloc_error_break"
Rahul Vyas
how we trace stack to find where the actual error is.means which line causing error
Rahul Vyas