iphone @property(retain), init(), and standards
Posted
by inyourcorner
on Stack Overflow
See other posts from Stack Overflow
or by inyourcorner
Published on 2010-06-09T12:31:37Z
Indexed on
2010/06/09
14:32 UTC
Read the original article
Hit count: 180
I'm new to the memory management of the iphone and had a question about standards/correctness.
My header file declares:
IBOutlet UITabBarController *tabBarController;
@property (nonatomic, retain) UITabBarController *tabBarController;
In my init() code I was doing something like the following:
self.tabBarController = [[UITabBarController alloc] init];
[tabBarController release];
NSLog(@"Retain count of tbc: %d",[tabBarController retainCount]);
to get the retain count back to one. Is this correct from a standardization point of view? It just looked a bit different to me, but again I'm new to this.
Thanks
© Stack Overflow or respective owner