错误: [NSNull length]: unrecognized selector sent to instance 0x110504af0'
查看数据发现,读取registerDate时,registerDate 是null,如果直接读取就报上面的错误:
{"userId":"1","nickName":"test","description":"my test desc","registerDate":null,"userHead":"res/default.jpg","sex":0,"age":null,"qq":"2345","state":1,"province":"shang xi","city":"xi an","longitude":null,"latitude":null}}
解决办法:
NSString *registerDateStr = [[userDic objectForKey:@"registerDate"] class] == [NSNull class]?@"暂无资料":[userDic objectForKey:@"registerDate"];
[regDate setText:registerDateStr];