我已经四处寻找答案了,我在这个网站和其他网站上看到了相关问题,但解决方案与我无关。我有一个应用程序,在我升级到IOS 4.2之前工作得很好。现在,该应用程序不会加载包含图像背景的视图,以及一组按钮和标签。该应用程序中有一个计时器,我可以确定计时器正在运行,因为从另一个帖子我可以证明在启动过程中执行了以下方法:
SELECTOR: application:handleOpenURL:
SELECTOR: application:openURL:sourceApplication:annotation:
SELECTOR: applicationDidReceiveMemoryWarning:
SELECTOR: applicationWillTerminate:
SELECTOR: applicationSignificantTimeChange:
SELECTOR: application:willChangeStatusBarOrientation:duration:
SELECTOR: application:didChangeStatusBarOrientation:
SELECTOR: application:willChangeStatusBarFrame:
SELECTOR: application:didChangeStatusBarFrame:
SELECTOR: application:deviceAccelerated:
SELECTOR: application:deviceChangedOrientation:
SELECTOR: applicationDidBecomeActive:
SELECTOR: applicationWillResignActive:
SELECTOR: applicationDidEnterBackground:
SELECTOR: applicationWillEnterForeground:
SELECTOR: applicationWillSuspend:
SELECTOR: application:didResumeWithOptions:
SELECTOR: application:didFinishLaunchingWithOptions:
SELECTOR: applicationDidFinishLaunching:
SELECTOR: createTimer
视图应该已加载。我没有收到任何错误消息。以下是我的applicationDidFinishLaunching:方法。
- (void)applicationDidFinishLaunching:(UIApplication *)application {
// Override point for customization after app launch
// set instance variable for view controller
viewController.pressNumberNext = TRUE;
// reset total and last value
viewController.userTotal = 0;
// clear status text
viewController.status.text = @"";
// initalize the number of digits entered
viewController.numberOfDigits = 0;
// disable interaction with status area
[viewController.status setUserInteractionEnabled:NO];
// initialize items for the tokenizer
viewController.endOfInput = [PKToken EOFToken];
viewController.randomExpr = [[NSString alloc] initWithString:@""];
// debugging flags
viewController.debugSolution = false; // debug flag to show solution under status
// initialize the timer
viewController.timeCount = MAXTIME;
// timer should start running
viewController.pauseTimer = false;
// timer reset initialized
viewController.timerNeedsReset = false;
[window addSubview:viewController.view];
[window makeKeyAndVisible];
}
非常感谢任何帮助。谢谢。
答案 0 :(得分:1)
要检查的事项:
如何加载视图?通过一个笔尖,还是通过loadView中的代码?
在任何一种情况下,请检查视图的框架。在viewDidAppear中记录:动画:。
同时检查视图的alpha和隐藏属性。
你是否正在做任何奇怪的事情 主窗口?是主窗口 框架设置为的边界 屏幕?是否设置了clipsToBounds 窗口?