iCoder4777
iCoder4777

Reputation: 1692

SDWebImage not working on Device

Hi guys I have integrated SDWebImage for loading image from Facebook. All things works fine on simulator but when I try to run on device it give error :

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’

This crash is coming on :[cell.contactImageView setImageWithURL:[NSURL URLWithString:[[contactList objectAtIndex:indexPath.row] objectForKey:PICTURE_KEY]]placeholderImage:[UIImage imageNamed:@"placeholder.png"]];

I am not clear why this crash is happening while running APP on simulator. Any help would be appreciated. Thanx in advance.

Upvotes: 1

Views: 616

Answers (1)

Renan  Protector
Renan Protector

Reputation: 183

I had this problem when running on device too. I forgot to add "-Objc" flag at "Other Linker Flags" settings.

Add Linker Flag

Open the "Build Settings" tab, in the "Linking" section, locate the "Other Linker Flags" setting and add the "-ObjC" flag:

Upvotes: 1

Related Questions