2012-08-17 71 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」標誌: