【发布时间】:2012-12-21 19:36:37
【问题描述】:
我创建了一个名为 view2 的类,它是 UIView Controller 的子类,当我运行程序时,计时器工作正常,但是当它改变屏幕时,它只是变黑,而不是我在 view2 上的图片。这是我在打开视图的 .m 上的代码,任何人都可以看到哪里出错了吗?
- (void)viewDidLoad
{
randomMain = [NSTimer scheduledTimerWithTimeInterval:(2) target:self selector:@selector(onTimer) userInfo:nil repeats:NO];
[super viewDidLoad];
}
-(void)onTimer{
view2 *second= [[view2 alloc] initWithNibName:nil bundle:nil];
[self presentViewController:second animated:YES completion:nil];
}
【问题讨论】:
标签: objective-c cocoa views switch-statement nstimer