iphone - Release UIViewController give exception -
i have uiviewcontroller add uiviewcontroler this:
reportviewcontroller *reportvc = [[reportviewcontroller alloc]initwithnibname:@"reportviewcontroller" bundle:nil]; [self.view addsubview:reportvc.view];
and try add
[reportvc release];
after lines , exepction when try remove reportvc.view
[self.view removefromsuperview];
did make error while release this?
in code removing "self.view" superview, shouldn't.
have remove "reportvc.view" superview.
you can write this:
[reportvc.view removefromsuperview]; [reportvc release]; reportvc = nil;
Comments
Post a Comment