iphone - Using self dot notation doesn't call dealloc -
My visual controller class's dellok method is not popped after being pushed with the following code: However, if I change the push code to the following, then my viewlock is populated by the view controller after popping: I thought I understood the use of dot notation / self, but not clearly. Can anyone explain the problem here? Here is the property: And synthesis is here: You retain it twice. But you only leave one time. To correct your memory management problem, you can change the code in something like this: And many people say self.playerViewController = [[Videoplayer view controller alloc] init]; [Self. Player Week Controller Set_Video: Video]; [Self. Navigation controller Push ViewController: self Player. Animated controller: yes]; [Self. Playwear Controller Release];
playerViewController = [[ VideoPlayerViewController Alloc] init]; [Player view controller set_video: video]; [Self. Navigation controller Push ViewController: Animated Player Viewer: Yes]; [Player view controller release];
@property (nonatomic, retain) VideoPlayerViewController * playerViewController;
@synthesize playerViewController;
PlayerViewController itself = [[Videoplayer view controller alloc] init]; ^ Keep ^ 1 ^^^^^ retain + 1
self.playerViewController = [[[VideoPlayerViewController alloc] init] autorelease ];
[self.foo release] is bad style you can call it
[foo release] < / P>
Comments
Post a Comment