Fluid UI Mobile Prototyper for iOS
.
Monday, October 29, 2012
Friday, October 19, 2012
iOS 資料保存 Data Persistence - NSUserDefaults
NSUserDefaults (Setting)
Property List (plist)
CoreData
.
Property List (plist)
CoreData
- - (void)applicationDidEnterBackground:(UIApplication *)application
- {
- NSUserDefaults *userDefault = [NSUserDefaults standardUserDefaults];
- [userDefault setObject:@"白彼得" forKey:@"name"];
- [userDefault synchronize];
- }
- - (void)applicationWillEnterForeground:(UIApplication *)application
- {
- NSString *name = [[NSUserDefaults standardUserDefaults] objectForKey:@"name"];
- NSLog(@"name %@", name);
- }
.
Thursday, October 18, 2012
iOS 資料保存 Data Persistence - Property List
NSUserDefaults (Setting)
Property List (plist)
CoreData
------------------------------------
iOS檔案位置管理:
專案附檔的都放在專案下
動態產生的都放在模擬器(實機)底下
好處:
1.專案附檔的plist有UI介面可以方便管理
2.由writeToFile:atomically寫出Property List
名詞解釋:
property list: 一種xml的資料格式
writeToFile: 寫檔動作,儲存plist到模擬器document資料夾的動作
NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES); : 模擬器/實機 的document資料夾位置
NSPropertyListSerialization: coverts Property List to/from NSData
iPhone 開發教學 - 使用 Property List 和 SQLite 處理資料儲存
(重要!教檔案位置,讀寫檔基本指令。)
Introduction to Property Lists (Apple Official)
相關指令 //codes are from 彼得潘app教學書
讀取專案裡附的檔案 (除圖片之外,如 txt 檔或影音檔)
讀取儲存動態產生的檔案(document底下位置)
非特權物件的寫檔
keyword:
encodeObject, decodeObjectForKey 是物件裡面的encode實作
[NSKeyedArchiver archiveRootObject: toFile:];
[NSKeyedUnArchiver unarchiveObjectWithFile:];
非特權物件的寫檔 (使用arhiver)
用NSMutableData *data來當作archiver,然後用writeToFile寫檔
特權物件可以直接用WriteToFile寫檔(只有NSString, NSData, NSDictionary, NSArray可以),而非特權物件需要先archive才可以寫檔。
.
Property List (plist)
CoreData
------------------------------------
iOS檔案位置管理:
專案附檔的都放在專案下
動態產生的都放在模擬器(實機)底下
好處:
1.專案附檔的plist有UI介面可以方便管理
2.由writeToFile:atomically寫出Property List
名詞解釋:
property list: 一種xml的資料格式
writeToFile: 寫檔動作,儲存plist到模擬器document資料夾的動作
NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES); : 模擬器/實機 的document資料夾位置
NSPropertyListSerialization: coverts Property List to/from NSData
iPhone 開發教學 - 使用 Property List 和 SQLite 處理資料儲存
(重要!教檔案位置,讀寫檔基本指令。)
Introduction to Property Lists (Apple Official)
相關指令 //codes are from 彼得潘app教學書
讀取專案裡附的檔案 (除圖片之外,如 txt 檔或影音檔)
讀取儲存動態產生的檔案(document底下位置)
非特權物件的寫檔
keyword:
encodeObject, decodeObjectForKey 是物件裡面的encode實作
[NSKeyedArchiver archiveRootObject: toFile:];
[NSKeyedUnArchiver unarchiveObjectWithFile:];
非特權物件的寫檔 (使用arhiver)
用NSMutableData *data來當作archiver,然後用writeToFile寫檔
用法:
// Writing
- (BOOL)writeToFile:(NSString *)aPath atomically:(BOOL)flag;
- (BOOL)writeToURL:(NSURL *)aURL atomically:(BOOL)flag;
// Reading
- (id)initWithContentsOfFile:(NSString *)aPath;
- (id)initWithContentsOfURL:(NSURL *)aURL;
- (BOOL)writeToFile:(NSString *)aPath atomically:(BOOL)flag;
- (BOOL)writeToURL:(NSURL *)aURL atomically:(BOOL)flag;
// Reading
- (id)initWithContentsOfFile:(NSString *)aPath;
- (id)initWithContentsOfURL:(NSURL *)aURL;
特權物件可以直接用WriteToFile寫檔(只有NSString, NSData, NSDictionary, NSArray可以),而非特權物件需要先archive才可以寫檔。
.
Differences between property list, NSUserDefaults
how to save plist to NSUserDefaults
"You can think of
However, how you choose between
.
"You can think of
NSUserDefaults
as an invisible .plist
that you can read and write to, without ever being able to actually see the file. Using NSUserDefaults
, you will be able to restore saved values even if the app has been killed in multitasking.However, how you choose between
.plist
and NSUserDefaults
should be based off of how much data you need to save. Apple recommends only saving small amounts of data to NSUserDefaults
. If you need to save a lot of information then .plist
is the way to go. Either that or of course Core-Data
.".
Wednesday, October 17, 2012
World Resourse
Mail List
Cocoa-dev
Xcode-users
Quartz-dev
Cocoa-unbound
iPhone SDK Development
Forum
iphonedevbook.com
Apple Developer Forums
Apple Discussions, Developer Forums
Apple Discussions, iPhone
Website
CocoaHeads
NSCoder Night
Stack Overflow
iDeveloper TV
Cocoa Controls
Blog
Wil Shipley
Wolf Rentzsch
iDevBlogADay
CocoaCast
ObjecticeC on Twitter
Mike Ash
Meeting
WWDC
MacTech
NSConference
360 iDev
iPhone/iPad DevCon
Cingleton
Voices That Matter
CocoaConf
.
Cocoa-dev
Xcode-users
Quartz-dev
Cocoa-unbound
iPhone SDK Development
Forum
iphonedevbook.com
Apple Developer Forums
Apple Discussions, Developer Forums
Apple Discussions, iPhone
Website
CocoaHeads
NSCoder Night
Stack Overflow
iDeveloper TV
Cocoa Controls
Blog
Wil Shipley
Wolf Rentzsch
iDevBlogADay
CocoaCast
ObjecticeC on Twitter
Mike Ash
Meeting
WWDC
MacTech
NSConference
360 iDev
iPhone/iPad DevCon
Cingleton
Voices That Matter
CocoaConf
.
Tuesday, October 16, 2012
ECSlidingViewController
# ECSlidingViewController
`ECSlidingViewController` is a view controller container for iOS that presents its child view controllers in two layers. It provides functionality for sliding the top view to reveal the views underneath it. This functionality is inspired by the Path 2.0 and Facebook iPhone apps.
ECSlidingViewController Demo from EdgeCase on Vimeo.
This project is an example app that showcases the uses for `ECSlidingViewController`.
ECSlidingViewController Demo from EdgeCase on Vimeo.
This project is an example app that showcases the uses for `ECSlidingViewController`.
Friday, October 12, 2012
Books 好書
iOS 5 Programming Pushing the Limits, 2/e : Developing Extraordinary Mobile Apps for Apple iPhone, iPad, and iPod Touch (Paperback)
amazon五顆星20人
iOS Programming: The Big Nerd Ranch Guide, 3/e (Paperback)
amazon五顆星39人
Pro iOS Apps Performance Optimization (Professional Apress)
amazon五顆星2人
The iOS 5 Developer's Cookbook: Core Concepts and Essential Recipes for iOS Programmers (3rd Edition) (Developer's Library)
iOS SDK 開發範例大全 (The iOS 5 Developer's Cookbook: Core Concepts and Essential Recipes for
iOS Programmers, 3/e)
amazon五顆星7人
越獄女神的書
Beginning iOS 5 Development: Exploring the iOS SDK
探索iOS 5程式開發實戰
amazon五顆星8人
.
Thursday, October 11, 2012
Subscribe to:
Posts (Atom)