模拟器中的 iPhone 应用程序空白:从 3.1.3 移至 4.1
我有一个 3.1 xcode 项目,它在 3.1.3 版本的操作系统下运行得很好。我一直在我的 iphone 3G(未运行 IOS 4)上测试这个应用程序。
我刚刚复制了 XCode 项目和文件,下载了最新的 XCode 3.2.4 和 4.1 SDK。当我通过模拟器运行我的应用程序时,它只是显示空白,而不是显示我的应用程序。我可以通过 NSLog 语句看到它实际上到达了我的 initWithFrame() 和 viewDidLoad() 方法,但它好像没有正确加载图像。 我尝试将文件复制回 xcode 项目并允许其更新引用。我还尝试过在硬件下使用 4.0 和 4.1 的 SDK 以及 iphone 4 和 iphone 模拟器。
我确实从 system.log 中看到了一些错误:
Sep 20 21:59:01 s-macbook-pro-17 [0x0-0x18018].com.apple.Xcode[484]: Xcode(484,0x7fff70216c20) malloc: reference count underflow for 0x2019c0a40, break on auto_refcount_underflow_error to debug.
Sep 20 21:59:01 s-macbook-pro-17 Xcode[484]: Xcode(484,0x7fff70216c20) malloc: reference count underflow for 0x2019c0a40, break on auto_refcount_underflow_error to debug.
Sep 20 21:59:03 s-macbook-pro-17 com.apple.launchd.peruser.502[127] (com.apple.iPhoneSimulator:com.apple.managedconfiguration.profiled): Bug: launchd_core_logic.c:4598 (24108):2
Sep 20 21:59:03 s-macbook-pro-17 com.apple.launchd.peruser.502[127] (com.apple.iPhoneSimulator:com.apple.managedconfiguration.profiled): Path monitoring failed on "/Users/m/Library/Application Support/iPhone Simulator/4.1/Library/ConfigurationProfiles/profiledRunning": No such file or directory
Sep 20 21:59:03 s-macbook-pro-17 com.apple.launchd.peruser.502[127] (com.apple.iPhoneSimulator:com.apple.managedconfiguration.profiled): Bug: launchd_core_logic.c:4598 (24108):2
Sep 20 21:59:03 s-macbook-pro-17 com.apple.launchd.peruser.502[127] (com.apple.iPhoneSimulator:com.apple.managedconfiguration.profiled): Path monitoring failed on "/Users/m/Library/Application Support/iPhone Simulator/4.1/Library/ConfigurationProfiles/MCOutstandingNagComputation": No such file or directory
Sep 20 21:59:03 s-macbook-pro-17 com.apple.launchd.peruser.502[127] (com.apple.iPhoneSimulator:com.apple.managedconfiguration.mdmd): Bug: launchd_core_logic.c:4598 (24108):2
Sep 20 21:59:03 s-macbook-pro-17 com.apple.launchd.peruser.502[127] (com.apple.iPhoneSimulator:com.apple.managedconfiguration.mdmd): Path monitoring failed on "/Users/m/Library/Application Support/iPhone Simulator/4.1/Library/ConfigurationProfiles/MDMOutstandingActivities.plist": No such file or directory
Sep 20 21:59:03 s-macbook-pro-17 vot[929]: ******** AX INSPECTOR MODE ************
Sep 20 21:59:03 s-macbook-pro-17 vot[929]: **** Running VoiceOver Lite ****
Sep 20 21:59:06 s-macbook-pro-17 app[935]: MainView alloc
Sep 20 21:59:06 s-macbook-pro-17 app[935]: MainView alloc complete
Sep 20 21:59:06 s-macbook-pro-17 app[935]: loadView complete
I have a 3.1 xcode project that has been running my app just fine under the 3.1.3 version of the OS. I've been testing this app on my iphone 3G ( not running IOS 4 ).
I just copied over the XCode project and files, downloaded the latest XCode 3.2.4 with the 4.1 SDK. When I run my application via the simulator it just comes up blank instead of showing my app. I can see via the NSLog statements that it's actually getting to my initWithFrame() and viewDidLoad() methods but it's like it didn't load the images correctly.
I've tried copying the files back into the xcode project and allowing it to update references. I've also tried using 4.0 and 4.1 of the SDK along with the iphone 4 and iphone simulators under hardware.
I do see some errors from system.log:
Sep 20 21:59:01 s-macbook-pro-17 [0x0-0x18018].com.apple.Xcode[484]: Xcode(484,0x7fff70216c20) malloc: reference count underflow for 0x2019c0a40, break on auto_refcount_underflow_error to debug.
Sep 20 21:59:01 s-macbook-pro-17 Xcode[484]: Xcode(484,0x7fff70216c20) malloc: reference count underflow for 0x2019c0a40, break on auto_refcount_underflow_error to debug.
Sep 20 21:59:03 s-macbook-pro-17 com.apple.launchd.peruser.502[127] (com.apple.iPhoneSimulator:com.apple.managedconfiguration.profiled): Bug: launchd_core_logic.c:4598 (24108):2
Sep 20 21:59:03 s-macbook-pro-17 com.apple.launchd.peruser.502[127] (com.apple.iPhoneSimulator:com.apple.managedconfiguration.profiled): Path monitoring failed on "/Users/m/Library/Application Support/iPhone Simulator/4.1/Library/ConfigurationProfiles/profiledRunning": No such file or directory
Sep 20 21:59:03 s-macbook-pro-17 com.apple.launchd.peruser.502[127] (com.apple.iPhoneSimulator:com.apple.managedconfiguration.profiled): Bug: launchd_core_logic.c:4598 (24108):2
Sep 20 21:59:03 s-macbook-pro-17 com.apple.launchd.peruser.502[127] (com.apple.iPhoneSimulator:com.apple.managedconfiguration.profiled): Path monitoring failed on "/Users/m/Library/Application Support/iPhone Simulator/4.1/Library/ConfigurationProfiles/MCOutstandingNagComputation": No such file or directory
Sep 20 21:59:03 s-macbook-pro-17 com.apple.launchd.peruser.502[127] (com.apple.iPhoneSimulator:com.apple.managedconfiguration.mdmd): Bug: launchd_core_logic.c:4598 (24108):2
Sep 20 21:59:03 s-macbook-pro-17 com.apple.launchd.peruser.502[127] (com.apple.iPhoneSimulator:com.apple.managedconfiguration.mdmd): Path monitoring failed on "/Users/m/Library/Application Support/iPhone Simulator/4.1/Library/ConfigurationProfiles/MDMOutstandingActivities.plist": No such file or directory
Sep 20 21:59:03 s-macbook-pro-17 vot[929]: ******** AX INSPECTOR MODE ************
Sep 20 21:59:03 s-macbook-pro-17 vot[929]: **** Running VoiceOver Lite ****
Sep 20 21:59:06 s-macbook-pro-17 app[935]: MainView alloc
Sep 20 21:59:06 s-macbook-pro-17 app[935]: MainView alloc complete
Sep 20 21:59:06 s-macbook-pro-17 app[935]: loadView complete
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我通过界面生成器在主窗口上设置了“启动时可见”属性。使用 XCode 3.1 时,我的其他 macbook pro 上的 xcode 项目中没有此设置。
我遇到了这个对我有帮助的线程:
iPhone SDK4.0 和 xcode 3.2.3 问题
I set the "Visible at launch" property on the main window via interface builder. I didn't have this set in my xcode project on my other macbook pro when using XCode 3.1.
I came across this thread that helped me:
iPhone SDK4.0 and xcode 3.2.3 issue
我的应用程序中也存在类似情况,但我的问题是,不知何故,在 IB 中的 MainWindow.xib 中,文件所有者的委托不再链接到我的应用程序委托(右键单击 IB 中的文件所有者并检查委托按钮)。在 Ipad 模拟器中工作,因为我有 2 个不同的 MainWindow xib 文件,一个用于 iphone/ipod,一个用于 ipad。
希望这可以帮助那些在启动时遇到黑屏的人。
Similar situation in my app, but my problem was that somehow, in the MainWindow.xib in IB, the File Owner's delegate was no longer linked up to my app delegate (right click on File Owner in IB and check the delegate button). Was working in Ipad simulator because I have 2 different MainWindow xib files, one for iphone/ipod and one for ipad.
Hope this helps someone experiencing a blank screen on startup.