iOS 9 crash when presenting UIActivityViewController : [UIView _fromWindowOrientation] unrecognized selector sent to instance (UIView) - cocoa-touch

My app is crashing any time I present a UIActivityViewController, only on iOS9.
I've isolated the code down to this: (Cleared everything from the AppDelegate minus setting my test view controller as the root and only VC).
In the test view controller on button tap:
(I made the activityVC an instance property to check if there was a deallocation issue because other debugging efforts suggested that the activityVC might get dealloced during presentation)
NSString *string = #"PLS WORK";
self.activityViewController =
[[UIActivityViewController alloc] initWithActivityItems:#[string]
applicationActivities:nil];
[self presentViewController:self.activityViewController
animated:YES
completion:nil];
yields
2015-09-21 11:41:55.889 App[21548:606985] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[UIView
_fromWindowOrientation]: unrecognized selector sent to instance 0x7f9168f25760'
*** First throw call stack: ( 0 CoreFoundation 0x000000010c68df65 __exceptionPreprocess + 165 1 libobjc.A.dylib 0x000000010be08deb objc_exception_throw + 48 2 CoreFoundation 0x000000010c69658d -[NSObject(NSObject) doesNotRecognizeSelector:] + 205 3 CoreFoundation 0x000000010c5e3f7a
___forwarding___ + 970 4 CoreFoundation 0x000000010c5e3b28 _CF_forwarding_prep_0 + 120 5 UIKit 0x000000010b104aa0 -[_UIViewControllerTransitionContext
_affineTransform] + 132 6 UIKit 0x000000010b104c77 -[_UIViewControllerTransitionContext targetTransform] + 29 7 UIKit 0x000000010b10895f -[_UIViewControllerTransitionCoordinator targetTransform] + 40 8 UIKit 0x000000010b109483 _UIViewControllerTransitionCoordinatorIsRotating + 35 9 UIKit 0x000000010a8fbcba
-[UIViewController viewWillTransitionToSize:withTransitionCoordinator:] + 78 10 UIKit 0x000000010aa5e68d __79-[UIAlertController
_contentViewControllerWillTransitionToSize:withAnimations:]_block_invoke591
+ 154 11 UIKit 0x000000010a7faeec +[UIView(Animation) performWithoutAnimation:] + 65 12 UIKit 0x000000010b03b693 -[_UIAnimationCoordinator animate] + 128 13 UIKit 0x000000010aa5e54d -[UIAlertController
_contentViewControllerWillTransitionToSize:withAnimations:] + 1071 14 UIKit 0x000000010b0d2910
-[_UIAlertControllerView _sizeOfContentViewControllerChanged] + 1009 15 UIKit 0x000000010aa5afe8
-[UIAlertController viewDidLoad] + 659 16 UIKit 0x000000010a8e0931 -[UIViewController loadViewIfRequired] + 1344 17 UIKit 0x000000010a8e0c7d
-[UIViewController view] + 27 18 UIKit 0x000000010b0292ab -[UIActivityViewController viewDidLoad] + 1266 19 UIKit 0x000000010a8e0931
-[UIViewController loadViewIfRequired] + 1344 20 UIKit 0x000000010a8e0c7d -[UIViewController view] + 27 21 UIKit 0x000000010a8fa738 -[UIViewController _setPresentationController:] + 100 22 UIKit 0x000000010a8f1cf4
-[UIViewController _presentViewController:modalSourceViewController:presentationController:animationController:interactionController:completion:]
+ 1437 23 UIKit 0x000000010a8f3970 -[UIViewController _presentViewController:withAnimationController:completion:] + 4870 24 UIKit 0x000000010a8f6878
-[UIViewController _performCoordinatedPresentOrDismiss:animated:] + 489 25 UIKit 0x000000010a8f6387
-[UIViewController presentViewController:animated:completion:] + 179 26 App 0x0000000107607734
-[YYWTFViewController wtfButtonPressed:] + 644 27 UIKit 0x000000010a7571fa -[UIApplication sendAction:to:from:forEvent:] + 92 28 UIKit 0x000000010a8bb504
-[UIControl sendAction:to:forEvent:] + 67 29 UIKit 0x000000010a8bb7d0 -[UIControl _sendActionsForEvents:withEvent:] + 311 30 UIKit 0x000000010a8ba906
-[UIControl touchesEnded:withEvent:] + 601 31 UIKit 0x000000010a7c1aa3 -[UIWindow _sendTouchesForEvent:] + 835 32 UIKit 0x000000010a7c2691 -[UIWindow sendEvent:] + 865 33 UIKit 0x000000010a774752 -[UIApplication sendEvent:] + 263 34 UIKit 0x000000010a74ffcc _UIApplicationHandleEventQueue + 6693 35 CoreFoundation 0x000000010c5ba0a1
__CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 17 36 CoreFoundation 0x000000010c5affcc
__CFRunLoopDoSources0 + 556 37 CoreFoundation 0x000000010c5af483 __CFRunLoopRun + 867 38 CoreFoundation 0x000000010c5aee98 CFRunLoopRunSpecific + 488 39 GraphicsServices 0x000000010f0d9ad2 GSEventRunModal + 161 40 UIKit 0x000000010a755676 UIApplicationMain + 171 41 App 0x000000010766101f main + 111 42 libdyld.dylib 0x000000010d98792d start + 1 )
Assembler crash log:
0x10a7555cb <+0>: pushq %rbp
0x10a7555cc <+1>: movq %rsp, %rbp
0x10a7555cf <+4>: pushq %r15
0x10a7555d1 <+6>: pushq %r14
0x10a7555d3 <+8>: pushq %r13
0x10a7555d5 <+10>: pushq %r12
0x10a7555d7 <+12>: pushq %rbx
0x10a7555d8 <+13>: pushq %rax
0x10a7555d9 <+14>: movq %rcx, %rbx
0x10a7555dc <+17>: movq %rsi, %r15
0x10a7555df <+20>: movl %edi, %r12d
0x10a7555e2 <+23>: movq 0xcc7ba7(%rip), %r13 ; (void *)0x000000010be1bd00: objc_retain
0x10a7555e9 <+30>: movq %rdx, %rdi
0x10a7555ec <+33>: callq *%r13
0x10a7555ef <+36>: movq %rax, %r14
0x10a7555f2 <+39>: movq %rbx, %rdi
0x10a7555f5 <+42>: callq *%r13
0x10a7555f8 <+45>: movq %rax, %r13
0x10a7555fb <+48>: leaq 0xcc5aea(%rip), %rbx ; _UIApplicationLinkedOnVersion
0x10a755602 <+55>: movl (%rbx), %eax
0x10a755604 <+57>: testl %eax, %eax
0x10a755606 <+59>: jne 0x10a755627 ; <+92>
0x10a755608 <+61>: cmpq $-0x1, 0xcc18a0(%rip) ; WebKitSetIsClassic + 7
0x10a755610 <+69>: je 0x10a755651 ; <+134>
0x10a755612 <+71>: leaq 0xcc1897(%rip), %rdi ; _UIApplicationLinkedOnVersionOnce
0x10a755619 <+78>: leaq 0xccaeb0(%rip), %rsi ; __block_literal_global1457
0x10a755620 <+85>: callq 0x10b1a3f5c ; symbol stub for: dispatch_once
0x10a755625 <+90>: movl (%rbx), %eax
0x10a755627 <+92>: cmpl $0x20100, %eax
0x10a75562c <+97>: jb 0x10a755651 ; <+134>
0x10a75562e <+99>: callq 0x10b1a3746 ; symbol stub for: objc_autoreleasePoolPush
0x10a755633 <+104>: movq %rax, %rbx
0x10a755636 <+107>: movl %r12d, %edi
0x10a755639 <+110>: movq %r15, %rsi
0x10a75563c <+113>: movq %r14, %rdx
0x10a75563f <+116>: movq %r13, %rcx
0x10a755642 <+119>: callq 0x10a755698 ; _UIApplicationMainPreparations
0x10a755647 <+124>: movq %rbx, %rdi
0x10a75564a <+127>: callq 0x10b1a3740 ; symbol stub for: objc_autoreleasePoolPop
0x10a75564f <+132>: jmp 0x10a755662 ; <+151>
0x10a755651 <+134>: movl %r12d, %edi
0x10a755654 <+137>: movq %r15, %rsi
0x10a755657 <+140>: movq %r14, %rdx
0x10a75565a <+143>: movq %r13, %rcx
0x10a75565d <+146>: callq 0x10a755698 ; _UIApplicationMainPreparations
0x10a755662 <+151>: movq 0xcc59df(%rip), %rdi ; UIApp
0x10a755669 <+158>: movq 0xc4a3c8(%rip), %rsi ; "_run"
0x10a755670 <+165>: callq *0xcc7b0a(%rip) ; (void *)0x000000010be1e800: objc_msgSend
0x10a755676 <+171>: movq 0xcc7b0b(%rip), %rbx ; (void *)0x000000010be1bd70: objc_release <--- DEAD
What is odd is that creating a new project targeted for iOS9 with the exact same code does not crash. I don't know how I can isolate this issue in my project any further. I'd appreciate any hints or debugging suggestions!

If you have a category on UIViewController with a property named window, this is the result. This only happens since the release of iOS 9.

With the release of iOS 9, Apple introduced a property named window on a UIViewController -- Check the use of your variable names.

Related

SIGSEGV SEGV_ACCERR in ios6

I have developed the ios App for a client . The application is crashing in regular interval in ios 6 . The application is GPS based and run background and foreground . Below is the crash report which I received:
libobjc.A.dylib 0x3a7c25b0 objc_msgSend + 16
Foundation 0x33306599 -[NSNotificationCenter
postNotificationName:object:userInfo:] + 73
Foundation 0x3330a05b -[NSNotificationCenter
postNotificationName:object:] + 31
UIKit 0x34a01307 -[UIApplication _performMemoryWarning] +
103
libdispatch.dylib 0x3abde4b7 _dispatch_client_callout + 23
libdispatch.dylib 0x3abe5139 _dispatch_source_invoke$VARIANT$mp + 253
libdispatch.dylib 0x3abe317f _dispatch_main_queue_callback_4CF$VARIANT$mp + 163
CoreFoundation 0x32a72f3b __CFRunLoopRun + 1291
CoreFoundation 0x329e5ebd CFRunLoopRunSpecific + 357
CoreFoundation 0x329e5d49 CFRunLoopRunInMode + 105
GraphicsServices 0x365be2eb GSEventRunModal + 75
UIKit 0x348fb301 UIApplicationMain + 1121
Can anybody let me know what is the above issue is about ?
Surjan

iOS app crashing for apple review team and can't replicate

My app is crashing for the apple review team but I can't replicate the issue. They sent me the crash log.
Incident Identifier:
CrashReporter Key: d91f018f5afc31f948a80025c7a09bb112a3caf4
Hardware Model: iPhone3,1
Process:
Path:
Identifier:
Version: ??? (???)
Code Type: ARM (Native)
Parent Process: launchd [1]
Date/Time: 2012-06-12 09:27:55.479 -0700
OS Version: iPhone OS 5.1.1 (9B206)
Report Version: 104
Exception Type: EXC_CRASH (SIGABRT)
Exception Codes: 0x00000000, 0x00000000
Crashed Thread: 0
Last Exception Backtrace:
0 CoreFoundation 0x3766b88f __exceptionPreprocess + 163
1 libobjc.A.dylib 0x35370259 objc_exception_throw + 33
2 CoreFoundation 0x3766ea9b -[NSObject doesNotRecognizeSelector:] + 175
3 CoreFoundation 0x3766d915 ___forwarding___ + 301
4 CoreFoundation 0x375c8650 _CF_forwarding_prep_0 + 48
5 Sportal_TDF 0x00031515 -[MenuViewController showStageList:] (MenuViewController.m:62)
6 CoreFoundation 0x375ca1fb -[NSObject performSelector:withObject:] + 43
7 Sportal_TDF 0x00005d93 -[DataViewControllerBase retrieveCachedJson:json:cacheAction:] (DataViewControllerBase.m:468)
8 Sportal_TDF 0x00005e57 -[DataViewControllerBase callWebService:json:cacheAction:successAction:] (DataViewControllerBase.m:480)
9 Sportal_TDF 0x000314f9 -[MenuViewController loadUpcomingStage] (MenuViewController.m:57)
10 Sportal_TDF 0x000317b9 -[MenuViewController viewWillAppear:] (MenuViewController.m:142)
11 UIKit 0x31381b95 -[UIViewController _setViewAppearState:isAnimating:] + 145
12 UIKit 0x31525ad1 __52-[UIViewController _setViewAppearState:isAnimating:]_block_invoke_0 + 137
13 CoreFoundation 0x3765f631 __NSArrayEnumerate + 365
14 CoreFoundation 0x375c4ed5 -[NSArray enumerateObjectsWithOptions:usingBlock:] + 65
15 UIKit 0x31381c39 -[UIViewController _setViewAppearState:isAnimating:] + 309
16 UIKit 0x31381a49 -[UIViewController viewWillMoveToWindow:] + 233
17 UIKit 0x31342b05 -[UIView(Hierarchy) _willMoveToWindow:withAncestorView:] + 529
18 UIKit 0x313424ab -[UIView(Internal) _addSubview:positioned:relativeTo:] + 303
19 UIKit 0x31342377 -[UIView(Hierarchy) addSubview:] + 31
20 UIKit 0x31377555 -[UIWindow addRootViewControllerViewIfPossible] + 289
21 UIKit 0x31369e87 -[UIWindow _setHidden:forced:] + 295
22 UIKit 0x313da7d5 -[UIWindow makeKeyAndVisible] + 25
23 Sportal_TDF 0x000030b3 -[Sportal_TDFAppDelegate application:didFinishLaunchingWithOptions:] (Sportal_TDFAppDelegate.m:107)
24 UIKit 0x31377cab -[UIApplication _callInitializationDelegatesForURL:payload:suspended:] + 1183
25 UIKit 0x313717dd -[UIApplication _runWithURL:payload:launchOrientation:statusBarStyle:statusBarHidden:] + 409
26 UIKit 0x3133fac3 -[UIApplication handleEvent:withNewEvent:] + 1011
27 UIKit 0x3133f567 -[UIApplication sendEvent:] + 55
28 UIKit 0x3133ef3b _UIApplicationHandleEvent + 5827
29 GraphicsServices 0x33d8122b PurpleEventCallback + 883
30 CoreFoundation 0x3763f523 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE1_PERFORM_FUNCTION__ + 39
31 CoreFoundation 0x3763f4c5 __CFRunLoopDoSource1 + 141
32 CoreFoundation 0x3763e313 __CFRunLoopRun + 1371
33 CoreFoundation 0x375c14a5 CFRunLoopRunSpecific + 301
34 CoreFoundation 0x375c136d CFRunLoopRunInMode + 105
35 UIKit 0x3137086b -[UIApplication _run] + 551
36 UIKit 0x3136dcd5 UIApplicationMain + 1081
37 0x00002a07 main (main.m:16)
38 0x000029a0 0x1000 + 6560
It is crashing on line
#autoreleasepool
{
return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class]));
}
How can I debug when I can't replicate the issue? Has anyone experienced this issue. My app was working fine in previous versions but this time it is crashing in 5.1.1. Any help would be greatly appreciated.
What does [MenuViewController showStageList:] contain on line 62!?
Obviously you are calling a method, that's non existent: [NSObject doesNotRecognizeSelector:].

Passing an unknown type (?) object to a function as a parameter in objective-c

How do I pass an unknown type (?) object to a function and then set it to a local ones value in objective-c? The unknown object is an n-th item of a JSON value. I use the JSON framework.
[giveMeTheNthObj:[items objectAtIndex:indexPath.row]]
...
- (void)giveMeTheNthObj:(id)o {
Classname *local = o;
}
The above fails. I think because the local is a pointer that should point to a Classname type. What should be the type of the local variable?
The error log:
GNU gdb 6.3.50-20050815 (Apple version gdb-1705) (Fri Jul 1 10:50:06 UTC 2011)
Copyright 2004 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB. Type "show warranty" for details.
This GDB was configured as "x86_64-apple-darwin".Attaching to process 37438.
2011-09-30 16:39:21.649 Navig[37438:b303] -[UILabel copyWithZone:]: unrecognized
selector sent to instance 0x4b949a0
2011-09-30 16:39:21.652 Navig[37438:b303] *** Terminating app due to uncaught exception
'NSInvalidArgumentException', reason: '-[UILabel copyWithZone:]: unrecognized selector
sent to instance 0x4b949a0'
*** Call stack at first throw:
(
0 CoreFoundation 0x00dde5a9 __exceptionPreprocess + 185
1 libobjc.A.dylib 0x00f32313 objc_exception_throw + 44
2 CoreFoundation 0x00de00bb -[NSObject(NSObject) doesNotRecognizeSelector:] + 187
3 CoreFoundation 0x00d4f966 ___forwarding___ + 966
4 CoreFoundation 0x00d4f522 _CF_forwarding_prep_0 + 50
5 CoreFoundation 0x00d3edca -[NSObject(NSObject) copy] + 42
6 UIKit 0x000de18b -[UIViewController setTitle:] 95
7 Foundation 0x007b05e5 -[NSObject(NSKeyValueCoding) setValue:forKey:] + 285
8 UIKit 0x0022c30c -[UIRuntimeOutletConnection connect] + 112
9 CoreFoundation 0x00d548cf -[NSArray makeObjectsPerformSelector:] + 239
10 UIKit 0x0022ad23 -[UINib instantiateWithOwner:options:] + 1041
11 UIKit 0x0022cab7 -[NSBundle(UINSBundleAdditions) loadNibNamed:owner:options:] + 168
12 UIKit 0x000e2628 -[UIViewController _loadViewFromNibNamed:bundle:] + 70
13 UIKit 0x000e0134 -[UIViewController loadView] + 120
14 UIKit 0x000e000e -[UIViewController view] + 56
15 UIKit 0x000de482 -[UIViewController contentScrollView] + 42
16 UIKit 0x000eef25 -[UINavigationController _computeAndApplyScrollContentInsetDeltaForViewController:] + 48
17 UIKit 0x000ed555 -[UINavigationController _layoutViewController:] + 43
18 UIKit 0x000ee7aa -[UINavigationController _startTransition:fromViewController:toViewController:] + 326
19 UIKit 0x000e932a -[UINavigationController _startDeferredTransitionIfNeeded] + 266
20 UIKit 0x000f0562 -[UINavigationController pushViewController:transition:forceImmediate:] + 932
21 UIKit 0x089b9c36 [UINavigationControllerAccessibility(SafeCategory) pushViewController:transition:forceImmediate:] + 77
22 UIKit 0x000e91c4 -[UINavigationController pushViewController:animated:] + 62
23 Navig 0x00002dfd -[RootViewController tableView:didSelectRowAtIndexPath:] + 269
24 UIKit 0x000a7b68 -[UITableView _selectRowAtIndexPath:animated:scrollPosition:notifyDelegate:] + 1140
25 UIKit 0x0009db05 -[UITableView _userSelectRowAtPendingSelectionIndexPath:] + 219
26 Foundation 0x007b779e __NSFireDelayedPerform + 441
27 CoreFoundation 0x00dbf8c3 __CFRUNLOOP_IS_CALLING_OUT_TO_A_TIMER_CALLBACK_FUNCTION__ + 19
28 CoreFoundation 0x00dc0e74 __CFRunLoopDoTimer + 1220
29 CoreFoundation 0x00d1d2c9 __CFRunLoopRun + 1817
30 CoreFoundation 0x00d1c840 CFRunLoopRunSpecific + 208
31 CoreFoundation 0x00d1c761 CFRunLoopRunInMode + 97
32 GraphicsServices 0x010161c4 GSEventRunModal + 217
33 GraphicsServices 0x01016289 GSEventRun + 115
34 UIKit 0x0003ec93 UIApplicationMain + 1160
35 Navig 0x00002439 main + 121
36 Navig 0x000023b5 start + 53
)
terminate called throwing an exceptionsharedlibrary apply-load-rules all
Current language: auto; currently objective-c
(gdb)
When you say "The above fails."; how exactly does it fail? Exception raised at run-time, warning during compile, etc? Does this help:
- (void)giveMeTheNthObj:(id)o {
if ([o isKindOfClass:[Classname class]]) {
Classname *local = (Classname *)o;
}
}
You want NSString *local = NSStringFromClass([o class]);?

Application crash on UIButton click : iphone

I have a View base iphone application
I add a NSObject class AddNewContact and take its object in IB
AddNewContact.h
#import <Foundation/Foundation.h>
#interface AddNewContact : NSObject {
}
-(IBAction)abc:(id)sender;
#end
AddNewContact.m
#import "AddNewContact.h"
#implementation AddNewContact
-(IBAction)abc:(id)sender{
NSLog(#"this is test");
}
#end
I bind a UIButton action to abc: on clicking the button application crashes, even NSLog is also not logged
but if I bind the button action to other classes function then it working ok
Crash Log
2011-06-08 15:40:30.368 myApp[5466:207] -[NSCFString abc:]: unrecognized selector sent to instance 0x6b7b1c0
2011-06-08 15:40:30.416 myApp[5466:207] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[NSCFString abc:]: unrecognized selector sent to instance 0x6b7b1c0'
*** Call stack at first throw:
(
0 CoreFoundation 0x02ad9b99 __exceptionPreprocess + 185
1 libobjc.A.dylib 0x02c2940e objc_exception_throw + 47
2 CoreFoundation 0x02adb6ab -[NSObject(NSObject) doesNotRecognizeSelector:] + 187
3 CoreFoundation 0x02a4b2b6 ___forwarding___ + 966
4 CoreFoundation 0x02a4ae72 _CF_forwarding_prep_0 + 50
5 UIKit 0x0039e7f8 -[UIApplication sendAction:to:from:forEvent:] + 119
6 UIKit 0x00429de0 -[UIControl sendAction:to:forEvent:] + 67
7 UIKit 0x0042c262 -[UIControl(Internal) _sendActionsForEvents:withEvent:] + 527
8 UIKit 0x0042ae0f -[UIControl touchesEnded:withEvent:] + 458
9 UIKit 0x003c23d0 -[UIWindow _sendTouchesForEvent:] + 567
10 UIKit 0x003a3cb4 -[UIApplication sendEvent:] + 447
11 UIKit 0x003a89bf _UIApplicationHandleEvent + 7672
12 GraphicsServices 0x0306a822 PurpleEventCallback + 1550
13 CoreFoundation 0x02abaff4 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE1_PERFORM_FUNCTION__ + 52
14 CoreFoundation 0x02a1b807 __CFRunLoopDoSource1 + 215
15 CoreFoundation 0x02a18a93 __CFRunLoopRun + 979
16 CoreFoundation 0x02a18350 CFRunLoopRunSpecific + 208
17 CoreFoundation 0x02a18271 CFRunLoopRunInMode + 97
18 GraphicsServices 0x0306900c GSEventRunModal + 217
19 GraphicsServices 0x030690d1 GSEventRun + 115
20 UIKit 0x003acaf2 UIApplicationMain + 1160
21 myApp 0x00001fa4 main + 102
22 myApp 0x00001f35 start + 53
)
terminate called after throwing an instance of 'NSException'
Can anybody tell me where I am wrong
Thanks
Amit Battan
You will be releasing your AddNewContact view controller, the view is still in the superview but the viewController is released, the button tries to call 'abc' on AddNewContact controller which no longer exists...

Weird problems with program and debugger in xcode

Okay, I have a program that I'm trying to test on my iPad. I have it all set up so that the app is able to get on the iPad just fine, but running it on the iPad is a different story.
Now, the thing is, my program was working fine on the debug configuration, but now it won't work on that, either. It's strange, because before I was able to get to a certain part of the program before it crashed, but now it's crashing before that.
The debugger is hardly helping. When I use the debugger window, it will step into one line of code, and then suddenly jump back to another line of code.
I really don't understand what's going on. The crash is now occuring in a root view controller that I have set up, called 'FunctionMachineViewController. Here's the code for when it crashes:
-(IBAction)startOnePlayer:(id)sender
{
GameViewController* GameView = [[GameViewController alloc] initWithNibName:nil bundle:nil];
[GameView isOnePlayer:YES withLevel:startLevelNumber];
[self presentModalViewController:GameView animated:YES];
}
GameViewController is supposed to initialize just fine, but the debugger shows it as uninitialized. I even tried setting it up in the header file instead, but the problem still happens. Has anyone else come across these problems? Any help would be greatly appreciated!
EDIT: Here's what the console says when it crashes:
[Session started at 2011-06-02 21:46:10 -0700.]
2011-06-02 21:46:13.309 FunctionMachine[5033:207] *** Terminating app due to uncaught exception 'NSUnknownKeyException', reason: '[<GameViewController 0x4b2a890> setValue:forUndefinedKey:]: this class is not key value coding-compliant for the key Yminus2.'
*** Call stack at first throw:
(
0 CoreFoundation 0x00dd55a9 __exceptionPreprocess + 185
1 libobjc.A.dylib 0x00f29313 objc_exception_throw + 44
2 CoreFoundation 0x00dd54e1 -[NSException raise] + 17
3 Foundation 0x0003d677 _NSSetUsingKeyValueSetter + 135
4 Foundation 0x0003d5e5 -[NSObject(NSKeyValueCoding) setValue:forKey:] + 285
5 UIKit 0x004c130c -[UIRuntimeOutletConnection connect] + 112
6 CoreFoundation 0x00d4b8cf -[NSArray makeObjectsPerformSelector:] + 239
7 UIKit 0x004bfd23 -[UINib instantiateWithOwner:options:] + 1041
8 UIKit 0x004c1ab7 -[NSBundle(UINSBundleAdditions) loadNibNamed:owner:options:] + 168
9 UIKit 0x00377628 -[UIViewController _loadViewFromNibNamed:bundle:] + 70
10 UIKit 0x00375134 -[UIViewController loadView] + 120
11 UIKit 0x0037500e -[UIViewController view] + 56
12 UIKit 0x00376a3d -[UIViewController viewControllerForRotation] + 63
13 UIKit 0x00372988 -[UIViewController _visibleView] + 90
14 UIKit 0x0061493c -[UIClientRotationContext initWithClient:toOrientation:duration:andWindow:] + 354
15 UIKit 0x002ec81e -[UIWindow _setRotatableClient:toOrientation:updateStatusBar:duration:force:] + 954
16 UIKit 0x00574619 -[UIWindowController transition:fromViewController:toViewController:target:didEndSelector:] + 1381
17 UIKit 0x0037965d -[UIViewController presentModalViewController:withTransition:] + 3478
18 FunctionMachine 0x00001fdd -[FunctionMachineViewController startOnePlayer:] + 227
19 UIKit 0x002c54fd -[UIApplication sendAction:to:from:forEvent:] + 119
20 UIKit 0x00355799 -[UIControl sendAction:to:forEvent:] + 67
21 UIKit 0x00357c2b -[UIControl(Internal) _sendActionsForEvents:withEvent:] + 527
22 UIKit 0x00356a1c -[UIControl touchesBegan:withEvent:] + 277
23 UIKit 0x002e9d41 -[UIWindow _sendTouchesForEvent:] + 395
24 UIKit 0x002cac37 -[UIApplication sendEvent:] + 447
25 UIKit 0x002cff2e _UIApplicationHandleEvent + 7576
26 GraphicsServices 0x0172d992 PurpleEventCallback + 1550
27 CoreFoundation 0x00db6944 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE1_PERFORM_FUNCTION__ + 52
28 CoreFoundation 0x00d16cf7 __CFRunLoopDoSource1 + 215
29 CoreFoundation 0x00d13f83 __CFRunLoopRun + 979
30 CoreFoundation 0x00d13840 CFRunLoopRunSpecific + 208
31 CoreFoundation 0x00d13761 CFRunLoopRunInMode + 97
32 GraphicsServices 0x0172c1c4 GSEventRunModal + 217
33 GraphicsServices 0x0172c289 GSEventRun + 115
34 UIKit 0x002d3c93 UIApplicationMain + 1160
35 FunctionMachine 0x00001c64 main + 102
36 FunctionMachine 0x00001bf5 start + 53
37 ??? 0x00000001 0x0 + 1
)
terminate called after throwing an instance of 'NSException'
Turns out that, when I went and changed the name of several UILabels in the header of GameViewController, I forgot to fix the names in the interface builder, too. Don't know if that was what was causing the debugger to act weird, but everything is working now!