ios core data cannot find NSManagedObjectModel for entity name 'Cartdetail' with this code - iphone

Hi i'm creating an app that needs to save data in my label content to my core data model which is named as cart.xcdatamodeld and my entity named as Cartdetail.When i press a save button in my app i'm getting following error...
- (void)viewDidLoad {
if (managedObjectContext == nil) {
managedObjectContext = [(AppDelegate *)[[UIApplication sharedApplication] delegate]managedObjectContext];
}
}
- (IBAction)SaveTest:(id)sender {
ViewController2 *second = (ViewController2 *)[NSEntityDescription insertNewObjectForEntityForName:#"Cartdetail" inManagedObjectContext:managedObjectContext];
}
*** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: '+entityForName: could not locate an NSManagedObjectModel for entity name 'Cartdetail''
*** Call stack at first throw:
(
0 CoreFoundation 0x010265a9 __exceptionPreprocess + 185
1 libobjc.A.dylib 0x01444313 objc_exception_throw + 44
2 CoreData 0x00036ebb +[NSEntityDescription entityForName:inManagedObjectContext:] + 187
3 CoreData 0x0006e9eb +[NSEntityDescription insertNewObjectForEntityForName:inManagedObjectContext:] + 59
4 tablevc 0x00009c97 -[Description alertView:clickedButtonAtIndex:] + 519
5 UIKit 0x00621c5f -[UIAlertView(Private) _buttonClicked:] + 296
6 UIKit 0x002784fd -[UIApplication sendAction:to:from:forEvent:] + 119
7 UIKit 0x00308799 -[UIControl sendAction:to:forEvent:] + 67
8 UIKit 0x0030ac2b -[UIControl(Internal) _sendActionsForEvents:withEvent:] + 527
9 UIKit 0x003097d8 -[UIControl touchesEnded:withEvent:] + 458
10 UIKit 0x0029cded -[UIWindow _sendTouchesForEvent:] + 567
11 UIKit 0x0027dc37 -[UIApplication sendEvent:] + 447
12 UIKit 0x00282f2e _UIApplicationHandleEvent + 7576
13 GraphicsServices 0x01c34992 PurpleEventCallback + 1550
14 CoreFoundation 0x01007944 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE1_PERFORM_FUNCTION__ + 52
15 CoreFoundation 0x00f67cf7 __CFRunLoopDoSource1 + 215
16 CoreFoundation 0x00f64f83 __CFRunLoopRun + 979
17 CoreFoundation 0x00f64840 CFRunLoopRunSpecific + 208
18 CoreFoundation 0x00f64761 CFRunLoopRunInMode + 97
19 GraphicsServices 0x01c331c4 GSEventRunModal + 217
20 GraphicsServices 0x01c33289 GSEventRun + 115
21 UIKit 0x00286c93 UIApplicationMain + 1160
22 tablevc 0x00001d4a main + 170
23 tablevc 0x00001c95 start + 53
)
terminate called throwing an exception
I'm new to iOS..Please help me..Thanks..

You probably haven't set up your managed object context in AppDelegate!
Take a look at the AppDelegate implementation of the iPhoneCoreDataRecipes example provided by apple:
iPhoneCoreDataRecipes example

Related

Logout Button crash

I just implemented a logout button on my HeaderView sector. But somehow I keep getting this crash from Xcode.
I feel like this is somehow related to my func logoutBtnClicked(){***}.
so here is what my logoutBtnClicked() looks like:
//clicked logout
#IBAction func logout(sender: AnyObject) {
PFUser.logOutInBackgroundWithBlock { (error: NSError?) -> Void in
if error == nil {
NSUserDefaults.standardUserDefaults().removeObjectForKey("username")
NSUserDefaults.standardUserDefaults().synchronize()
let signin = self.storyboard?.instantiateViewControllerWithIdentifier("signinViewController") as! SigninViewController
let appDelegate: AppDelegate = UIApplication.sharedApplication().delegate as! AppDelegate
appDelegate.window?.rootViewController = signin
}
}
}
2016-08-18 21:18:54.801 helloworld[2439:115160] -[helloworld.HomeViewController Logout:]: unrecognized selector sent to instance 0x78e38840
2016-08-18 21:18:54.829 helloworld[2439:115160] * Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[helloworld.HomeViewController Logout:]: unrecognized selector sent to instance 0x78e38840'
* First throw call stack:
(
0 CoreFoundation 0x018d1494 exceptionPreprocess + 180
1 libobjc.A.dylib 0x035e5e02 objc_exception_throw + 50
2 CoreFoundation 0x018db253 -[NSObject(NSObject) doesNotRecognizeSelector:] + 275
3 CoreFoundation 0x0181089d ___forwarding_ + 1037
4 CoreFoundation 0x0181046e _CF_forwarding_prep_0 + 14
5 libobjc.A.dylib 0x035fa0b5 -[NSObject performSelector:withObject:withObject:] + 84
6 UIKit 0x020c1e38 -[UIApplication sendAction:to:from:forEvent:] + 118
7 UIKit 0x025519da -[UIBarButtonItem(UIInternal) _sendAction:withEvent:] + 179
8 libobjc.A.dylib 0x035fa0b5 -[NSObject performSelector:withObject:withObject:] + 84
9 UIKit 0x020c1e38 -[UIApplication sendAction:to:from:forEvent:] + 118
10 UIKit 0x020c1db7 -[UIApplication sendAction:toTarget:fromSender:forEvent:] + 64
11 UIKit 0x02265f3b -[UIControl sendAction:to:forEvent:] + 79
12 UIKit 0x022662d4 -[UIControl _sendActionsForEvents:withEvent:] + 433
13 UIKit 0x02266483 -[UIControl _sendActionsForEvents:withEvent:] + 864
14 UIKit 0x022652c1 -[UIControl touchesEnded:withEvent:] + 714
15 UIKit 0x0214252e -[UIWindow _sendTouchesForEvent:] + 1095
16 UIKit 0x021435cc -[UIWindow sendEvent:] + 1159
17 UIKit 0x020e4be8 -[UIApplication sendEvent:] + 266
18 UIKit 0x020b9769 _UIApplicationHandleEventQueue + 7795
19 CoreFoundation 0x017e3e5f CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION + 15
20 CoreFoundation 0x017d9aeb __CFRunLoopDoSources0 + 523
21 CoreFoundation 0x017d8f08 __CFRunLoopRun + 1032
22 CoreFoundation 0x017d8846 CFRunLoopRunSpecific + 470
23 CoreFoundation 0x017d865b CFRunLoopRunInMode + 123
24 GraphicsServices 0x05f27664 GSEventRunModal + 192
25 GraphicsServices 0x05f274a1 GSEventRun + 104
26 UIKit 0x020bfeb9 UIApplicationMain + 160
27 helloworld 0x0007a4e1 main + 145
28 libdyld.dylib 0x043bba25 start + 1
)
libc++abi.dylib: terminating with uncaught exception of type NSException
(lldb)
The problem is that in the interface builder for HomeViewController, for button action you have set Logout and inside the class of HomeViewController it is declare as logout, action and property are case sensitive, so either change one of them will solve your crash.

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

Whenever i run my application, the application crashes and it shows " signal1:Program recieved signal SIGABRT"

On the console it shows....
2011-09-29 17:06:39.564 Project AddressBook[925:207] * Terminating
app due to uncaught exception 'NSInternalInconsistencyException',
reason: 'Could not load NIB in bundle: 'NSBundle
(loaded)' with name 'eve''
* Call stack at first throw: ( 0 CoreFoundation
0x00e655a9 exceptionPreprocess + 185 1 libobjc.A.dylib
0x00fb9313 objc_exception_throw + 44 2 CoreFoundation
0x00e1def8 +[NSException raise:format:arguments:] + 136 3
CoreFoundation 0x00e1de6a +[NSException
raise:format:] + 58 4 UIKit
0x005500fa -[UINib instantiateWithOwner:options:] + 2024 5 UIKit
0x00551ab7 -[NSBundle(UINSBundleAdditions)
loadNibNamed:owner:options:] + 168 6 UIKit
0x00407628 -[UIViewController _loadViewFromNibNamed:bundle:] + 70 7
UIKit 0x00405134 -[UIViewController
loadView] + 120 8 UIKit 0x0040500e
-[UIViewController view] + 56 9 UIKit
0x00406a3d -[UIViewController viewControllerForRotation] + 63 10
UIKit 0x00402988 -[UIViewController
_visibleView] + 90 11 UIKit 0x006a493c
-[UIClientRotationContext
initWithClient:toOrientation:duration:andWindow:] + 354 12 UIKit
0x0037c81e -[UIWindow
_setRotatableClient:toOrientation:updateStatusBar:duration:force:] +
954 13 UIKit 0x00604619
-[UIWindowController
transition:fromViewController:toViewController:target:didEndSelector:]
+ 1381 14 UIKit 0x0040965d
-[UIViewController presentModalViewController:withTransition:] + 3478
15 Project AddressBook 0x000032cb -[Home Events:] +
155 16 UIKit 0x003554fd
-[UIApplication sendAction:to:from:forEvent:] + 119 17 UIKit
0x003e5799 -[UIControl sendAction:to:forEvent:] + 67 18 UIKit
0x003e7c2b -[UIControl(Internal) _sendActionsForEvents:withEvent:] +
527 19 UIKit 0x003e67d8 -[UIControl
touchesEnded:withEvent:] + 458 20 UIKit
0x00379ded -[UIWindow _sendTouchesForEvent:] + 567 21 UIKit
0x0035ac37 -[UIApplication sendEvent:] + 447 22 UIKit
0x0035ff2e _UIApplicationHandleEvent + 7576 23 GraphicsServices
0x01723992 PurpleEventCallback + 1550 24 CoreFoundation
0x00e46944 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE1_PERFORM_FUNCTION
+ 52 25 CoreFoundation 0x00da6cf7
__CFRunLoopDoSource1 + 215 26 CoreFoundation
0x00da3f83 __CFRunLoopRun + 979 27 CoreFoundation
0x00da3840 CFRunLoopRunSpecific + 208 28 CoreFoundation
0x00da3761 CFRunLoopRunInMode + 97 29 GraphicsServices
0x017221c4 GSEventRunModal + 217 30 GraphicsServices
0x01722289 GSEventRun + 115 31 UIKit
0x00363c93 UIApplicationMain + 1160 32 Project AddressBook
0x00002828 main + 102 33 Project AddressBook
0x000027b9 start + 53 ) terminate called after throwing an instance of
'NSException' sharedlibrary apply-load-rules all Current language:
auto; currently objective
HELP ME PLEASE!!
Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'Could not load NIB in bundle: 'NSBundle (loaded)' with name 'eve''
Your problem is exactly this. You try to load a nib file named 'eve'.
Somewhere you call something like this:
VC *aVC = [[[VC alloc] initWithNibName:#"eve" bundle:nil] autorelease];
Xcode 4 should show you the call stack when it hits that exception. And in the source window it should show you the code where it happened. Three or four lines above that line is your problem.

Can't seem to get rid of key value coding-compliant error

This is the error i'm getting when i try and show a view controller modally inside my app:
*** Terminating app due to uncaught exception 'NSUnknownKeyException', reason: '[<KVPasscodeViewController 0x8b815a0> setValue:forUndefinedKey:]: this class is not key value coding-compliant for the key instructionLabel.'
*** Call stack at first throw:
(
0 CoreFoundation 0x011185a9 __exceptionPreprocess + 185
1 libobjc.A.dylib 0x0126c313 objc_exception_throw + 44
2 CoreFoundation 0x011184e1 -[NSException raise] + 17
3 Foundation 0x00aea677 _NSSetUsingKeyValueSetter + 135
4 Foundation 0x00aea5e5 -[NSObject(NSKeyValueCoding) setValue:forKey:] + 285
5 UIKit 0x0056630c -[UIRuntimeOutletConnection connect] + 112
6 CoreFoundation 0x0108e8cf -[NSArray makeObjectsPerformSelector:] + 239
7 UIKit 0x00564d23 -[UINib instantiateWithOwner:options:] + 1041
8 UIKit 0x00566ab7 -[NSBundle(UINSBundleAdditions) loadNibNamed:owner:options:] + 168
9 UIKit 0x0041c628 -[UIViewController _loadViewFromNibNamed:bundle:] + 70
10 UIKit 0x0041a134 -[UIViewController loadView] + 120
11 UIKit 0x0041a00e -[UIViewController view] + 56
12 UIKit 0x00418482 -[UIViewController contentScrollView] + 42
13 UIKit 0x00428f25 -[UINavigationController _computeAndApplyScrollContentInsetDeltaForViewController:] + 48
14 UIKit 0x00427555 -[UINavigationController _layoutViewController:] + 43
15 UIKit 0x00428870 -[UINavigationController _startTransition:fromViewController:toViewController:] + 524
16 UIKit 0x0042332a -[UINavigationController _startDeferredTransitionIfNeeded] + 266
17 UIKit 0x0053e2e9 -[UILayoutContainerView layoutSubviews] + 226
18 QuartzCore 0x002a6a5a -[CALayer layoutSublayers] + 181
19 QuartzCore 0x002a8ddc CALayerLayoutIfNeeded + 220
20 QuartzCore 0x002a8ed0 -[CALayer layoutIfNeeded] + 111
21 UIKit 0x0041b58a -[UIViewController window:willAnimateRotationToInterfaceOrientation:duration:] + 587
22 UIKit 0x0039255f -[UIWindow _setRotatableClient:toOrientation:updateStatusBar:duration:force:] + 4347
23 UIKit 0x00619619 -[UIWindowController transition:fromViewController:toViewController:target:didEndSelector:] + 1381
24 UIKit 0x0041e65d -[UIViewController presentModalViewController:withTransition:] + 3478
25 DearMe 0x00011ca1 -[NotificationViewController addPasscode] + 273
26 UIKit 0x0036a4fd -[UIApplication sendAction:to:from:forEvent:] + 119
27 UIKit 0x003fa799 -[UIControl sendAction:to:forEvent:] + 67
28 UIKit 0x003fcc2b -[UIControl(Internal) _sendActionsForEvents:withEvent:] + 527
29 UIKit 0x003fb7d8 -[UIControl touchesEnded:withEvent:] + 458
30 UIKit 0x0038eded -[UIWindow _sendTouchesForEvent:] + 567
31 UIKit 0x0036fc37 -[UIApplication sendEvent:] + 447
32 UIKit 0x00374f2e _UIApplicationHandleEvent + 7576
33 GraphicsServices 0x015f2992 PurpleEventCallback + 1550
34 CoreFoundation 0x010f9944 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE1_PERFORM_FUNCTION__ + 52
35 CoreFoundation 0x01059cf7 __CFRunLoopDoSource1 + 215
36 CoreFoundation 0x01056f83 __CFRunLoopRun + 979
37 CoreFoundation 0x01056840 CFRunLoopRunSpecific + 208
38 CoreFoundation 0x01056761 CFRunLoopRunInMode + 97
39 GraphicsServices 0x015f11c4 GSEventRunModal + 217
40 GraphicsServices 0x015f1289 GSEventRun + 115
41 UIKit 0x00378c93 UIApplicationMain + 1160
42 DearMe 0x000029df main + 127
43 DearMe 0x00002955 start + 53
44 ??? 0x00000001 0x0 + 1
)
terminate called after throwing an instance of 'NSException'
Any ideas about why this might be caused?
EDIT: The code which gives the error:
KVPasscodeViewController *passcodeController = [[KVPasscodeViewController alloc] init];
passcodeController.delegate = self;
UINavigationController *passcodeNavigationController = [[UINavigationController alloc] initWithRootViewController:passcodeController];
[self.navigationController presentModalViewController:passcodeNavigationController animated:YES];
[passcodeNavigationController release];
[passcodeController release];
This is caused because you have an outlet pointing at 'instructionLabel' in the XIB for that view controller.
You have an .xib file that is most likely pointing to a nonexistent label. This typically happens if you add a UILabel in Interface Builder, attach it to your code where instructionLabel exists, then later remove instructionLabel from the code, but forget to update the .xib.