1.將app上傳到App Store的時候通常會遇到這個問題

很多人說這事蘋果爸爸服務(wù)器問題,重復(fù)嘗試幾次,總會成功的!
但是經(jīng)過嘗試發(fā)現(xiàn)如果使用Application Loader上傳成功率就非常高,所以還是推薦把ipa文件導(dǎo)出直接用Application Loader上傳。
如果Application Loader也不行,需要檢查下自己的網(wǎng)絡(luò),有時候vpn也會提高速度。
2.當tableView占不滿一屏?xí)r,去除下邊多余的單元格
self.tableView.tableHeaderView = [UIView new];
self.tableView.tableFooterView = [UIView new];
3.isKindOfClass和isMemberOfClass的區(qū)別
isKindOfClass可以判斷某個對象是否屬于某個類,或者這個類的子類。
isMemberOfClass更加精準,它只能判斷這個對象類型是否為這個類(不能判斷子類)
4.__block
當一個局部變量需要在block里改變時,需要在定義時加上__block修飾,具體請看官方文檔
http://developer.apple.com/library/ios/documentation/cocoa/Conceptual/Blocks/Articles/bxVariables.html#//apple_ref/doc/uid/TP40007502-CH6-SW6
5.-[ViewController aMethod:]: unrecognized selector sent to instance 0x7fe91e607fb0
這是一個經(jīng)典錯誤,ViewController不能響應(yīng)aMethod這個方法,錯誤原因可能viewController文件中沒有實現(xiàn)aMethod這個方法
6.UITableView (<UITableView:Ox7ff19b027000;>) failed to obtain a cell from its dataSource(<ViewController:Ox7ff19a507520>)
這個錯誤原因是tableView的代理方法-tableView:cellForRowAtIndexPath:需要返回一個UITableViewCell,而你返回了一個nil。另外這個地方返回值不是UITableViewCell類型也會導(dǎo)致崩潰
7.約束如何做UIView動畫?
1、把需要改的約束Constraint拖條線出來,成為屬性
2、在需要動畫的地方加入代碼,改變此屬性的constant屬性
3、開始做UIView動畫,動畫里邊調(diào)用layoutIfNeeded方法
@property (weak, nonatomic) IBOutlet NSLayoutConstraint *buttonTopConstraint;
self.buttonTopConstraint.constant = 100;
[UIView animateWithDuration:.5 animations:^{
[self.view layoutIfNeeded];
}];
8.從NSURL中拿到鏈接字符串
NSString *urlString = myURL.absoluteString;
9.將tableView滾動到頂部
[tableView setContentOffset:CGPointZero animated:YES];
或者
[tableView scrollRectToVisible:CGRectMake(0, 0, 1, 1) animated:YES];
10.如果用addTarget:action:forControlEvents:方法為一個button添加了很多點擊事件,在某個時刻想一次刪除怎么辦?只需要調(diào)用下邊這句代碼
[youButton removeTarget:nil action:nil forControlEvents:UIControlEventAllEvents];
11.某個字體的高度
font.lineHeight;