My situation: I create an object of singleton class. Object has information about Ivars of another object and some NSStrings field.
-(id)init
{
[super init];
objectID=[NSString stringWithString:@"sqlRowId"];
tableNameForBO=[[NSString stringWithString: @"BOComment"] lowercaseString];
ivarListForBO=class_copyIvarList([BOComment class], &ivarCount);
return self;
};
When I call the object it works fine in first time. All fields has right information. But when loading is finished (after applicationDidFinishLunching) application calls _UIApplicationHandleEvent witch delete information in all fields but objectID.
So in program I have pointer to this singleton object that stay constant but his fields has totally wrong information.
NSZombie says:
-[CFString respondsToSelector:]: message sent to deallocated instance 0x6022a10
-[CFString _cfTypeID]: message sent to deallocated instance 0x6022a10
-[CFString _cfTypeID]: message sent to deallocated instance 0x6022bb0
And application crashes with program received signal: “EXC_BAD_ACCESS”.
What can cause this? Haven't any idea.
Thank a lot!
Thanks a lot! Problem was in not appropriate allocation of object's fields.
After change init method that how:
-(id)init { self=[super init];
};
it works just fine!
Thanks a lot for the answer it really helped - knew where to look.