1.Unrecognized instance class:NSTaggedPointerString and selector:string
示例:
self.mTitleLabel.attributedText = [aModel.activeName getAttributeStrWithFont:kFontRatio(14) lineSpace:6];
原因:
调用NSAttributedString方法,字符串不能传nil
解决:
self.mTitleLabel.attributedText = [aModel.activeName?:@"" getAttributeStrWithFont:kFontRatio(14) lineSpace:6];
2.data parameter is nil
示例:
NSDictionary * aDict = [NSJSONSerialization JSONObjectWithData:payloadData options:NSJSONReadingAllowFragments error:nil];
原因:
JSONObjectWithData传的字符串需要非空
解决:
if (!payloadData) { return; } NSError *error=nil; NSDictionary * aDict = [NSJSONSerialization JSONObjectWithData:payloadData options:NSJSONReadingAllowFragments error:&error]; if (error) { return; }
3.