开发者

iPhone Tableview doesn't work for Apple testers

My application has been reje开发者_开发技巧cted because the application did not function when reviewed by the iPhone App Review Team. The application is supposed to load words into a table view, but did not do so during the review. However, the application functions perfectly on my iPhone. Can you please give me any suggestions as to why an application would work perfectly on one iPhone but not on the iPhone used in the review process?

Here are the technical details:

  1. The project was compiled on a MacBook Pro running Mac OS X 10.6.2 (10C540)
  2. Xcode version 3.2.1 64-bit Xcode IDE: 1613.0 Xcode Core: 1614.0 ToolSupport: 1591.0
  3. Base SDK version 3.1.3
  4. Optimization Level: Fastest, Smallest [-Os]
  5. My iPhone is a 3GS with 3.1.3 OS

I suspect that the method -(UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath is not being called. This method is in the delegate defined as @interface WordTableViewController : GenericTableViewController where the class GenericTableViewController is defined as @interface GenericTableViewController : UITableViewController .

I suspect the above to be the case because at one point in my development, debugging the release version on the iPhone revealed that -(UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath was not being called, though it was being called when debugging the debug version on the same iPhone. I resolved that issue after days of investigation. I resolved it by simply changing the optimization level in the release configuration and then changing it back to its original value. This was very strange to me.

For the most recent app submission in question, I recreated the distribution configuration by duplicating the functioning release configuration. I then created an ad-hoc configuration by duplicating that distribution configuration. Now, the application functions perfectly on my iPhone for the release, debug and ad-hoc distribution. It does not function at Apple, however.

Your comments will be VERY highly appreciated!


One thing to consider. NSUserDefaults.

When you do your test cases, to you have test cases where the UserDefaults are:

  1. Empty.
  2. Corrupted.

Apple will be starting the app with no user defaults and, if you do not clear them from time to time, your test bed with both the simulator and target hardware will have defaults stored.

If you are not using NSUserDefaults to store state data, we will need more information.


Aside from starting clean, like Steven suggest (delete your application completely from your iPhone and reinstall it), the biggest causes of inconsistent behavior between devices seem to be memory- and threading-related.

You state that you are using an iPhone 3G S, which has significantly more memory than the older models of iPhone / iPod touch. If you can, test out your application on one of these older devices yourself, or find someone willing to beta-test your application (you mentioned having a working ad-hoc build, so you're most of the way there for this). If you can't get access to one of these devices, run your application on your device using the Memory Monitor (not ObjectAlloc) instrument and observe the peak memory usage of your application. If it rises above 20 MB at any time, it may be getting sent low memory warnings on older devices, which your application may not be handling properly. You can artificially induce low memory warnings in the Simulator using Hardware | Simulate Memory Warning as well and see what happens.

If you use any background threads for processing, they also can cause nondeterministic behavior. The iPhone 3G S has a much faster processor than early model iPhones / iPod touches, so things might be executing in a different order on your device than theirs. Verify that you are properly locking access to shared resources and not performing UI updates on a background thread.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜