我在自己的app里用了几个UIStoryboard,但是发现换了故事板,旧的没有发布,怎么发布旧的?代码如下:
if([ModuleTeacher isEqualToString:type]){
[self loginStateChanged];
if([TeacherProfile getCurrentTeacher]!=nil){
[self startPull];
}
}else if([ModuleStudent isEqualToString:type]){
UIStoryboard *main = [UIStoryboard storyboardWithName:@"StudentMain" bundle:nil];
self.window.rootViewController = [main instantiateInitialViewController];
if([StudentProfile getCurrent]!=nil){
[self startPull];
}
}else if([ModuleOrgnization isEqualToString:type]){
UIStoryboard *main = [UIStoryboard storyboardWithName:@"OrganizeMain" bundle:nil];
self.window.rootViewController = [main instantiateInitialViewController];
[AppCache setModule:type];
}这样,旧的故事板将永远不会发布。
发布于 2013-07-28 21:29:29
ARC将确保您释放任何不再需要的引用。确保你的强引用在不需要时被清除,让ARC做正确的事情。如果你的代码不负责保留故事板,那么你就没有责任发布任何东西。Cocoa Touch框架可能出于自己的原因而挂在故事板上--这不是您的问题。
https://stackoverflow.com/questions/17906130
复制相似问题