Stupid Memory Management

17 Apr 2012

Now this is what I call stupidity….

When I need to assign an object to `@property` in iOS, I figured out that I should make the code shorter. So, what I did is this:

self.camera = [[GLCamera alloc] init]; [self.camera release];

That is stupid because the concurrency will break it… (You can figure why it is the case).

Let's just go with the normal way:

GLCamera *cameraTmp = [[GLCamera alloc] init]; self.camera = cameraTmp; [cameraTmp release];

Give it a kudos