SDWebImage not working on Device - iphone

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.

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:

Related

[GADSlot state]: unrecognized selector sent to instance

I have integrated AdMob into My Application. Now when i am pushing to the AdMob view it constantly gets crashed.
Here is the Crash log :
2014-04-03 17:56:40.134 myApp[2934:a0b] -[GADSlot state]: unrecognized selector sent to instance 0x1133f700
2014-04-03 17:56:44.047 myApp[2934:a0b] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[GADSlot state]: unrecognized selector sent to instance 0x1133f700'
*** First throw call stack:
(
0 CoreFoundation 0x050955e4 __exceptionPreprocess + 180
1 libobjc.A.dylib 0x028998b6 objc_exception_throw + 44
2 CoreFoundation 0x05132903 -[NSObject(NSObject) doesNotRecognizeSelector:] + 275
3 CoreFoundation 0x0508590b ___forwarding___ + 1019
4 CoreFoundation 0x050854ee _CF_forwarding_prep_0 + 14
5 myApp 0x0004a2ce -[GADSlot isMakingRequest] + 36
6 myApp 0x00049f2d -[GADSlot setAdType:andReloadRequest:] + 334
7 myApp 0x00048d0e -[GADBannerView setAdSize:andReload:] + 512
8 myApp 0x00049302 -[GADBannerView setAdSize:] + 62
9 myApp 0x0004957c -[GADBannerView initWithFrame:] + 172
10 myApp 0x00008822 -[JustStartVC viewDidLoad] + 18242
11 UIKit 0x015129a8 -[UIViewController loadViewIfRequired] + 696
12 UIKit 0x01512c44 -[UIViewController view] + 35
13 UIKit 0x0152ca72 -[UINavigationController _startCustomTransition:] + 778
14 UIKit 0x01539757 -[UINavigationController _startDeferredTransitionIfNeeded:] + 688
15 UIKit 0x0153a349 -[UINavigationController __viewWillLayoutSubviews] + 57
16 UIKit 0x0167339d -[UILayoutContainerView layoutSubviews] + 213
17 UIKit 0x01469dd7 -[UIView(CALayerDelegate) layoutSublayersOfLayer:] + 355
18 libobjc.A.dylib 0x028ab81f -[NSObject performSelector:withObject:] + 70
19 QuartzCore 0x012d972a -[CALayer layoutSublayers] + 148
20 QuartzCore 0x012cd514 _ZN2CA5Layer16layout_if_neededEPNS_11TransactionE + 380
21 QuartzCore 0x012cd380 _ZN2CA5Layer28layout_and_display_if_neededEPNS_11TransactionE + 26
22 QuartzCore 0x01235156 _ZN2CA7Context18commit_transactionEPNS_11TransactionE + 294
23 QuartzCore 0x012364e1 _ZN2CA11Transaction6commitEv + 393
24 QuartzCore 0x01236bb4 _ZN2CA11Transaction17observer_callbackEP19__CFRunLoopObservermPv + 92
25 CoreFoundation 0x0505d53e __CFRUNLOOP_IS_CALLING_OUT_TO_AN_OBSERVER_CALLBACK_FUNCTION__ + 30
26 CoreFoundation 0x0505d48f __CFRunLoopDoObservers + 399
27 CoreFoundation 0x0503b3b4 __CFRunLoopRun + 1076
28 CoreFoundation 0x0503ab33 CFRunLoopRunSpecific + 467
29 CoreFoundation 0x0503a94b CFRunLoopRunInMode + 123
30 GraphicsServices 0x02a999d7 GSEventRunModal + 192
31 GraphicsServices 0x02a997fe GSEventRun + 104
32 UIKit 0x013ff94b UIApplicationMain + 1225
33 myApp 0x00016b2d main + 141
34 libdyld.dylib 0x056b9725 start + 0
35 ??? 0x00000001 0x0 + 1
)
libc++abi.dylib: terminating with uncaught exception of type NSException
Thanks.
Go to project settings > Build Settings And set -ObjC to Other Linker Flags.
More info: https://stackoverflow.com/a/22585112/2115477
I referred few discussions & found that there is an flag need to be added in build settings.
Here it is :
Targets -> Build Settings -> Linking -> Other Linker Flags
I set here -ObjC
So now its working.

Exception when running PhoneGap0.9.6 application on iPhone

We have an PhoneGap application that runs perfectly okay when using the simulator but once running this in the actual iPhone connected to mac we get an exception (errors below). Note the application was working perfectly fine before upgrade to PhoneGap0.9.6/
objc[356]: Class Connection is implemented in both /System/Library/PrivateFrameworks/Message.framework/Message and /var/mobile/Applications/D1D682A1-010B-4AE9-8761-4D553FCF8089/Frank151.app/Frank151. One of the two will be used. Which one is undefined.
[Switching to process 13059 thread 0x0]
2011-07-08 18:00:45.355 Frank151[356:707] -[Connection initWithWebView:]: unrecognized selector sent to instance 0x17e4e0
2011-07-08 18:00:45.378 Frank151[356:707] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[Connection initWithWebView:]: unrecognized selector sent to instance 0x17e4e0'
*** Call stack at first throw:
(
0 CoreFoundation 0x3166564f __exceptionPreprocess + 114
1 libobjc.A.dylib 0x35180c5d objc_exception_throw + 24
2 CoreFoundation 0x316691bf -[NSObject(NSObject) doesNotRecognizeSelector:] + 102
3 CoreFoundation 0x31668649 ___forwarding___ + 508
4 CoreFoundation 0x315df180 _CF_forwarding_prep_0 + 48
5 Frank151 0x00017469 -[PhoneGapDelegate getCommandInstance:] + 164
6 Frank151 0x00002f7f -[AppDelegate getCommandInstance:] + 62
7 Frank151 0x00016807 -[PhoneGapDelegate deviceProperties] + 234
8 Frank151 0x00016475 -[PhoneGapDelegate webViewDidFinishLoad:] + 28
9 Frank151 0x00003071 -[AppDelegate webViewDidFinishLoad:] + 212
10 UIKit 0x318a9061 -[UIWebView webView:didFinishLoadForFrame:] + 244
11 UIKit 0x318a8427 -[UIWebViewWebViewDelegate webView:didFinishLoadForFrame:] + 22
12 CoreFoundation 0x316687a4 __invoking___ + 68
13 CoreFoundation 0x315e043d -[NSInvocation invoke] + 108
14 CoreFoundation 0x315e00d9 -[NSInvocation invokeWithTarget:] + 36
15 WebKit 0x345887bd -[_WebSafeForwarder forwardInvocation:] + 408
16 CoreFoundation 0x3166868d ___forwarding___ + 576
17 CoreFoundation 0x315df180 _CF_forwarding_prep_0 + 48
18 CoreFoundation 0x316687a4 __invoking___ + 68
19 CoreFoundation 0x315e043d -[NSInvocation invoke] + 108
20 WebCore 0x36c39c3d _ZL11SendMessageP12NSInvocation + 16
21 WebCore 0x36cdcadf _ZL20HandleDelegateSourcePv + 66
22 CoreFoundation 0x3163ca79 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 12
23 CoreFoundation 0x3163e75f __CFRunLoopDoSources0 + 382
24 CoreFoundation 0x3163f4eb __CFRunLoopRun + 230
25 CoreFoundation 0x315cfec3 CFRunLoopRunSpecific + 230
26 CoreFoundation 0x315cfdcb CFRunLoopRunInMode + 58
27 GraphicsServices 0x30f4e41f GSEventRunModal + 114
28 GraphicsServices 0x30f4e4cb GSEventRun + 62
29 UIKit 0x316f5d69 -[UIApplication _run] + 404
30 UIKit 0x316f3807 UIApplicationMain + 670
31 Frank151 0x00002caf main + 78
32 Frank151 0x00002c5c start + 40
)
terminate called after throwing an instance of 'NSException'
[Switching to process 11779 thread 0x0]
(gdb)
UPDATE: After not much luck after trying many things we decided to downgrade the application to PG 0.9.5.1 and it worked with no issues. Not sure of the cause but something to do with PhoneGap 0.9.6 upgrade.
Start by disabling any plug ins......
webView may be referring to ChildBrowser Plugin.

iphone updating tableview after searching issue

When I search on TableView through TextDidChange which calls handleSearchTerm subroutine, it perfectly works. However, I removed TextDidChange and use SearchButtonClicked to update tableView (use same subroutine),it doesn't update TableView properly and crash when scroll(out of bound index in cellForRowAtIndex) even though datasource has been changed in subroutine. Any idea?
[78515:207] *** Terminating app due to uncaught exception 'NSRangeException', reason: '-[__NSCFArray objectAtIndex:]: index (8) beyond bounds (8)'
*** Call stack at first throw:
(
0 CoreFoundation 0x00db8be9 __exceptionPreprocess + 185
1 libobjc.A.dylib 0x00f0d5c2 objc_exception_throw + 47
2 CoreFoundation 0x00d71628 +[NSException raise:format:arguments:] + 136
3 CoreFoundation 0x00d7159a +[NSException raise:format:] + 58
4 CoreFoundation 0x00dae8c9 _NSArrayRaiseBoundException + 121
5 CoreFoundation 0x00db0027 -[__NSCFArray objectAtIndex:] + 87
6 DrinkGuide_v1.0 0x00005d6c -[AllDrinkTableViewController tableView:cellForRowAtIndexPath:] + 371
7 UIKit 0x003357fa -[UITableView(UITableViewInternal) _createPreparedCellForGlobalRow:withIndexPath:] + 634
8 UIKit 0x0032b77f -[UITableView(UITableViewInternal) _createPreparedCellForGlobalRow:] + 75
9 UIKit 0x00340450 -[UITableView(_UITableViewPrivate) _updateVisibleCellsNow:] + 1561
10 UIKit 0x00338538 -[UITableView layoutSubviews] + 242
11 QuartzCore 0x01c76451 -[CALayer layoutSublayers] + 181
12 QuartzCore 0x01c7617c CALayerLayoutIfNeeded + 220
13 QuartzCore 0x01c6f37c _ZN2CA7Context18commit_transactionEPNS_11TransactionE + 310
14 QuartzCore 0x01c6f0d0 _ZN2CA11Transaction6commitEv + 292
15 QuartzCore 0x01c9f7d5 _ZN2CA11Transaction17observer_callbackEP19__CFRunLoopObservermPv + 99
16 CoreFoundation 0x00d99fbb __CFRUNLOOP_IS_CALLING_OUT_TO_AN_OBSERVER_CALLBACK_FUNCTION__ + 27
17 CoreFoundation 0x00d2f0e7 __CFRunLoopDoObservers + 295
18 CoreFoundation 0x00cf7bd7 __CFRunLoopRun + 1575
19 CoreFoundation 0x00cf7240 CFRunLoopRunSpecific + 208
20 CoreFoundation 0x00cf7161 CFRunLoopRunInMode + 97
21 GraphicsServices 0x016ed268 GSEventRunModal + 217
22 GraphicsServices 0x016ed32d GSEventRun + 115
23 UIKit 0x002d042e UIApplicationMain + 1160
24 DrinkGuide_v1.0 0x0000298c main + 102
25 DrinkGuide_v1.0 0x0000291d start + 53
)
terminate called after throwing an instance of 'NSException'
I think crash is caused by cellForRowAtIndexPath, can you please post code for following methods :
cellForRowAtIndexPath
SearchButtonClicked
yourSubroutine you are calling
also mention your array or collection from which you are loading your table.
Thanks,
as per your crash log it seems you are retuning wrong no of cells in you noOfcellsInsection method. You are getting array out of bounds error.When you are doing search make a flag true and according to that flag return no of rows for the table view using your filtered array's count.

iphone app crash

I am getting an error while running app with following exception.
Terminating app due to uncaught exception 'NSUnknownKeyException', reason: '[<FavoriteViewController 0x158d30> setValue:forUndefinedKey:]: this class is not key value coding-compliant for the key customCell.'
*** Call stack at first throw:
(
0 CoreFoundation 0x314d0987 __exceptionPreprocess + 114
1 libobjc.A.dylib 0x319a149d objc_exception_throw + 24
2 CoreFoundation 0x314d0705 -[NSException dealloc] + 0
3 Foundation 0x31d28b4f -[NSObject(NSKeyValueCoding) setValue:forUndefinedKey:] + 182
4 Foundation 0x31d2803b _NSSetUsingKeyValueSetter + 90
5 Foundation 0x31d29da3 -[NSObject(NSKeyValueCoding) setValue:forKey:] + 194
6 Foundation 0x31cdbb17 -[NSObject(NSKeyValueCoding) setValue:forKeyPath:] + 130
7 UIKit 0x33a8860f -[UIRuntimeOutletConnection connect] + 66
8 CoreFoundation 0x31473fc7 -[NSObject(NSObject) performSelector:] + 18
9 CoreFoundation 0x3147cd51 -[NSArray makeObjectsPerformSelector:] + 388
10 UIKit 0x33a87577 -[UINib instantiateWithOwner:options:] + 586
11 UIKit 0x33a88b39 -[NSBundle(UINSBundleAdditions) loadNibNamed:owner:options:] + 92
12 Fridge 0x0001ab11 -[FavoriteViewController tableView:cellForRowAtIndexPath:] + 192
13 UIKit 0x33907a21 -[UITableView(UITableViewInternal) _createPreparedCellForGlobalRow:withIndexPath:] + 516
14 UIKit 0x339077f3 -[UITableView(UITableViewInternal) _createPreparedCellForGlobalRow:] + 34
15 UIKit 0x33905d2d -[UITableView(_UITableViewPrivate) _updateVisibleCellsNow:] + 936
16 UIKit 0x33904edd -[UITableView layoutSubviews] + 140
17 UIKit 0x338b10cf -[UIView(CALayerDelegate) layoutSublayersOfLayer:] + 26
18 CoreFoundation 0x3146ebbf -[NSObject(NSObject) performSelector:withObject:] + 22
19 QuartzCore 0x30a6c685 -[CALayer layoutSublayers] + 120
20 QuartzCore 0x30a6c43d CALayerLayoutIfNeeded + 184
21 QuartzCore 0x30a6656d _ZN2CA7Context18commit_transactionEPNS_11TransactionE + 212
22 QuartzCore 0x30a66383 _ZN2CA11Transaction6commitEv + 190
23 QuartzCore 0x30a89f9d _ZN2CA11Transaction17observer_callbackEP19__CFRunLoopObservermPv + 52
24 CoreFoundation 0x31460c59 __CFRUNLOOP_IS_CALLING_OUT_TO_AN_OBSERVER_CALLBACK_FUNCTION__ + 16
25 CoreFoundation 0x31460acd __CFRunLoopDoObservers + 412
26 CoreFoundation 0x314580cb __CFRunLoopRun + 854
27 CoreFoundation 0x31457c87 CFRunLoopRunSpecific + 230
28 CoreFoundation 0x31457b8f CFRunLoopRunInMode + 58
29 GraphicsServices 0x35d664ab GSEventRunModal + 114
30 GraphicsServices 0x35d66557 GSEventRun + 62
31 UIKit 0x338d5329 -[UIApplication _run] + 412
32 UIKit 0x338d2e93 UIApplicationMain + 670
33 Fridge 0x00002d77 main + 70
34 Fridge 0x00002d2c start + 40
)
The error message: Terminating app due to uncaught exception 'NSUnknownKeyException', reason: '[ setValue:forUndefinedKey:]: this class is not key value coding-compliant for the key customCell.'
... means that your xib is referencing an IBOutlet named "customCell" but your view controller doesn't have that IBOutlet anymore. You either need to remove the customCell reference from your xib or add an IBOutlet property to your view controller named "customCell".

Unrecognized Selector with OHGridView

I downloaded the OHGridView hoping that it was the answer to all my problems.
https://github.com/AliSoftware/OHGridView
I did all that it said to do (add the class files, add the code, and change a few other things).
I went to build it and it crashed. I realized the lines of code why it was crashing:
((OHGridView *)self.view).rowHeight = 100;
((OHGridView *)self.view).columnsCount = 2;
Error from Console:
`-[UIView setRowHeight:]: unrecognized selector sent to instance 0x4b55110
2011-02-20 09:01:16.906 TableView[14358:207] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[UIView setRowHeight:]: unrecognized selector sent to instance 0x4b55110'
*** Call stack at first throw:
(
0 CoreFoundation 0x00e4dbe9 __exceptionPreprocess + 185
1 libobjc.A.dylib 0x00fa25c2 objc_exception_throw + 47
2 CoreFoundation 0x00e4f6fb -[NSObject(NSObject) doesNotRecognizeSelector:] + 187
3 CoreFoundation 0x00dbf366 ___forwarding___ + 966
4 CoreFoundation 0x00dbef22 _CF_forwarding_prep_0 + 50
5 TableView 0x00004232 -[DetailViewController viewDidLoad] + 831
6 UIKit 0x0037165e -[UIViewController view] + 179
7 UIKit 0x0036fa57 -[UIViewController contentScrollView] + 42
8 UIKit 0x00380201 -[UINavigationController _computeAndApplyScrollContentInsetDeltaForViewController:] + 48
9 UIKit 0x0037e831 -[UINavigationController _layoutViewController:] + 43
10 UIKit 0x0037fa86 -[UINavigationController _startTransition:fromViewController:toViewController:] + 326
11 UIKit 0x0037a606 -[UINavigationController _startDeferredTransitionIfNeeded] + 266
12 UIKit 0x0038183e -[UINavigationController pushViewController:transition:forceImmediate:] + 932
13 UIKit 0x0037a4a0 -[UINavigationController pushViewController:animated:] + 62
14 TableView 0x00002e4f -[RootViewController tableView:didSelectRowAtIndexPath:] + 681
15 UIKit 0x00339794 -[UITableView _selectRowAtIndexPath:animated:scrollPosition:notifyDelegate:] + 1140
16 UIKit 0x0032fd50 -[UITableView _userSelectRowAtPendingSelectionIndexPath:] + 219
17 Foundation 0x000427f6 __NSFireDelayedPerform + 441
18 CoreFoundation 0x00e2efe3 __CFRUNLOOP_IS_CALLING_OUT_TO_A_TIMER_CALLBACK_FUNCTION__ + 19
19 CoreFoundation 0x00e30594 __CFRunLoopDoTimer + 1220
20 CoreFoundation 0x00d8ccc9 __CFRunLoopRun + 1817
21 CoreFoundation 0x00d8c240 CFRunLoopRunSpecific + 208
22 CoreFoundation 0x00d8c161 CFRunLoopRunInMode + 97
23 GraphicsServices 0x016ef268 GSEventRunModal + 217
24 GraphicsServices 0x016ef32d GSEventRun + 115
25 UIKit 0x002d242e UIApplicationMain + 1160
26 TableView 0x00001abc main + 102
27 TableView 0x00001a4d start + 53
)
terminate called after throwing an instance of 'NSException`
I removed them and it loaded fine but I didn't see any content.
Please help,
thanks.
I did a clone of the repository just now and then did a build and run of his example project without making any changes to the code. It ran without any warnings or errors.
You'll need to check your code wherever you made changes.
update after your comment
Unrecognized Selector often means that you have a capitalization error or that your code isn't the kind of object that you think it is.
For example: I can get almost the same error that you get if I try to call the setRowHeight: directly against a OHGridView object instead of the view property of the object, like this
((OHGridView*)self).rowHeight = 100;
((OHGridView*)self).columnsCount = 2;
So, I would check your code to make sure that your object is an OHGridView and that you are setting the rowHeight property of the view of the OHGridView.