iPhone SDK 3/4 App will not run on a iPhone 2.x device even with deployment target set to 2.0!

Ok... I know about the difference between the base/active SDKs and the deployment target. I have my base SDK set at 4.0 and the deployment target set at 2.0. I am not using any APIs post 2.x, conditional or otherwise. Since I can't debug on a 2.x device, after building it, I use the iPhone Configuration Utility to install the app on the device, which it does just fine. Problem is, it doesn't run! I just get a blank screen. The main window never comes up!

Now before you ask...

  1. I had this same problem with the iPhone SDK 3.x. I upgraded to the 4.x hoping it would be solved. It wasn't.

  2. Yes the provisioning profile is installed. (Couldn't install the app if it wasn't.)

  3. This same compiled app works fine on 3.x devices. Same with 4.x devices. Just not 2.x devices.

  4. Again, no I am not using any post-2.x SDKs. To prove this I created a brand-new, window-based app from the 'New Project' dialog and the only changes I made was the background color of the window (to prove the XIB loaded) and I set the deployment target to 2.0 (It's still compiled against the 4.x SDK though.) Again, it runs fine on 3.x or 4.x devices, but just a black, blank screen on 2.x devices.

I've tried this on three separate 2.x devices included one freshly restored. I've used three separate dev machines (MacBook Pro with the 3.x SDK, MacBook Pro with the 4.x SDK and a Mac Pro with the 3.x SDK.) Same result every time.

I am stumped.

The fact that even an unmodified project doesn't run really has me confused. Could it be the XIB file? Did they change the format from 2.x to something newer in the 3.x SDK? If so, how do I set it back to 2.x. (Again, this is just a complete guess.) But I'm really stumped!

Mark

link | edit | flag

74% accept rate
 
  

3 Answers

Have you checked the applicationDidFinishLaunching:options: call on your app delegate?

The options: parameter was added in 3.0 and is not present in any of my pre-3.0 code, although the earlier form still works.

The dictionary on options: is used to pass information to your app, such as 'was I started with a url from safari' etc.

If you expect to run on 2.0, you should probably change this back to the original 'applicationDidFinishLaunching:'.

link | edit | flag
 
 
Jon, this was code that has been running on 2.x devices from the get-go. Granted, I didn't check your suggestion with the new 'trial' project I created, so I'll do that, but that still doesn't answer why code that's been running fine on 2.x devices no longer does with the new SDK. My guess is something that's being linked that shouldn't be (or is mapped to newer something or other that's not being found on the older system) but that's really becoming a pain. Still, I'll check out your suggestion for the test project. –  MarqueIV Jun 13 '10 at 4:15
 
Sounds like a good use of a 'tech support incident' with the iPhone team! –  Jonathan Watmough Jun 15 '10 at 6:59

2.x is completely deprecated for publishing to the app store. You should be able to install it on a device using a previous version of xCode, but that's about it. More info in my community wiki here:

http://stackoverflow.com/questions/3161385

link | edit | flag
 
 
Hey Clay... it may have been depreciated for the app store, but what I want to see is what's actually changed. I know as per Jon above, the applicationDidFinishLaunching has changed, which may very well cause the demo apps to not start (haven't checked yet) and maybe that's just it... but I'd still like to see it documented (i.e. breaking changes, not just depreciated.) After all, I didn't get a warning about that (applicationDidFinishLaunching thing) when I built. –  MarqueIV Jul 6 '10 at 14:53
 
Deprecated, not depreciated: en.wikipedia.org/wiki/Deprecation . Every SDK release comes with a list of changes to the API, pretty up front. RTFM? ;) FWIW, applicationDidFinishLaunching: still works, but application:didFinishLaunchingWithOptions: is "highly recommended" instead, and gives you more (wait for it...) options. –  Clay Bridges Jul 6 '10 at 16:05
 
For the record, this WAS a behavioral change that Apple made but didn't document. Specifically, it has to do with neither the code, nor the XIB setting the window to be shown at launch. In one version of the SDK, they show it automatically, even when not marked. In the other, they don't. So in the other version, it hid a bug in our code. When we switched SDKs, that's where things broke and our error revealed itself. We fixed our code and it then worked. ...In case anyone did "RTFM" (Really? On SO?!!) and still had the same issues like we did. –  MarqueIV Sep 20 '10 at 0:20
 
I don't believe most would consider "RTFM? ;)" a greivous insult. –  Clay Bridges Sep 21 '10 at 17:14

up vote 0 down vote accepted

Turns out Apple did make a breaking change (or more accurately, a 'fixing' change) that they didn't comment on. Specifically, our app wasn't explicitly setting the main window visible either via code or via the 'Show at launch' option in IB. BUT... in one version of the SDK, the runtime, seeing nothing set but needing to display something, it implicitly showed the window in the main XIB file. However, the newer (and older) SDKs (runtimes actually) didn't have this implicit behavior so when our code didn't explicitly show the window, we just got a blank screen.

So we simply checked the 'Show at launch' option in IB and it worked. Done and done!

link | edit | flag
 
  

Your Answer

 
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 1
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值