2. Agenda
• Requirements
• The Objective C Programming Language
• Cocoa Touch & Basic Design Patterns
• Apple Developer Tools
• Apple Developer Portal
• Resources
onsdag den 7. september 2011
4. Hvem er jeg?
• Freelance udvikler i Barkode ApS & Bigger
• Objective C, Java, Python
• Udvikler af “Risteriet”, “MitNykredit”
iPhone applikationerne
• Arbejder p.t. på en ny universal app for
Infopaq International A/S
• Mac fanboy!
onsdag den 7. september 2011
5. Hvorfor iOS Platformen?
• Nysgerrig efter en ny platform.
• en ny platform
• en ny type device
• Andre problemstillinger end Enterprise Java
• Et “nyt” programmeringssprog og et nyt framework.
• Mac fanboy!
onsdag den 7. september 2011
7. Risteriet
• Primært tænkt som reklame for et
mindre kafferisteri i det indre København.
• Benyttede frameworks:
• Core Location
• MapKit
• MediaKit
• JSON (eksternt framework)
• Core Animation
onsdag den 7. september 2011
9. Mit Nykredit
• Nykredits Mobile Bank
• Ekstremt hurtigt udviklet
• Udvalgte benyttede frameworks:
• Core Location / MapKit
• MediaKit
• Core Animation og en del custom UIView’s
• Valuta beregner
• Pinkode husker
• Diverse tabeller
• ...
• Webservices
onsdag den 7. september 2011
10. Mit Nykredit
• Nykredits Mobile Bank
• Ekstremt hurtigt udviklet
• Udvalgte benyttede frameworks:
• Core Location / MapKit
• MediaKit
• Core Animation og en del custom UIView’s
• Valuta beregner
• Pinkode husker
• Diverse tabeller
• ...
• Webservices
onsdag den 7. september 2011
12. Get a Mac!
• En Mac computer og helst et iOS device
• Medlem af Apples iOS Developer Program - $99
• Installering af SDK og Developer Tools
• “Live by the rules defined by the mothership”
onsdag den 7. september 2011
13. The Objective C
Programming Language
onsdag den 7. september 2011
14. Objective C
• Superset til C og derfor kan man benytte C og C++
• Objekt orienteret (1986) og baseret på message
passing ala Smalltalk.
• Udvidet i 2006 med properties, garbage collection og
fast enumeration etc.
• Memory Management
• OSX - Garbage Collection.
• iOS - explicit memory management
(reference counting) (iOS 3/4).
• “Automatic Reference Counting” (iOS 5)
onsdag den 7. september 2011
16. Objective C Syntax 2/3
@implementation classname
@synthesize type_name;
+ (return_type)classMethod
{
// implementation
}
- (return_type)instanceMethod2WithParameter:(param1_type)
param1_varName andOtherParameter:(param2_type)param2_varName
{
// implementation
}
@end
onsdag den 7. september 2011
17. Objective C Syntax 3/3
@implementation ClientsMapViewController
@synthesize titleBar, mapView;
#pragma mark -
#pragma mark Lifecycle
// Implement viewDidLoad to do additional setup after loading the view, typically from a nib.
- (void)viewDidLoad {
[super viewDidLoad];
!
! UIImageView *background = [[[UIImageView alloc] initWithFrame:CGRectMake(0, 0, 320, 44)] autorelease];
! background.autoresizingMask = UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight;
! background.image = [UIImage imageNamed:@"dark_wood_tile"];
! [self.titleBar addSubview:background];
! // Sending the image to the back ensures that the text isn't shadowed by the image
! [self.titleBar sendSubviewToBack:background];
! UIFont *font = [UIFont fontWithName:@"Lobster 1.4" size:17];
! UILabel *header = [[UILabel alloc] initWithFrame:CGRectMake(0, 0, 320, 44)];
! header.text = @"Clients in the center of Copenhagen";
! header.font = font;
! header.textAlignment = UITextAlignmentCenter;
! header.textColor = [UIColor whiteColor];
! header.backgroundColor = [UIColor clearColor];
! self.titleBar.topItem.titleView = header;
!
...
}
...
onsdag den 7. september 2011
18. Cocoa Touch
&
Basic Design Patterns
onsdag den 7. september 2011
19. Cocoa Touch
Selected Frameworks
• Core Audio • Open GL ES • Map Kit
• Open AL • Quartz 2D • Store Kit
• Media Library • Bonjour • Event Kit
• AV Foundation • Webkit • Game Kit
• Core Data • BSD Sockets • Core Image
• SQLite • Address Book • UI Kit
• Core Animation • Core Location
onsdag den 7. september 2011
20. Model-View-Controller
Controller Coordination
Update Changes
Controller
Changes Update
Model View
Model Data View Display
onsdag den 7. september 2011
21. Delegate Pattern
• Formål: En delegate er et objekt, der får muligheden for
at reagere på ændringer i eller påvirke adfærden hos et
andet objekt.
• I Cocoa og Cocoa Touch benyttes følgende navne
konvention for delegate metoder:
• should
• will
• did
onsdag den 7. september 2011
24. Xcode 4
• Plus
• Static Analysis
(http://clang-analyzer.llvm.org/)
• Markant lettere at uploade til iTunes Connect
og tilføje devices end tidligere
• Git integration
• Minus
• Desværre stadigvæk lidt buggy
• Refactoring?
onsdag den 7. september 2011
25. Interface Builder
• GUI Builder til hhv. iOS og OSX
programmer.
• Interface designet gemmes i XIB
filer og kompileres til NIB - realt
en serialisering af objekter.
• Utroligt simpelt men stærkt.
onsdag den 7. september 2011
26. iOS Simulator
• Til hurtig afvikling af dine
programmer - men ikke devicet
da simulator og device ikke er
100% ens.
• Understøtter flere typer af SDKs
samt Retina display og iPad.
onsdag den 7. september 2011
27. Instruments
• Instruments er din ven!
• Bruges til at finde memory leaks,
og over releases (NSZombie)
• Bruges også til at optimere
performance, finde flaskehalse
eller afvikling af automation
scripts.
onsdag den 7. september 2011
30. Provisioning Portal
• Configure Profile
• Certificates
• Signering af App før den kan afvikles på et device
• Devices
• 100 devices
• AppID
• Bruges bla. til In App Purchases, Push Notification, Hardware
Accessory, Game Center & iCloud
onsdag den 7. september 2011
31. Provisioning Portal
• Download & Install
• Development Provisioning Profile indeholder:
• Development Certificates
• Unique Device Identifiers
• App ID.
• Build & Go
• Ad hoc distribution - beta builds
• AppStore distribution - production builds
onsdag den 7. september 2011
32. iTunes Connect
• Produktet oprettes i AppStore via iTunes Connect
• Beskrivelse af produktet samt keywords
• Kategori
• Screen Shots
• Tilgængelighed (lande)
onsdag den 7. september 2011
35. The new kid on the block
• AppCode fra Jetbrains
• Bygger på Jetbrains IntelliJ framework
• Refactoring kendt fra Jetbrains andre
produkter så som IntelliJ, PyCharm,
RubyMine etc.
• Integration med andre (D)VCS
• Plugin ecosystem
• Kræver at Xcode og SDK allerede er
installeret
onsdag den 7. september 2011
37. Online
• Google Group - cocoa-unbound
http://groups.google.com/group/cocoa-
• CocoaDev - wiki
http://cocoadev.com/
unbound/
• Cocoa Dev Central
• Cocoa With Love - blog
http://cocoawithlove.com/
http://cocoadevcentral.com/
• Der findes en del fine
• Cocoa is my girlfriend -blog
http://www.cimgf.com/
frameworks på Github
http://github.com
• Apple Developer Connection
Forum
onsdag den 7. september 2011
38. Offline
CYAN YELLOW SPOT MATTE CYAN YELLOW SPOT MATTE
MAGENTA BLACK MAGENTA BLACK
PANTONE 123 C PANTONE 123 C
By
Companion
iP
BOOKS FOR PROFESSIONALS BY PROFESSIONALS® BOOKS FOR PROFESSIONALS BY PROFESSIONALS®
th
Companion
e
eBook
ho
be
eBook
st
Be De
-s
ne
el
Available
gi ve
lin
Available
g
nn lo
au
th
Turn Java Expertise into Mac OS X
or
in pm
More Great iPhone API
I
so
RELATED TITLES
g e
f
• Learn Objective-C, the language of native Mac and iPhone apps, by leveraging nterested in iPhone development? Want to learn more? Whether you’re a
More iPhone 3 Development
the Java programming skills you already have.
Learn Objective-C for Java Developers and iPhone App Productivity
self taught iPhone dev or have just made your way through the pages of
Coverage, Depth, and Insight
nt
Beginning iPhone 3 Development, we’ve got a great new book for you.
• Learn to use Apple’s development environment, including just enough Cocoa More iPhone 3 Development: Tackling iPhone SDK 3 digs deep into Apple’s latest
and Xcode. It’s the professional’s express route to Mac and iPhone developer
SDK, with bestselling authors Dave Mark and Je LaMarche explaining things
pro ciency.
as only they can, covering topics like Core Data, peer-to-peer networking us-
• Learn by working through the exercises and then keep returning for reference ing GameKit and network streams, working with data from the web, MapKit,
and further study. You’ll nd everything conveniently organized so you can in-application e-mail, and more. All the concepts and APIs are clearly laid out
reference techniques by design pattern. and come complete with code snippets you can customize for use in your
most ambitious apps.
W e all love Java, but Mac OS X is looking awfully cool these days and iPhone OS de-
velopment is the most exciting new environment since, well…, since Java! If only
there were a way to avoid learning objective-C. If you’re a Javahead, you probably know a lot
More iPhone 3 Development continues right where Beginning iPhone 3 Develop-
ment left o , starting with a series of chapters devoted to Core Data, Apple’s
new standard for iPhone Persistence. Je and Dave step you through the key
more about objective-C than you think. The two languages are full of similarities and that’s
concepts of Core Data, including techniques and tips speci cally for writing
why we’ve published Learn Objective-C for Java Developers, your shortcut to Mac and iphone
Large-Scale Applications. For writing professional iPhone apps, you’ll want
development productivity.
to embrace Core Data,.
Both languages are object-oriented, use similar inheritance models, string classes, garbage
The depth and breadth of Core Data coverage alone is worth the price of ad-
collection, serialization, threads, introspection, and communications. They also embrace
mission, but there’s so much more. This book covers a variety of networking
proven design patterns like Model-View-Controller and property accessors. You’re already a
mechanisms, from GameKit’s relatively simple BlueTooth peer-to-peer model,
good portion of the way there and you haven’t even opened this book!
to the addition of Bonjour discovery and network streams, through the com-
We’ll show you how to use what you know about Java to understand and become quickly plexity of acquiring information through Web File Access. Dave and Je also
pro cient in Objective-C. Most important, we’ll show you how to take advantage of features take you through advanced topics, such as Concurrent Programming and
unique to Objective-C and incorporate them into your designs. Don’t waste your hard-earned techniques for Debugging.
Learn Objective-C
Java knowledge by starting over in kindergarten. Move yourself to the head of the class and
Your knowledge of iPhone app creation can’t be considered complete until
More
catapult over the Objective-C learning curve. You’ll be writing Mac OS X and iPhone apps
you’ve mastered all the knowledge imparted and techniques revealed in More
faster than you ever imagined possible.
iPhone 3 Development.
James Bucanek has over 25 years of experience in software and systems development.
Dave Mark is a long-time Mac developer and author and has written a num-
Having made the transition to Mac OS X many years ago, he has never looked back.
ber of books on Macintosh development, including Learn C on the Macintosh,
The Macintosh Programming Primer series, and Ultimate Mac Programming. His
for
iPhone 3 Development
blog can be found at www.davemark.com.
Java Developers
Je LaMarche is a longtime Mac developer, and Apple iPhone
Developer. With over 20 years of programming experience, he’s written
RELATED TITLES
on Cocoa and Objective-C for MacTech Magazine, as well as articles
for Apple’s Developer Technical Services website. He has experience
Tackling iPhone SDK 3
working in Enterprise software, both as a developer for PeopleSoft
starting in the late 1990s, and then later as an independent consultant.
Bucanek Dave Mark | Jeff LaMarche
Mark
COMPANION eBOOK SEE LAST PAGE FOR DETAILS ON $10 eBOOK VERSION
ISBN 978-1-4302-2369-6 COMPANION eBOOK James Bucanek ISBN
SEE LAST PAGE FOR DETAILS ON $10 eBOOK VERSION 978-1-4302-2505-8
5 39 9 9 5 39 9 9
US $39.99 US $39.99
Shelve in Shelve in:
Mac Development Mobile Computing/Mac Development
SOURCE CODE ONLINE User level: SOURCE CODE ONLINE User level:
www.apress.com Intermediate–Advanced
9 781430223696 www.apress.com Intermediate–Advanced 9 7814 225058
30
this print for content only—size & color not accurate this print for content only—size & color not accurate
Trim: 7.5 x 9.25 spine =0.96875" 520 page count Trim: 7.5 x 9.25 spine = 0.000" 000 page count
onsdag den 7. september 2011
39. NSCoder Night
• NSCoder Night Copenhagen
• Onsdag kl. 19-22
• RETRO Nørrebro
Jægersborggade 14
2200 København N
• Twitter
@copenhagencocoa
onsdag den 7. september 2011