Thursday, August 11, 2011

Malloc Dealloc

Here is one thing that took me 1 hour to figure out:

If you have property retained object, do not assign a malloc value to it, so the first one below is wrong but the second is right:

self.object = [[OBJect alloc] init];

object = [[Object] alloc] init];

first example will retain the object twice so be careful.

No comments:

Post a Comment