EXC_BAD_ACCESS (SIGSEGV) and KERN_INVALID_ADDRESS at 0xa0000008 - iphone

I have a problem that occurs from time to time and I can't find
the solution, can someone help me? Thanks
Here is the log of the crash and where the method is called
0 libobjc.A.dylib 0x00003fb0 objc_msgSend + 16
1 Authentic 0x00048ce2 -[JobsSubtitleView touchUp:] (JobsSubtitleView.m:172)
2 CoreFoundation 0x00026486 -[NSObject performSelector:withObject:withObject:] + 46
3 UIKit 0x00032bf8 -[UIApplication sendAction:to:from:forEvent:] + 56
4 UIKit 0x00032bb4 -[UIApplication sendAction:toTarget:fromSender:forEvent:] + 24
5 UIKit 0x00032b92 -[UIControl sendAction:to:forEvent:] + 38
6 UIKit 0x00032902 -[UIControl(Internal) _sendActionsForEvents:withEvent:] + 486
7 UIKit 0x0003307a -[UIControl touchesEnded:withEvent:] + 470
8 UIKit 0x00031914 -[UIWindow _sendTouchesForEvent:] + 312
9 UIKit 0x0003133a -[UIWindow sendEvent:] + 374
10 UIKit 0x000076e6 -[UIApplication sendEvent:] + 350
11 UIKit 0x000070d2 _UIApplicationHandleEvent + 5802
12 GraphicsServices 0x00004f44 PurpleEventCallback + 876
13 CoreFoundation 0x00083a28 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE1_PERFORM_FUNCTION__ + 32
14 CoreFoundation 0x000839ca __CFRunLoopDoSource1 + 134
15 CoreFoundation 0x000825f0 __CFRunLoopRun + 1364
16 CoreFoundation 0x00023f72 CFRunLoopRunSpecific + 294
17 CoreFoundation 0x00023e3a CFRunLoopRunInMode + 98
18 GraphicsServices 0x0000411e GSEventRunModal + 150
19 UIKit 0x00002472 UIApplicationMain + 1074
20 Authentic 0x0006bbd0 main (main.m:17)
21 Authentic 0x00002e8c start + 32
- (void) touchUp:(id)sender {
if(![[UIApplication sharedApplication] isNetworkActivityIndicatorVisible]) {
UIButton *jobsSubtitleButton = (UIButton*)sender;
[jobsSubtitleButton setSelected:!jobsSubtitleButton.selected];
[jobsViewController setClickType:YES]; /*** LINE 172 ***/
if(![jobsViewController isSearching]) {
[jobsViewController setIsSearching:YES];
if([jobsViewController clickType]) {
[self performSelector:#selector(reloadJobs) withObject:nil afterDelay:1.0f];
} else {
[self performSelector:#selector(reloadJobs) withObject:nil];
}
}
}
}

You have not provided enough code to make the root cause of the problem clear. The crash happens because the jobsViewController ivar in your object points to an object that has already been deallocated. But why was it deallocated at this point? There is no way to know based on this code. The most likely cause is that you forgot to retain it or the property was not declared as "retain". But, there could be a number of programming mistakes that were the root cause. You will need to do a code review looking specifically for problems related to not retaining the object pointed to by jobsViewController.

Related

Rare not reproducible crash related to UIKit

I have a random-looking crash related to UIKit and I can't seem to figure out what is wrong.
Does anyone see a familiar pattern here or do you think this might be a random OS-related crash? Is there a way to find out which Buttons or UI-elements were involved here?
Thread 0 Crashed:
0 libobjc.A.dylib 0x35260f78 objc_msgSend + 15
1 UIKit 0x312363d7 -[UIView(Hierarchy) superview] + 50
2 UIKit 0x31239abb -[UIView nextResponder] + 82
3 UIKit 0x31354011 forwardTouchMethod + 36
4 UIKit 0x3124f97d -[UIWindow _sendTouchesForEvent:] + 400
5 UIKit 0x3124f319 -[UIWindow sendEvent:] + 380
6 UIKit 0x31235695 -[UIApplication sendEvent:] + 356
7 UIKit 0x313e762f __42-[UIApplication _cancelTouches:withEvent:]_block_invoke_0 + 54
8 UIKit 0x312a5d0d -[UIApplication _cancelTouches:withEvent:includingGestures:notificationBlock:] + 544
9 UIKit 0x312a5ae9 -[UIApplication _cancelTouches:withEvent:] + 84
10 UIKit 0x31234eb1 _UIApplicationHandleEvent + 5688
11 GraphicsServices 0x33c7722b PurpleEventCallback + 882
12 CoreFoundation 0x37535523 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE1_PERFORM_FUNCTION__ + 38
13 CoreFoundation 0x375354c5 __CFRunLoopDoSource1 + 140
14 CoreFoundation 0x37534313 __CFRunLoopRun + 1370
15 CoreFoundation 0x374b74a5 CFRunLoopRunSpecific + 300
16 CoreFoundation 0x374b736d CFRunLoopRunInMode + 104
17 GraphicsServices 0x33c76439 GSEventRunModal + 136
18 UIKit 0x31263cd5 UIApplicationMain + 1080

NSUnknownKeyException Causing Crash on Button Click [duplicate]

This question already has answers here:
Xcode - How to fix 'NSUnknownKeyException', reason: … this class is not key value coding-compliant for the key X" error?
(79 answers)
Closed 7 years ago.
So I'm not sure what is going on. I haven't really changed much. Nothing having to do with this class anyways. It was working fine just a bit before and now I'm getting this crash.
-(IBAction)mphButton:(id)sender{
if(self.mphVC == nil){
MphViewController *mph = [[MphViewController alloc] initWithNibName:#"MphView" bundle:[NSBundle mainBundle]];
self.mphVC = mph;
[mph release];
}
[self.navigationController pushViewController:self.mphVC animated:YES];
}
The thread is stopping saying "Thread 1: Program received signal "SIGABRT" on the [self.navigationController pushViewController:self.mphVC animated:YES];
This is what the message:
2011-09-29 10:59:03.557 SpeedClock[2973:b303] *** Terminating app due to uncaught exception 'NSUnknownKeyException', reason: '[<MphViewController 0x4b42ad0> setValue:forUndefinedKey:]: this class is not key value coding-compliant for the key count.'
*** Call stack at first throw:
(
0 CoreFoundation 0x00dc25a9 __exceptionPreprocess + 185
1 libobjc.A.dylib 0x00f16313 objc_exception_throw + 44
2 CoreFoundation 0x00dc24e1 -[NSException raise] + 17
3 Foundation 0x00794677 _NSSetUsingKeyValueSetter + 135
4 Foundation 0x007945e5 -[NSObject(NSKeyValueCoding) setValue:forKey:] + 285
5 UIKit 0x0021030c -[UIRuntimeOutletConnection connect] + 112
6 CoreFoundation 0x00d388cf -[NSArray makeObjectsPerformSelector:] + 239
7 UIKit 0x0020ed23 -[UINib instantiateWithOwner:options:] + 1041
8 UIKit 0x00210ab7 -[NSBundle(UINSBundleAdditions) loadNibNamed:owner:options:] + 168
9 UIKit 0x000c6628 -[UIViewController _loadViewFromNibNamed:bundle:] + 70
10 UIKit 0x000c4134 -[UIViewController loadView] + 120
11 UIKit 0x000c400e -[UIViewController view] + 56
12 UIKit 0x000c2482 -[UIViewController contentScrollView] + 42
13 UIKit 0x000d2f25 -[UINavigationController _computeAndApplyScrollContentInsetDeltaForViewController:] + 48
14 UIKit 0x000d1555 -[UINavigationController _layoutViewController:] + 43
15 UIKit 0x000d2870 -[UINavigationController _startTransition:fromViewController:toViewController:] + 524
16 UIKit 0x000cd32a -[UINavigationController _startDeferredTransitionIfNeeded] + 266
17 UIKit 0x000d4562 -[UINavigationController pushViewController:transition:forceImmediate:] + 932
18 UIKit 0x000cd1c4 -[UINavigationController pushViewController:animated:] + 62
19 SpeedClock 0x00002621 -[RootViewController mphButton:] + 353
20 UIKit 0x000144fd -[UIApplication sendAction:to:from:forEvent:] + 119
21 UIKit 0x000a4799 -[UIControl sendAction:to:forEvent:] + 67
22 UIKit 0x000a6c2b -[UIControl(Internal) _sendActionsForEvents:withEvent:] + 527
23 UIKit 0x000a57d8 -[UIControl touchesEnded:withEvent:] + 458
24 UIKit 0x00038ded -[UIWindow _sendTouchesForEvent:] + 567
25 UIKit 0x00019c37 -[UIApplication sendEvent:] + 447
26 UIKit 0x0001ef2e _UIApplicationHandleEvent + 7576
27 GraphicsServices 0x00ffb992 PurpleEventCallback + 1550
28 CoreFoundation 0x00da3944 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE1_PERFORM_FUNCTION__ + 52
29 CoreFoundation 0x00d03cf7 __CFRunLoopDoSource1 + 215
30 CoreFoundation 0x00d00f83 __CFRunLoopRun + 979
31 CoreFoundation 0x00d00840 CFRunLoopRunSpecific + 208
32 CoreFoundation 0x00d00761 CFRunLoopRunInMode + 97
33 GraphicsServices 0x00ffa1c4 GSEventRunModal + 217
34 GraphicsServices 0x00ffa289 GSEventRun + 115
35 UIKit 0x00022c93 UIApplicationMain + 1160
36 SpeedClock 0x00001f59 main + 121
37 SpeedClock 0x00001ed5 start + 53
38 ??? 0x00000001 0x0 + 1
)
terminate called throwing an exceptionCurrent language: auto; currently objective-c
(gdb)
I can read these pretty well on Logcat on android. Just not use to reading this one. I saw another post saying that their class might not have been connected to their view. Mine is. It was working just fine prior to me putting in some stuff (which I recommented out and it still isnt working) on the MPHViewController.m
Any and all help is appreciated... Thanks :)
You most likely have something in your "MphView" XIB file called "count" that you no longer have in MphViewController. Maybe a delegate set for an object that's no longer there, or an action, or something like that. Check all your connections in Interface Builder and remove any broken ones.

Error when testing application on iPhone, but no error in simulator

I get the below error when I test my application on my iPhone, yet the error doesnt occur in the Simulator. Its when I load up my rootViewController which is a UITableView. I am relatively new to iOS programming, and I was just wondering if anybody could shed any light on it!
Regards,
Michael.
Use this code to go to my RootView.
- (IBAction)goToRootView {
RootViewController *rootViewController = [[RootViewController alloc] initWithStyle:UITableViewStyleGrouped];
[self.navigationController pushViewController:rootViewController animated:YES];
[rootViewController release];
}
2011-09-12 14:39:55.951 LeagueProject[773:707] *** Terminating app due to uncaught exception 'NSRangeException', reason: '*** -[NSMutableArray objectAtIndex:]: index 0 beyond bounds for empty array'
*** Call stack at first throw:
(
0 CoreFoundation 0x3684b64f __exceptionPreprocess + 114
1 libobjc.A.dylib 0x33aa4c5d objc_exception_throw + 24
2 CoreFoundation 0x367b6069 -[__NSArrayM objectAtIndex:] + 184
3 LeagueProject 0x0000302f -[RootViewController tableView:numberOfRowsInSection:] + 58
4 UIKit 0x356827c7 -[UISectionRowData refreshWithSection:tableView:tableViewRowData:] + 1338
5 UIKit 0x356836bb -[UITableViewRowData rectForFooterInSection:] + 66
6 UIKit 0x356835f5 -[UITableViewRowData heightForTable] + 40
7 UIKit 0x35683453 -[UITableView(_UITableViewPrivate) _updateContentSize] + 206
8 UIKit 0x3567ebc9 -[UITableView _rectChangedWithNewSize:oldSize:] + 384
9 UIKit 0x3567d833 -[UITableView setFrame:] + 158
10 UIKit 0x35684e0f -[UIView(Geometry) resizeWithOldSuperviewSize:] + 274
11 UIKit 0x356510bd -[UIView(Geometry) resizeSubviewsWithOldSize:] + 120
12 UIKit 0x356364e9 -[UIView(Geometry) setFrame:] + 336
13 UIKit 0x35688193 -[UIViewControllerWrapperView setFrame:] + 62
14 UIKit 0x35676079 -[UINavigationController _startTransition:fromViewController:toViewController:] + 960
15 UIKit 0x35675c43 -[UINavigationController _startDeferredTransitionIfNeeded] + 182
16 UIKit 0x35667d5d -[UINavigationController pushViewController:transition:forceImmediate:] + 640
17 UIKit 0x35667ad3 -[UINavigationController pushViewController:animated:] + 34
18 LeagueProject 0x0000917d -[splashView goToRootView] + 116
19 CoreFoundation 0x367bb571 -[NSObject(NSObject) performSelector:withObject:withObject:] + 24
20 UIKit 0x3564dec9 -[UIApplication sendAction:to:from:forEvent:] + 84
21 UIKit 0x3564de69 -[UIApplication sendAction:toTarget:fromSender:forEvent:] + 32
22 UIKit 0x3564de3b -[UIControl sendAction:to:forEvent:] + 38
23 UIKit 0x3564db8d -[UIControl(Internal) _sendActionsForEvents:withEvent:] + 356
24 UIKit 0x3564e423 -[UIControl touchesEnded:withEvent:] + 342
25 UIKit 0x3564cbf5 -[UIWindow _sendTouchesForEvent:] + 368
26 UIKit 0x3564c56f -[UIWindow sendEvent:] + 262
27 UIKit 0x35635313 -[UIApplication sendEvent:] + 298
28 UIKit 0x35634c53 _UIApplicationHandleEvent + 5090
29 GraphicsServices 0x35f6fe77 PurpleEventCallback + 666
30 CoreFoundation 0x36822a97 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE1_PERFORM_FUNCTION__ + 26
31 CoreFoundation 0x3682483f __CFRunLoopDoSource1 + 166
32 CoreFoundation 0x3682560d __CFRunLoopRun + 520
33 CoreFoundation 0x367b5ec3 CFRunLoopRunSpecific + 230
34 CoreFoundation 0x367b5dcb CFRunLoopRunInMode + 58
35 GraphicsServices 0x35f6f41f GSEventRunModal + 114
36 GraphicsServices 0x35f6f4cb GSEventRun + 62
37 UIKit 0x3565fd69 -[UIApplication _run] + 404
38 UIKit 0x3565d807 UIApplicationMain + 670
39 LeagueProject 0x000025a7 main + 82
40 LeagueProject 0x00002550 start + 40
)
terminate called after throwing an instance of 'NSException'
Your error is an index 0 beyond bounds for empty array error. Put breakpoints on the lines where you access arrays. When you find out which array is causing the problem, either the solution will be trivial, or you can add a bit more to your question and ask for further help.
It looks like the problem is in your implementation of [RootViewController tableView:numberOfRowsInSection:]. You are trying to access a member of a NSMutableArray that is empty - hence the error 'index 0 beyond bounds for empty array'.

Application Crashes on [self dismissModalViewControllerAnimated:NO];

in my Application I have a UiViecontroller.
when I close this UiViecontroller I do dismissModalViewControllerAnimated in my back action :
[self dismissModalViewControllerAnimated:NO];
the view is removed but the application crash with following log.
Thread 0 Crashed:
0 libobjc.A.dylib 0x34a80464 objc_msgSend + 16
1 UIKit 0x341aab5c _UIView + 52
2 UIKit 0x341aaaa8 -[UIView(Hierarchy) _makeSubtreePerformSelector:withObject:withObject:copySublayers:] + 152
3 UIKit 0x341aaace -[UIView(Hierarchy) _makeSubtreePerformSelector:withObject:withObject:copySublayers:] + 190
4 UIKit 0x341aaace -[UIView(Hierarchy) _makeSubtreePerformSelector:withObject:withObject:copySublayers:] + 190
5 UIKit 0x341aaace -[UIView(Hierarchy) _makeSubtreePerformSelector:withObject:withObject:copySublayers:] + 190
6 UIKit 0x341aa9fe -[UIView(Hierarchy) _makeSubtreePerformSelector:withObject:] + 22
7 UIKit 0x341aa6b8 -[UIView(Internal) _addSubview:positioned:relativeTo:] + 304
8 UIKit 0x341c1724 -[UIView(Hierarchy) insertSubview:atIndex:] + 32
9 UIKit 0x34276c80 -[UIWindowController _transplantView:toSuperview:atIndex:] + 76
10 UIKit 0x34274e0e -[UIWindowController transition:fromViewController:toViewController:target:didEndSelector:] + 2522
11 UIKit 0x342e4368 -[UIViewController _dismissModalViewControllerWithTransition:from:] + 1472
12 UIKit 0x342e3868 -[UIViewController dismissModalViewControllerWithTransition:] + 376
13 UIKit 0x342e372e -[UIViewController dismissModalViewControllerWithTransition:] + 62
14 UIKit 0x342e1662 -[UIViewController dismissModalViewControllerAnimated:] + 86
15 KabushikiShimbun 0x0005fd30 -[PDFPageScrollViewController backAction:] (PDFPageScrollViewController.m:1633)
16 CoreFoundation 0x35821fe6 -[NSObject(NSObject) performSelector:withObject:withObject:] + 18
17 UIKit 0x341c84a6 -[UIApplication sendAction:to:from:forEvent:] + 78
18 UIKit 0x342637ae -[UIBarButtonItem(UIInternal) _sendAction:withEvent:] + 86
19 CoreFoundation 0x35821fe6 -[NSObject(NSObject) performSelector:withObject:withObject:] + 18
20 UIKit 0x341c84a6 -[UIApplication sendAction:to:from:forEvent:] + 78
21 UIKit 0x341c8446 -[UIApplication sendAction:toTarget:fromSender:forEvent:] + 26
22 UIKit 0x341c8418 -[UIControl sendAction:to:forEvent:] + 32
23 UIKit 0x341c816a -[UIControl(Internal) <br>_sendActionsForEvents:withEvent:] + 350
24 UIKit 0x341c89c8 -[UIControl touchesEnded:withEvent:] + 336
25 UIKit 0x341be34e -[UIWindow _sendTouchesForEvent:] + 362
26 UIKit 0x341bdcc8 -[UIWindow sendEvent:] + 256
27 UIKit 0x341a8fc0 -[UIApplication sendEvent:] + 292
28 UIKit 0x341a8900 _UIApplicationHandleEvent + 5084
29 GraphicsServices 0x320c8efc PurpleEventCallback + 660
30 CoreFoundation 0x3580f6f8 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE1_PERFORM_FUNCTION__ + 20
31 CoreFoundation 0x3580f6bc __CFRunLoopDoSource1 + 160
32 CoreFoundation 0x35801f76 __CFRunLoopRun + 514
33 CoreFoundation 0x35801c80 CFRunLoopRunSpecific + 224
34 CoreFoundation 0x35801b88 CFRunLoopRunInMode + 52
35 GraphicsServices 0x320c84a4 GSEventRunModal + 108
36 GraphicsServices 0x320c8550 GSEventRun + 56
37 UIKit 0x341dc322 -[UIApplication _run] + 406
38 UIKit 0x341d9e8c UIApplicationMain + 664
39 KabushikiShimbun 0x00002800 main (main.m:14)
40 KabushikiShimbun 0x000027b4 start + 32
didn't understand why.
Any advice?
Thank you.
is the view controller originally called as Modal?
For example, are you initially showing the view by calling something along the lines of:
[myView presentModalViewController:myViewController animated:NO];
If you're not, that would be whats causing your crash, the app trying to get rid of a controller that's not modal via the dismissModalViewController method.
A view controller's parent is responsible to dismiss its modal view controller. So you should say
[self.parentViewController dismissModalViewControllerAnimated: YES];
To learn more about presenting and dismissing view controller's, refer to my post here
Make sure your modal view controller is not released at the time when do you want it to dismiss.

iPad Console Error Message Help

Can anyone help me decipher what's causing my program to crash? I've got a 5 tab bar controller set up, when I load each tab bar, i'm loading a custom table cell with data from a plist file.
this is the error message output to console;
[Session started at 2011-04-28 12:53:05 +0100.]
2011-04-28 12:53:09.344 FiveTabView[62565:207] *** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: '-[UITableViewController loadView] loaded the "Drinks" nib but didn't get a UITableView.'
*** Call stack at first throw:
(
0 CoreFoundation 0x00db3be9 __exceptionPreprocess + 185
1 libobjc.A.dylib 0x00f085c2 objc_exception_throw + 47
2 CoreFoundation 0x00d6c628 +[NSException raise:format:arguments:] + 136
3 CoreFoundation 0x00d6c59a +[NSException raise:format:] + 58
4 UIKit 0x004c1324 -[UITableViewController loadView] + 275
5 UIKit 0x0036a5e3 -[UIViewController view] + 56
6 UIKit 0x0037d230 -[UITabBarController transitionFromViewController:toViewController:transition:shouldSetSelected:] + 120
7 UIKit 0x0037bd86 -[UITabBarController transitionFromViewController:toViewController:] + 64
8 UIKit 0x0037db7e -[UITabBarController _setSelectedViewController:] + 263
9 UIKit 0x0037d9ed -[UITabBarController _tabBarItemClicked:] + 352
10 UIKit 0x002bca6e -[UIApplication sendAction:to:from:forEvent:] + 119
11 UIKit 0x004ba1f2 -[UITabBar _sendAction:withEvent:] + 422
12 UIKit 0x002bca6e -[UIApplication sendAction:to:from:forEvent:] + 119
13 UIKit 0x0034b1b5 -[UIControl sendAction:to:forEvent:] + 67
14 UIKit 0x0034d647 -[UIControl(Internal) _sendActionsForEvents:withEvent:] + 527
15 UIKit 0x0034b16c -[UIControl sendActionsForControlEvents:] + 49
16 UIKit 0x002bca6e -[UIApplication sendAction:to:from:forEvent:] + 119
17 UIKit 0x0034b1b5 -[UIControl sendAction:to:forEvent:] + 67
18 UIKit 0x0034d647 -[UIControl(Internal) _sendActionsForEvents:withEvent:] + 527
19 UIKit 0x0034c1f4 -[UIControl touchesEnded:withEvent:] + 458
20 UIKit 0x002e10d1 -[UIWindow _sendTouchesForEvent:] + 567
21 UIKit 0x002c237a -[UIApplication sendEvent:] + 447
22 UIKit 0x002c7732 _UIApplicationHandleEvent + 7576
23 GraphicsServices 0x016e9a36 PurpleEventCallback + 1550
24 CoreFoundation 0x00d95064 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE1_PERFORM_FUNCTION__ + 52
25 CoreFoundation 0x00cf56f7 __CFRunLoopDoSource1 + 215
26 CoreFoundation 0x00cf2983 __CFRunLoopRun + 979
27 CoreFoundation 0x00cf2240 CFRunLoopRunSpecific + 208
28 CoreFoundation 0x00cf2161 CFRunLoopRunInMode + 97
29 GraphicsServices 0x016e8268 GSEventRunModal + 217
30 GraphicsServices 0x016e832d GSEventRun + 115
31 UIKit 0x002cb42e UIApplicationMain + 1160
32 FiveTabView 0x00002420 main + 102
33 FiveTabView 0x000023b1 start + 53
34 ??? 0x00000001 0x0 + 1
)
terminate called after throwing an instance of 'NSException'
Looks like you are calling setValue:forKey: on an object that has been uninitialised (and the memory pointer is pointing elsewhere) or you are actually calling it on the wrong object?