2012-08-17 72 views
1

嗨,大家好,我已经集成了SDWebImage来加载来自Facebook的图像。所有的事情工作在模拟器罚款,但是当我尝试在设备上运行它给错误:[cell.contactImageView setImageWithURL:[NSURL URLWithString:[[contactList objectAtIndex:indexPath.row] objectForKey:PICTURE_KEY]]placeholderImage:[UIImage imageNamed:@"placeholder.png"]];SDWebImage不工作设备

B'dayReminderPlus[415:307] -[UIImageView setImageWithURL:placeholderImage:]: unrecognized selector sent to instance 0x4f7d310 

2012-08-17 14:45:15.301 B'dayReminderPlus[415:307] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[UIImageView setImageWithURL:placeholderImage:]: unrecognized selector sent to instance 0x4f7d310' 

*** Call stack at first throw: 

0 CoreFoundation      0x3759dc7b __exceptionPreprocess + 114 
1 libobjc.A.dylib      0x32d9bee8 objc_exception_throw + 40 
2 CoreFoundation      0x3759f3e3 -[NSObject(NSObject) doesNotRecognizeSelector:] + 98 
3 CoreFoundation      0x37544467 ___forwarding___ + 506 
4 CoreFoundation      0x37544220 _CF_forwarding_prep_0 + 48 
5 B'dayReminderPlus     0x000213e9 -[DLFirstScreenViewController tableView:cellForRowAtIndexPath:] + 5012 
6 UIKit        0x359600a0 -[UITableView(UITableViewInternal) _createPreparedCellForGlobalRow:withIndexPath:] + 668 
7 UIKit        0x3595fdcc -[UITableView(UITableViewInternal) _createPreparedCellForGlobalRow:] + 52 
8 UIKit        0x3595db84 -[UITableView(_UITableViewPrivate) _updateVisibleCellsNow:] + 1308 
9 UIKit        0x3595c838 -[UITableView layoutSubviews] + 208 
10 UIKit        0x358ec70c -[UIView(CALayerDelegate) layoutSublayersOfLayer:] + 40 
11 CoreFoundation      0x37538f79 -[NSObject(NSObject) performSelector:withObject:] + 24 
12 QuartzCore       0x33d9a130 -[CALayer layoutSublayers] + 184 
13 QuartzCore       0x33d99db8 CALayerLayoutIfNeeded + 200 
14 QuartzCore       0x33d917c0 _ZN2CA7Context18commit_transactionEPNS_11TransactionE + 268 
15 QuartzCore       0x33d91518 _ZN2CA11Transaction6commitEv + 284 
16 QuartzCore       0x33dc3c28 _ZN2CA11Transaction17observer_callbackEP19__CFRunLoopObservermPv + 88 
17 CoreFoundation      0x3752a80f __CFRUNLOOP_IS_CALLING_OUT_TO_AN_OBSERVER_CALLBACK_FUNCTION__ + 18 
18 CoreFoundation      0x3752a63d __CFRunLoopDoObservers + 500 
19 CoreFoundation      0x3752199d __CFRunLoopRun + 940 
20 CoreFoundation      0x3752150b CFRunLoopRunSpecific + 226 
21 CoreFoundation      0x37521419 CFRunLoopRunInMode + 60 
22 GraphicsServices     0x33e76d24 GSEventRunModal + 196 
23 UIKit        0x3591d57c -[UIApplication _run] + 588 
24 UIKit        0x3591a558 UIApplicationMain + 972 
25 B'dayReminderPlus     0x00002703 main + 106 
26 B'dayReminderPlus     0x00002694 start + 40 

terminate called after throwing an instance of ‘NSException’ 

这个崩溃是在即将到来

我不清楚为什么这个崩溃在模拟器上运行APP时发生。任何帮助,将不胜感激。提前Thanx。

+0

你导入了'UIImageView + WebCache'吗?确保你做到了。 – janusbalatbat 2012-08-17 09:22:53

+0

是的。如果我没有导入'UIImageView + WebCache',它也会给我模拟器中的错误。 – iCoder4777 2012-08-17 09:25:34

+0

您是否在目标依赖项中包含了“SDWebImage”(ARC或不)? – 2012-08-17 10:11:37

回答

1

我在设备上运行时也遇到了这个问题。我忘了在“其他链接器标志”设置中添加“-Objc”标志。

添加链接器标志

打开“生成设置”选项卡,在“链接”部分中,找到 “其他链接器标记”的设置,并添加“-ObjC”标志: