IPhone Tech Talks/iPhone Development Tools

From ceejayoz

Jump to: navigation, search

Michael Jurewitz (jurewitz@apple.com)

Contents

[edit] Four main tools

  • Xcode - integrated development environment
  • Interface Builder - interface design tool
  • iPhone Simulator - what it says on the tin
  • Instruments - performance analysis tool

[edit] Xcode tips

  • Command+Doubleclick on class/function - go to documentation
  • Edit > Edit all in scope - change variable name everywhere within its scope, better than find/replace

A .nib file - .m (implementation) + .xib (xml depiction of interface)


[edit] Simulator

Simulator is NOT HARDWARE SIMULATION

  • apps will be much slower in iPhone
  • there are some APIs you can use in the simulator that won't run on iPhone! not usually a problem, can be useful for debugging
#if TARGET_IPHONE_SIMULATOR
  // simulator code
#else
  // iphone code
#end

[edit] Debugging tools (only in simulator)

  • DTrace - trace usage of methods
  • NSZombies - keeps "husk" of objects for debugging
  • Guard Malloc - find buffer over/underflows

[edit] Interface Builder

In interface builder, Control+drag = how to set up outlets (ex: assigning UIView to RootViewController)

return type of IBAction - compiles down to void

[edit] Getting the app on the iPhone

  • requires code signing
  • add devices via UDID (Unique Device Identifier) on the Developer Portal (web)
  • generate keys via Keychain Access (/Apps/Utilities)
  • generate a cert with keys on Developer Portal
  • BACK UP AND PROTECT CERTIFICATE!
  • create provisioning profile in Developer Portal

on device - breakpoints allow viewing of live values / memory locations for stuff via mouseover in code

[edit] Instruments performance app

see what caused spikes! ObjectAlloc+Sampler+Disk Monitor, Option+Drag to select the spike area - see what ran during that time!

Personal tools