简体   繁体   中英

XCode 4 - IPhone Dev - Good Debug Tutorial

I'm beginning IPhone development with XCode 4 and Objectiv-C. Since I think strong debug and IDE knowledge is required to master a language, I'm looking for good resources about the debugging process and XCode.

A problem I faced recently was that, an unknownException was being thrown in a sample code and I couldn't know how to debug it, since it crashed right after jumping into my Main. I think with a better configuration, it would have been much easier to debug !

I've already found this resource : https://developer.apple.com/library/ios/navigation/

But I couldn't find something related to debug in there... Did I miss something ?

Easy to make mistakes in Objective-C...

  1. Not having a view attached to your view controller
  2. Sending a message to a deallocated instance. Turn on NSZombieEnabled.
  3. Forgot to add the Framework (eg MapKit)

If the crash isn't fixed at this point. Set a breakpoint in your app delegate and just step through every line until it crashes. Move the breakpoint up, run again, and inspect the values.

Apple has a list of what they consider to be the best debugging tricks for iOS here .

There is also a couple of videos on the developer's site. I can never find out how to make a direct link, but there aren't that many videos, so just search for "debug":

https://developer.apple.com/videos/wwdc/2012/

There is also one from last year: https://developer.apple.com/videos/wwdc/2011/

Access to the developer site requires registration.

Should you ever consider venturing into OS X territory, then here is the Apple-approved debugging magic .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM