iOS 5 is the latest in a great line of software updates for the Apple mobile devices. Beside the highly expected interface updates (new Notification Center, controls, etc.), lots of low level changes are taking place.
Paul was talking about the new Automatic Reference Counting (ARC) for memory management, iCloud storage, Twitter integration, storyboards, Newsstand apps, location simulation, airplay mirroring (iPad 2 only) as well as the new default apps and changes to existing ones.
5. iCloud
storage in the cloud
documents
value-key data
hello24.com SkillsMatter - Nov 2011
6. iCloud Opt-in backup
Space is limited
what’s backed up:
Documents
Library (partially)
It just works happens
either iCloud or iTunes backup
hello24.com SkillsMatter - Nov 2011
7. iCloud Opt-in backup
hello24.com SkillsMatter - Nov 2011
8. iCloud Storing Key-Value
Data
NSUbiquitousKeyValueStore
similar with NSUserDefaults
but not a replacements
hello24.com SkillsMatter - Nov 2011
9. iCloud Storing Key-Value
Data
hello24.com SkillsMatter - Nov 2011
10. iCloud Storing Key-Value
Data
hello24.com SkillsMatter - Nov 2011
13. iCloud Storing Key-Value
Data
bool, double, long long
NSString, NSData
collections: NSArray, NSDictionary
NSNumber, NSDate
hello24.com SkillsMatter - Nov 2011
14. iCloud Storing Key-Value
Data
bool, double, long long
NSString, NSData
collections: NSArray, NSDictionary
NSNumber, NSDate
key: 64B
value: 4KB
hello24.com SkillsMatter - Nov 2011
15. iCloud Storing Key-Value
Data
don’t save lots of data
NSUserDefaults in the cloud
- (NSDictionary *)dictionaryRepresentation
- (void)removeObjectForKey:(NSString *)aKey
hello24.com SkillsMatter - Nov 2011
16. iCloud Storing Key-Value
Data
NSUbiquitousKeyValueStoreDidChangeExternallyNotification
register for notification
syncronize
hello24.com SkillsMatter - Nov 2011
17. iCloud Storing documents
each application has its own sandbox
folders can be created inside the dedicated
area
create a Documents folder
use to manage only critical data
hello24.com SkillsMatter - Nov 2011
18. iCloud Storing documents
hello24.com SkillsMatter - Nov 2011
19. iCloud Storing documents
hello24.com SkillsMatter - Nov 2011
20. iCloud Storing documents
Check if iCloud storage is available:
- (NSURL *)URLForUbiquityContainerIdentifier:(NSString *)containerID
NSFilePresenter protocol
NSFileCoordinator class
create NSURL for the file
- (BOOL)setUbiquitous:(BOOL)flag
itemAtURL:(NSURL *)url
destinationURL:(NSURL *)destinationURL
error:(NSError **)errorOut
- (BOOL)startDownloadingUbiquitousItemAtURL:(NSURL *)url
error:(NSError **)errorOut
hello24.com SkillsMatter - Nov 2011
21. iCloud Resources
iCloud for Developers
developer.apple.com/icloud/
WWDC11 sessions:
501: iCloud Storage Overview
116: Storing Documents with iCloud using iOS5
hello24.com SkillsMatter - Nov 2011
22. ARC
(Automatic Reference Counting)
hello24.com SkillsMatter - Nov 2011
25. ARC
works at compiler level
evaluates objects’ lifetime
automatically does memory management for you
same rules
iOS5 & OS X Lion (XCode 4.2)
hello24.com SkillsMatter - Nov 2011
27. ARC Limitations
cannot explicitly invoke
retain,
release / autorelease
dealloc
can’t store objects in C structure
can’t cast between object and non-object
types
hello24.com SkillsMatter - Nov 2011
28. ARC Things to consider
ARC can be intermixed with non-ARC
still need to understand memory management
will cause rejections
hello24.com SkillsMatter - Nov 2011
33. ARCObject lifetime
qualifiers
retai
n
@property(strong) MyClass *myObject;
@property(weak) MyOtherClass *delegate;
assig
n
hello24.com SkillsMatter - Nov 2011
35. ARC LLVM & Clang
Low Level Virtual Machine - compiler
infrastructure
written in C++
language agnostic
Clang - compiler front-end for C, C++,
Objective-C, Objective-C++
hello24.com SkillsMatter - Nov 2011
36. ARC LLVM & Clang
shorter compilation times than GCC
creates code that runs faster
incremental compilation
tighter integration with the IDE GUI
hello24.com SkillsMatter - Nov 2011
37. ARC How to
hello24.com SkillsMatter - Nov 2011
38. ARC How to -fobjc-arc
hello24.com SkillsMatter - Nov 2011
39. ARC How to
hello24.com SkillsMatter - Nov 2011
40. ARC How to
hello24.com SkillsMatter - Nov 2011
55. Newsstand
magazines & newspapers
period content update
auto-renewal subscriptions & single issues
hello24.com SkillsMatter - Nov 2011
56. Newsstand App settings
UINewsstandApp
hello24.com SkillsMatter - Nov 2011
57. Newsstand Icon
hello24.com SkillsMatter - Nov 2011
58. Newsstand Icon
90px UINewsstandIcon
90px
Binding type: Binding edge:
‣ Magazine ‣ Left
‣ Newspapaper ‣ Right
‣ Bottom
hello24.com SkillsMatter - Nov 2011
59. Newsstand Icon
90px UINewsstandIcon
90px
Binding type: Binding edge:
‣ Magazine ‣ Left
‣ Newspapaper ‣ Right
‣ Bottom
hello24.com SkillsMatter - Nov 2011
60. Things to
Newsstand
consider
only one download in 24 hours period
push notification
content-available=1
size matters
user is control
hello24.com SkillsMatter - Nov 2011
61. Newsstand How it works
hello24.com SkillsMatter - Nov 2011
62. Newsstand How it works
remote notification received (content-available=1)
hello24.com SkillsMatter - Nov 2011
63. Newsstand How it works
remote notification received (content-available=1)
app is woken up
hello24.com SkillsMatter - Nov 2011
64. Newsstand How it works
remote notification received (content-available=1)
app is woken up
content download initiated
hello24.com SkillsMatter - Nov 2011
65. Newsstand How it works
remote notification received (content-available=1)
app is woken up
content download initiated
app goes to sleep
hello24.com SkillsMatter - Nov 2011
66. Newsstand How it works
remote notification received (content-available=1)
app is woken up
content download initiated
app goes to sleep
download finishes - content is stored in a
Newsstand managed directory
hello24.com SkillsMatter - Nov 2011
67. Newsstand How it works
remote notification received (content-available=1)
app is woken up
content download initiated
app goes to sleep
download finishes - content is stored in a
Newsstand managed directory
app is woken up & notified the download is done
hello24.com SkillsMatter - Nov 2011
68. Newsstand How it works
remote notification received (content-available=1)
app is woken up
content download initiated
app goes to sleep
download finishes - content is stored in a
Newsstand managed directory
app is woken up & notified the download is done
app goes back to sleep
hello24.com SkillsMatter - Nov 2011
69. Newsstand Classes
hello24.com SkillsMatter - Nov 2011
73. Newsstand NKIssue
name
date
status
NKIssueContentStatusNone,
NKIssueContentStatusDownloading,
NKIssueContentStatusAvailable
contentURL
downloadingAssets
hello24.com SkillsMatter - Nov 2011
97. UIKit Other additions...
new Notification System
Built-in Face Recognition
NSLinguisticTagger
CLGeocoder
NSIncrementalStore
NSFileVersion
NSJSONSerialization
hello24.com SkillsMatter - Nov 2011
98. UIKit Resources
WWDC11 session:
100: What’s new in Cocoa Touch
hello24.com SkillsMatter - Nov 2011