服務(wù)器數(shù)據(jù)比較多姥芥,返回?cái)?shù)據(jù)時(shí),難免有些字段會出錯(cuò)汇鞭。
如果是一個(gè)string
字段撇眯,如果服務(wù)器寫錯(cuò),返回long
類型虱咧。
客戶端處理時(shí)就需要小心了熊榛。下面是我的一個(gè)錯(cuò)誤吧。
@property (nonatomic, copy) NSString *shortName;
shortName.length腕巡;//此處造成崩潰玄坦。
為了安全起見,[NSString stringWithFormat:@"%@",shortName].length;
如下錯(cuò)誤代碼
@autoreleasepool {
for (UIView *view in [self subviews])
{
if (view.tag==100)
{
return;
}
}
}
info.plist文件中的Supported interface orientations
數(shù)組的順序竟然會影響launchScreen顯示方式(橫屏還是豎屏)煎楣。launchScreen默認(rèn)取第一個(gè)item的值顯示豺总,實(shí)踐出真知啊。
Documentation for isBeingPresented - This method returns YES only when called from inside the viewWillAppear: and viewDidAppear: methods.