CustomCell Crash - iphone

I am using CustomCell tableview, download data and binding it.When i tap multiple time am getting this error.
[NSCFString numberOfSectionsInTableView:]: unrecognized selector sent to instance 0x1bd170
Sat Jan 22 12:03:26 unknown Fridge[535] <Error>: *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[NSCFString numberOfSectionsInTableView:]: unrecognized selector sent to instance 0x1bd170'
*** Call stack at first throw:
(
0 CoreFoundation 0x314d0987 __exceptionPreprocess + 114
1 libobjc.A.dylib 0x319a149d objc_exception_throw + 24
2 CoreFoundation 0x314d2133 -[NSObject(NSObject) doesNotRecognizeSelector:] + 102
3 CoreFoundation 0x31479aa9 ___forwarding___ + 508
4 CoreFoundation 0x31479860 _CF_forwarding_prep_0 + 48
5 UIKit 0x339023fb -[UITableViewRowData(UITableViewRowDataPrivate) _updateNumSections] + 66
6 UIKit 0x3390235b -[UITableViewRowData invalidateAllSections] + 50
7 UIKit 0x33902111 -[UITableView(_UITableViewPrivate) _updateRowData] + 64
8 UIKit 0x33902069 -[UITableView noteNumberOfRowsChanged] + 64
9 UIKit 0x33901bff -[UITableView reloadData] + 582
10 UIKit 0x33904a0b -[UITableView _reloadDataIfNeeded] + 50
11 UIKit 0x33904e63 -[UITableView layoutSubviews] + 18
12 UIKit 0x338b10cf -[UIView(CALayerDelegate) layoutSublayersOfLayer:] + 26
13 CoreFoundation 0x3146ebbf -[NSObject(NSObject) performSelector:withObject:] + 22
14 QuartzCore 0x30a6c685 -[CALayer layoutSublayers] + 120
15 QuartzCore 0x30a6c43d CALayerLayoutIfNeeded + 184
16 QuartzCore 0x30a6656d _ZN2CA7Context18commit_transactionEPNS_11TransactionE + 212
17 QuartzCore 0x30a66383 _ZN2CA11Transaction6commitEv + 190
18 QuartzCore 0x30a89f9d _ZN2CA11Transaction17observer_callbackEP19__CFRunLoopObservermPv + 52
19 CoreFoundation 0x31460c59 __CFRUNLOOP_IS_CALLING_OUT_TO_AN_OBSERVER_CALLBACK_FUNCTION__ + 16
20 CoreFoundation 0x31460acd __CFRunLoopDoObservers + 412
21 CoreFoundation 0x314580cb __CFRunLoopRun + 854
22 CoreFoundation 0x31457c87 CFRunLoopRunSpecific + 230
23 CoreFoundation 0x31457b8f CFRunLoopRunInMode + 58
24 GraphicsServices 0x35d664ab GSEventRunModal + 114
25 GraphicsServices 0x35d66557 GSEventRun + 62
26 UIKit 0x338d5329 -[UIApplication _run] + 412
27 UIKit 0x338d2e93 UIApplicationMain + 670
28 Fridge 0x00002a7f main + 70
29 Fridge 0x00002a34 start + 40
)
Sat Jan 22 12:03:26 unknown UIKitApplication:com.sdi.Fridge[0xa6da][535] <Notice>: terminate called after throwing an instance of 'NSException'
**Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[CALayer numberOfSectionsInTableView:]: unrecognized selector sent to instance 0x184250'**
Thanks

Thanks for the detail view of your problem but the only important part is this
-[NSCFString numberOfSectionsInTableView:]: unrecognized selector
It tells that you are calling the method numberOfSectionsInTableView: on a NSCFString
which is seem to be wrong
so check where is that method called in your code
And also the rest is not require in your case.
Edit:
did you release your custom cell in the delegate method tableview. if yes than use autorelease instead.

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.

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.
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:

UITable cellForRowAtIndexPath

New in iOS, here is Question:
I am using xcode 4.0.2 iso-4.3.2.
Here I have a table and I am creating one mutable array like
mainarray=[[NSMutableArray alloc]initWithObjects:#"Hi",#"Hello"nil];
and sending that value to.Table delegate method like
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
here value is coming but once I am sending dynamically value to the mainarray like
mainarray=[[NSMutableArray alloc]initWithObjects:[dataarray valueForKey:#"first_name"],nil]; or
[mainarray addobject:[dataarray valueForKey:#"first_name"]]
and sending that mainarray value to cell.textlabel.text then my program is terminating and sending this error message.
2011-05-11 10:29:10.346 picture:vide[742:207] -[__NSArrayI isEqualToString:]: unrecognized selector sent to instance 0x4e85200
2011-05-11 10:29:10.348 picture:vide[742:207] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[__NSArrayI isEqualToString:]: unrecognized selector sent to instance 0x4e85200'
*** Call stack at first throw:
(
0 CoreFoundation 0x00ddb5a9 __exceptionPreprocess + 185
1 libobjc.A.dylib 0x00f2f313 objc_exception_throw + 44
2 CoreFoundation 0x00ddd0bb -[NSObject(NSObject) doesNotRecognizeSelector:] + 187
3 CoreFoundation 0x00d4c966 ___forwarding___ + 966
4 CoreFoundation 0x00d4c522 _CF_forwarding_prep_0 + 50
5 UIKit 0x003ecafc -[UILabel setText:] + 72
6 picture:vide 0x000050c9 -[VideoChatController1 tableView:cellForRowAtIndexPath:] + 376
7 UIKit 0x00340b98 -[UITableView(UITableViewInternal) _createPreparedCellForGlobalRow:withIndexPath:] + 634
8 UIKit 0x003364cc -[UITableView(UITableViewInternal) _createPreparedCellForGlobalRow:] + 75
9 UIKit 0x0034b8cc -[UITableView(_UITableViewPrivate) _updateVisibleCellsNow:] + 1561
10 UIKit 0x0034390c -[UITableView layoutSubviews] + 242
11 QuartzCore 0x01d7ba5a -[CALayer layoutSublayers] + 181
12 QuartzCore 0x01d7dddc CALayerLayoutIfNeeded + 220
13 QuartzCore 0x01d230b4 _ZN2CA7Context18commit_transactionEPNS_11TransactionE + 310
14 QuartzCore 0x01d24294 _ZN2CA11Transaction6commitEv + 292
15 QuartzCore 0x01d2446d _ZN2CA11Transaction17observer_callbackEP19__CFRunLoopObservermPv + 99
16 CoreFoundation 0x00dbc89b __CFRUNLOOP_IS_CALLING_OUT_TO_AN_OBSERVER_CALLBACK_FUNCTION__ + 27
17 CoreFoundation 0x00d516e7 __CFRunLoopDoObservers + 295
18 CoreFoundation 0x00d1a1d7 __CFRunLoopRun + 1575
19 CoreFoundation 0x00d19840 CFRunLoopRunSpecific + 208
20 CoreFoundation 0x00d19761 CFRunLoopRunInMode + 97
21 GraphicsServices 0x017321c4 GSEventRunModal + 217
22 GraphicsServices 0x01732289 GSEventRun + 115
23 UIKit 0x002d9c93 UIApplicationMain + 1160
24 picture:vide 0x00002910 main + 102
25 picture:vide 0x000028a1 start + 53
)
Please, help.
Here you are getting this terminating log because
dataArray is an NSArray you can't call [dataarray valueForKey:#"first_name"] this
because this unreconised for NSArray
rether than this you may use some thing like this
[[dataarray objectAtIndex:index] valueForKey:#"first_name"]
[__NSArrayI isEqualToString:]: is the issue. You are using the isEqualToString: for an array somewhere. Check that. Its a method of NSString
Initialization of array was wrong.
Following line
mainarray=[[NSMutableArray alloc]initWithObjects:#"Hi",#"Hello"nil];
should be corrected as
mainarray=[[NSMutableArray alloc]initWithObjects:#"Hi",#"Hello" , nil];
Please note the new comma between #"Hello" and nil

Error in dismissing a modal view controller

I have encountered application termination while dismissing a modal view controller.
-[NSCFString window]: unrecognized selector sent to instance 0x6337dc0
2011-06-03 13:26:37.980 Tuscany[19657:207] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[NSCFString window]: unrecognized selector sent to instance 0x6337dc0'
*** Call stack at first throw:
(
0 CoreFoundation 0x016ffbe9 __exceptionPreprocess + 185
1 libobjc.A.dylib 0x018545c2 objc_exception_throw + 47
2 CoreFoundation 0x017016fb -[NSObject(NSObject) doesNotRecognizeSelector:] + 187
3 CoreFoundation 0x01671366 ___forwarding___ + 966
4 CoreFoundation 0x01670f22 _CF_forwarding_prep_0 + 50
5 UIKit 0x003f4024 -[UIViewController viewControllerForRotation] + 81
6 UIKit 0x003ee8ab -[UIViewController shouldWindowUseOnePartInterfaceRotationAnimation:] + 34
7 UIKit 0x00368dd5 -[UIWindow _clientsForRotation] + 350
8 UIKit 0x0036b87b -[UIWindow _setRotatableClient:toOrientation:updateStatusBar:duration:force:] + 141
9 UIKit 0x005eb948 -[UIWindowController transition:fromViewController:toViewController:target:didEndSelector:] + 1053
10 UIKit 0x003f7682 -[UIViewController _dismissModalViewControllerWithTransition:from:] + 2075
11 UIKit 0x003f4324 -[UIViewController dismissModalViewControllerWithTransition:] + 579
12 Foundation 0x000c37f6 __NSFireDelayedPerform + 441
13 CoreFoundation 0x016e0fe3 __CFRUNLOOP_IS_CALLING_OUT_TO_A_TIMER_CALLBACK_FUNCTION__ + 19
14 CoreFoundation 0x016e2594 __CFRunLoopDoTimer + 1220
15 CoreFoundation 0x0163ecc9 __CFRunLoopRun + 1817
16 CoreFoundation 0x0163e240 CFRunLoopRunSpecific + 208
17 CoreFoundation 0x0163e161 CFRunLoopRunInMode + 97
18 GraphicsServices 0x01d88268 GSEventRunModal + 217
19 GraphicsServices 0x01d8832d GSEventRun + 115
20 UIKit 0x0035342e UIApplicationMain + 1160
21 Tuscany 0x00002878 main + 102
22 Tuscany 0x00002809 start + 53
)
terminate called after throwing an instance of 'NSException'
Above is the crash log. Please help.
Thanks in advance.
From you log it seems that you are calling window on an NSCFString. NSCFString does not have a window selector, and the compiler would complain if you try and do so, so it is likely that you are sending that message to a deallocated object (imagine that a new object has been allocated where another one was previously), or you are messing with casts.
In case you suspect that you are sending the message to a deallocated object, enable NSZombies.
Without seeing the code, it is not possible to help you further, though.

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.