2013年9月30日 星期一



“May God break my heart so completely that the whole world falls in.”




- By  Mother Teresa 

LLDB Debugger 一直會卡在Attaching Project on iPad [Solved]


在Run Simulator的時候,會一直卡在Attaching project on iPad...

之後就一直等一直等....

直到你要用強制關閉才能終止它做事.

這個問題解了,發現是因為 localhost 對應的ip錯誤. 導致無法Attaching 成功.

2013年9月24日 星期二

UITableView 實作下拉更新 用refresh control



在 YourViewController.h中加入

@property (nonatomic, strong) UIRefreshControl *refreshControl;
@property (nonatomic, strong) IBOutlet UITableView * tbView; (你要下拉更新的TableView)


2013年9月18日 星期三

[Bug] Invalid Icon Path - No icon found at the path referenced under key

當你Build都沒有問題,Archive也沒問題,

但就是最後Submit的時候有這個錯誤訊息:

Invalid Icon Path - No icon found at the path referenced under key

遇到這個問題的時候

只要檢查自己Project的 XXX-info.plist裡面的 Icon files  即可!

會有一些不存在的圖,把它Delete掉即可!







2013年9月14日 星期六

如何設定Navigation上的Title和Color











在你的ViewController.m 中
- (void)viewDidLoad{

    [self.navigationItem setTitle:@"Any Title"];

}

2013年9月12日 星期四

使用plist讀取資料完整範例教學


iOS中, plist就像一個物件的"檔案",

可以輕易的當成物件做存取和寫入,

以下是一個最基本使用plist的練習.


2013年9月4日 星期三

[詳細安裝圖文] Cocoapods 好用的第三方套件管理


官網是這麼形容的

The best way to manage library dependencies in Objective-C projects.

在Objective-c上管理Library最好的工具,

功能: 假如你在開發一個大型的專案, 裡面用了10幾套開源的第三方套件,

當這些套件更新的時候,以前的做法是Download下來,手動覆蓋掉舊的,

但假如是10幾個!太麻煩啦!! 

何況你還要check是哪些有更新了.

cocoapods,看來是首選的solution.


安裝步驟 


1.  打開 Terminal 














2013年9月3日 星期二

超簡單- 無名搬家到Tumblr


Tumblr還算是個簡潔、好看的部落格,
介於重網誌(Blogger, wordpress) 與 一行文 (FB, tweeter)之間!
加上搬家非常簡單,大家可以趁著這個機會用看看喔!


1. 登入無名的帳號後,會看到




NSDate to NSString / NSString to NSDate

1. NSDate to NSString

//先建立你要的Format
NSDateFormatter*formatter =[[NSDateFormatter alloc] init];
[formatter setDateFormat:@"yyyy-MM-dd HH:mm:ss" ];

//看你的時區是什麼
[formatter setTimeZone:[NSTimeZone timeZoneWithName:@"Asia/Taipei"]];
NSString*stringFromDate =[formatter stringFromDate:myNSDateInstance];

-----------------------------------------------------------------------------------------------------------------------------

2. NSString to NSDate

NSDateFormatter *dateFormatter = [[NSDateFormatter alloc] init];
[dateFormatter setDateFormat:@"yyyy-MM-dd HH:mm:ss"];
[dateFormatter setTimeZone:[NSTimeZone timeZoneWithName:@"Asia/Taipei"]];
NSDate *date = [dateFormatter dateFromString:@"2010-08-04 16:01:03"];