Presentation is loading. Please wait.

Presentation is loading. Please wait.

Lec 12 Pickers CS 3800 Introduction to IOS programming Lecture 16 Summer 2011.

Similar presentations


Presentation on theme: "Lec 12 Pickers CS 3800 Introduction to IOS programming Lecture 16 Summer 2011."— Presentation transcript:

1 Lec 12 Pickers CS 3800 Introduction to IOS programming Lecture 16 Summer 2011

2 Announcements Program 6 due Tonight Program 7 Tuesday: Intro To Graphics Lec 16 Persistence

3 Topics Persistence: –What? –Multi-tasking Persistence: –System User Preferences –NSUserDefaults –pList –NSData –other Lec 16 Persistence

4 Persistence Persistence: what? Persistence: Multi-tasking –turning off multi-tasking –applicationWillEnterForeground –applicationWillEnterBackground –applicationWillTerminate Lec 16 Persistence

5 App User Preferences System Settings, app?, both? Demo (ch 12) Lec 16 Persistence

6 Ch 11 Example Creating –Settings Bundle owner? Root.plist review structure,types Navigation Example Lec 16 Persistence

7 Ch 11 Example, continued Accessing from your app –[NSUserDefaults standardUserDefaults] –#defining keys –objectForKey –setters Multi-tasking concerns –Notifications –selector Lec 16 Persistence

8 Ch 12 Example Version 0 not in book uses NSUserDefaults Overview: –‘state’ to save? –Clearing the simulator –first time access issues Lec 16 Persistence

9 Ch 12 Example Version 0 continued Load state - where? first time access? add multiTasking Lec 16 Persistence

10 Ch 12 Example version 1 - Plist app Sandbox –Documents folder –Library - Preferences –Create a container object –add data to container –write container to plist file –Serialization Lec 16 Persistence

11 Ch 12 Example: archiving For generic ( complex ) models implement the NSCoding protocol –encodeWithCoder –initWithCoder –NSCopying Protocol Lec 16 Persistence

12 Ch 12 Example: archiving continued Persistence 2 ‘model’ fourLines @interface FourLines : NSObject –encode/decode the fields –view controller archive un-archive Lec 16 Persistence

13 Persistence - other SQLite3 –relational database, Core Data Lec 16 Persistence


Download ppt "Lec 12 Pickers CS 3800 Introduction to IOS programming Lecture 16 Summer 2011."

Similar presentations


Ads by Google