views:

211

answers:

3

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

A: 

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:'.

Jonathan Watmough
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
Sounds like a good use of a 'tech support incident' with the iPhone team!
Jonathan Watmough
A: 

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

Clay Bridges
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
Deprecated, not depreciated: http://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
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
I don't believe most would consider "RTFM? ;)" a greivous insult.
Clay Bridges
A: 

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!

MarqueIV