block直接使用私有變量_property
在代碼塊中直接訪問私有變量相當(dāng)于self->_property。雖然沒有寫self,但暗含了對self的retain,造成了循環(huán)應(yīng)用。
解決方案:使用weakSelf/StrongSelf.
UITableViewController如何使用靜態(tài)Cell
需要在SB中勾選才能使用靜態(tài)Cell
通過pods引入的庫報錯

error_AFNetworking.png
解決方案:設(shè)置 Project->Info->Configurations,在Configurations里面吧Debug 和Release的Tests 的None改為pods

Paste_Image.png
weakself的寫法
** __weak __typeof(&self)weakSelf = self;*
** __weak __typeof(self) weakSelf = self;**
** __weak XxxViewController weakSelf = self;*
** __weak id weakSelf = self;**
這四種寫法都是正確的。
通過反向映射會產(chǎn)生警告
//通過反向映射到APP方法中
messageName = [messageName stringByAppendingString:@":"];
SEL selector = NSSelectorFromString(messageName);
if ([self respondsToSelector:selector]) {
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Warc-performSelector-leaks"
[self performSelector:selector withObject:message.body];
#pragma clang diagnostic pop
}
真機(jī)編譯時報The file “WeLease.app” couldn’t be opened because you don’t have permission to view it.這個錯.

WX20170831-144900@2x.png
解決方案: 將工程中Products文件夾下面對應(yīng)的.app文件刪除即可.
時間格式轉(zhuǎn)化問題
NSString *timeString = [[NSDate date] stringWithFormat:@"yyyy.MM.dd HH:mm:ss"];
這里采用yyyy.MM.dd HH:mm:ss 才是標(biāo)準(zhǔn)的,大寫的M代表月份,mm代表的為分,如果寫錯會造成時間錯誤