tags:

views:

109

answers:

2

Has anyone had difficulty getting what has otherwise been a solid iPhone app working on the iPad? I was under the impression that iPhone apps would run without problems on the iPad. We are are experiencing crashes (not intermittent - same place, at same time) that we've never gotten on the iPhone or iPod Touch. I have become suspicious that the crashes are memory-management related, but even if so, why only on the iPad?

    2010-05-17 10:19:06.474 ASSIST[82:207] *** Terminating app due to uncaught 
exception 'NSUnknownKeyException', reason: '[<UISectionRowData 
0x6041480> valueForUndefinedKey:]: this class is not key value coding-compliant 
for the key deliveryDate.'
    2010-05-17 10:19:06.481 ASSIST[82:207] Stack: (
    852041337,
    861292157,
    852040861,
    850755255,
    850750995,
    850758945,
    81279,
    123007,
    126693,
    149141,
    851599725,
    827486573,
    827486477,
    827486431,
    827485745,
    827487359,
    827454123,
    851903137,
    851590065,
    851588321,
    819339483,
    819339655,
    827151561,
    827144691,
    9461,
    9324
    )
    terminate called after throwing an instance of 'NSException'
Program received signal:  “SIGABRT”.
A: 

[ valueForUndefinedKey:]: this class is not key value coding-compliant for the key deliveryDate implies a possible constant that does not apply to iPad. Try using NSLog() to track down the buggy code.

Moshe
A: 

It looks like memory issue. Probably you should use NSZombie to check what's wrong, and use the "Build and Analyze" option to check statically for any memory management problems.

About why iPad crashes but iPhone does not — remember that iPad runs on iPhoneOS 3.2, while the iPhone is still running 3.1. The internals could be changed a lot. Of course the "iPhone simulation mode" on the iPad is running 3.2 code.

Therefore, a possibility is you have a memory management bug in the original software. The object got -retained internally in the old 3.1 firmware (e.g. added to an NSArray). But Apple's code may have changed such that the -retain is no longer needed, and exposed the bug.

KennyTM
KennyTM, That's the first thing I've heard that makes sense with what I'm experiencing. If that were the case, would one not expect a substantial number of reports of this? By the way, I used NSZombie and that's how I pinpointed the culprit and concluded a mem mgmt issue. Build and Analyze doesn't yield any results (now) although it was reporting quite a few at one point. Not sure what's up with that yet. Still, you think it likely that Apple had 3.1 code that was actually modifying the retain counts of objects? Seems like they would've stayed miles away from doing that.
Alyoshak
@alyoshak: `-retainCount` is unreliable. Adding the object to an NSArray increases the retain count. Put the object as a subview increases the retain count. It's fine as long as the overall change is 0.
KennyTM
KennyTM: Right, I think I understand. But *something* is different, and it is different enough to mask a crash on one device and allow one on another. Surely we're not the only one, though I guess that is possible. I guess I was hoping that not a few voices would chime in acknowledging a similar experience.
Alyoshak
As a final comment, the problem was indeed a memory management bug, but it remains uncertain as to why the iPad suffers from it when iPhones and iPod Touches do not.
Alyoshak