独狼

导航

[__NSCFString absoluteURL]错误的解决方案

 Xcode提醒错误:
 -[__NSCFString absoluteURL]: unrecognized selector sent to instance 0x8c4d3a0
 *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[__NSCFString absoluteURL]: unrecognized selector sent to instance 0x8c4d3a0'
 错误原因:
    applicationModal.iconURL = [appDictData objectForKey:@"iconUrl"];
 appDictData:是字典 iconURL:是 NSURL 类型
 改正后代码:
    applicationModal.iconURL = [NSURL URLWithString:[NSString stringWithFormat:@"%@",[appDictData objectForKey:@"iconUrl"]]];

 

其他类似错误未见到,见到再添补

posted on 2014-09-21 16:06  独狼  阅读(919)  评论(0编辑  收藏  举报