views:

57

answers:

1

Currently I am working on a production app. One function acts like the settings.app on iPhone. When the user click a cell of a tableView, as shown below

http://www.penguintech.net/images/stackoverflow/1.png

It will push another view, which includes a textfield to let user input something.

However, on both simulator and device, after the app just loaded, the delay between clicking and showing the second view takes around 2 seconds. Then if user get back to previous view and click again, it will be no delay at all.

To detect which method makes the delay, I put a NSLog() in every involved methods, but when I was inspecting the console while running the app, all NSLog() message showed in 0.1 seconds, and then still a delay on the app.

Is there any other way to trace the performance footage of a app? The Instruments shows only CPU usage in Mac OS not in iPhone.

A: 

Instruments should work for the device too. Build and run on the device using Instruments. Your device has to be connected to the computer while you do this. This will show you information about the memory etc while the app is running on your device.

It sounds like the delay is in setting up your view. One likely cause is that you are loading something from the Internet in the view (perhaps an image that you have to download?). If that's the cause, you should do the slow work asynchronously.

I'm not a debugging expert, but I've heard that Shark is better for performance problems. You might want to read up on how to use it too.

nevan
I figured out how to inspect iPhone device by Instruments, thx. But the Shark is all about Assembly Language... I can't play with it.
Stewart Hou
That's great that you got Instruments working. Like I said, I'm not all that knowledgable on debugging and Shark, but you should be able to use Shark in the same way as Instruments. Here's the Apple guide: http://developer.apple.com/mac/library/documentation/DeveloperTools/Conceptual/SharkUserGuide/Introduction/Introduction.html
nevan