iphone development: zero to sixty
DESCRIPTION
A Presentation I did for Northwest Of US Mac User Group - Programmers Special Interest Group on Thursday October 2, 2008. Get in touch if you like it or even if you hate it!TRANSCRIPT
iPhone Development
Zero to Sixty
Tom Swift1821 Design
Who the hell am I?
• iPhone Developer: Thomas Swift• Owner of 1821 Design
• http://1821design.com
• Rails Developer & Web Designer• http://twitter.com/tmy - add me
• or don't (i swear a lot)
Why iPhone Development?
• The iPhone kicks ass• 3G and GPS• Powerful• OpenGL ES
• Mac Development• Xcode & Objective-C • App Store
• One Stop Shop• Easy For Users• Great For Developers *
Getting Started• What you need
• iPhone Developer Account• Newest Xcode• Intel Machine :(
• What you (really) need• iPhone or iPod Touch• Developer Certificate• Patience or some sort of mechanism to cope
Learning Objective-C or: How I Learned to Stop Worrying and Love the Bracket
Objective-CThings that threw me for a loop• Bracket Madness
• Method Calling• [object method:param] instead of object.method(param)
• Plus and Minus in front of method calls• Going back to two files .m and .h• Pointers and Memory Management • Extremely long names of things
• UIBarButtonItem *buttonItem = [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemDone target:self action:@selector(toggleView)];
• Get Over It• I’m sure I forgot something
Where I startedApple Sample Code
• Apple Sample Code is like an old BMW M5
Which M5 - E60 M5 ?
Which M5 – E36 M5?
Nope: the E34 M5
Why is Apple Sample code like a old BMW M5?
• Hand built by Single Person or a small team• Test Drivers were able to tell who built them• Each had own individual style to match objective• Pretty badass and very relevant• They get the job done • A Little Old – except a few
Good Apple Samples• LocateMe
• CoreLocation• Delegates
• SpeakHere• AudioToolbox• AudioQueue
• AccelerometerGraph• SeismicXML
• Pulling from the web• Reachability
• Wifi, Cell Network • Many More
Learning From Them• Remove the 50 pages of comments from each file• Start from the top
• main.m• <APP>AppDelegate.h .m
Xcode is slick• Research Assistant• Code completion
• press esc• Breakpoints & GDB• Documentation• Code Folding• Instruments
A few tips• An Error is an Error• A Warning is an Error - Fix it
• When you alloc init something release it when your done with it
• Link to frameworks inside the iPhone SDK Frameworks, sometime you’ll get funky build errors• Speaking of building• ABB – Always Be Building
Simulators are no fun *Except for SimCity
• It’s a little faster to compile it to the simulator• You can test out your didReceiveMemoryWarning (a little harder on the device)
Taste The Real Thing
• Accelerometer• GPS• Microphone *• Real Memory Space• Testing Hand Interaction (that sounds sick)
• Left Handed, Right Handed• Screen Orientation• Keyboard Flow
• Oh crap! Phone Call• No WIFI, No Cell Signal
Developer Certificate
Getting that app on the Device
• Program Portal• http://developer.apple.com/iphone/manage/overview/index.action
• Generate on keys the machine• Upload to Apple• Setup a Provision Profile• Download the Profile• Install in Xcode• Send app to device
Program Portal
Team
Certificates
Devices
App IDs
Struggle
Provisioning Profile
Installing Provisioning Profile
• Download and Drag to Xcode• Xcode should be open
• When things get jacked up• Restart Xcode• remove profiles
• delete from ~/Library/MobileDevice/Provisioning Profiles
• drag the downloaded one to Xcode again• restart xcode for good measure
• tweet about stabbing your eyes out
Build?• Not Yet – Error 0xE8000001• Change Build Settings and info.plist
2nd Most Important Slide
Right Click Blue IconGet InfoClick on Build Tab
Build Settings
YES!!!
Where to turn to when the S hits the fan?(before fnda lifted)
• Apple Docs• Cocoa Dev Wiki • The Googles• http://www.iphonedevsdk.com/forum• IRC #iphonedev on freenode • Apple Dev Mail list• Existing Source Code
• Wordpress iPhone Code
* App Store• First off, It’s awesome
• But,• REVIEWS • Loose Guidelines• NDA’d Rejections• Sea of pointless apps *• No Trials• Cheap People
Don’t Take My Word for it• I am not an expert• I have no apps on the store• Based on personal experience• Your results WILL vary• Not Covered
• Distribution and Ad-Hoc
Enough Blab Let’s build something!
Thomas Swift1821 Design
Slides: http://www.slideshare.net/1821Design/