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
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
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.
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.