开发者

Objective C Exception thrown in main method

I set an exception breakpoint after my app continued crashing before it would execute any of my code. I don't know what's wrong. I printed out the stack trace, but the only decipherable portion of the stack trace is that the problem is in the line: return UIApplicationMain(argc, argv, nil, NSStringFromClass([TACGridAppDelegate class]));

Here is the stack trace:


`#0  0x014b7cb4 in objc_exception_throw ()`
`#1  0x013209c1 in -[NSException raise] ()`
`#2  0x00a99143 in -[NSObject(NSKeyValueCoding) setValue:forUndefinedKey:] ()`
`#3  0x00a0ad5f in _NSSetUsingKeyValueSetter ()`
`#4  0x00a0accf in -[NSObject(NSKeyValueCoding) setValue:forKey:] ()`
`#5  0x00a25d78 in -[NSObject(NSKeyValueCoding) setValue:forKeyPath:] ()`
`#6  0x0035e7af in -[UIRuntimeOutletConnection connect] ()`
`#7  0x013228ba in -[NSObject performSelector:] ()`
`#8  0x0128b251 in -[NSArray makeObjectsPerformSelector:] ()`
`#9  0x0035d303 in -[UINib insta开发者_StackOverflowntiateWithOwner:options:] ()`
`#10 0x0035eeab in -[NSBundle(UINSBundleAdditions) loadNibNamed:owner:options:] ()`
`#11 0x00142f2f in -[UIApplication _loadMainNibFileNamed:bundle:] ()`
`#12 0x0014322c in -[UIApplication _loadMainInterfaceFile] ()`
`#13 0x0014281a in -[UIApplication _runWithURL:payload:launchOrientation:statusBarStyle:statusBarHidden:] ()`
`#14 0x001514c6 in -[UIApplication handleEvent:withNewEvent:] ()`
`#15 0x00151f34 in -[UIApplication sendEvent:] ()`
`#16 0x0014590c in _UIApplicationHandleEvent ()`
`#17 0x01b4a876 in PurpleEventCallback ()`
`#18 0x012f3ff5 in __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE1_PERFORM_FUNCTION__ ()`
`#19 0x01258902 in __CFRunLoopDoSource1 ()`
`#20 0x012571ea in __CFRunLoopRun ()`
`#21 0x01256694 in CFRunLoopRunSpecific ()`
`#22 0x012565ab in CFRunLoopRunInMode ()`
`#23 0x00142326 in -[UIApplication _run] ()`
`#24 0x00143851 in UIApplicationMain ()`
`#25 0x0000215a in main (argc=1, argv=0xbffff610) at /Users/MasonSilber/Desktop/Programming Stuff/iOS Programming/XCode 4/TACGrid/TACGrid/main.m:16`

Any help is appreciated. Thanks!

EDIT: Okay, I've narrowed down the problem. It throws this exception whenever I set TACGridViewController as the Main Interface in the iPad deployment info. Does that help?


Read the backtrace, specifically:

#8  0x0128b251 in -[NSArray makeObjectsPerformSelector:] ()
#9  0x0035d303 in -[UINib instantiateWithOwner:options:] ()
#10 0x0035eeab in -[NSBundle(UINSBundleAdditions) loadNibNamed:owner:options:] ()

The exception is happening in the loading of the XIB file, presumably the main XIB file that is loaded as the app is launched.

I.e. your xib file is in error. Since an exception is thrown, there should be a log message containing details about the exception (if you "continue" in the debugger, it'll probably spew it).

Most likely, you changed the name of an outlet in your source code and didn't update the XIB file. Could be something else, though, and without the exception details it is impossible to say more.


EDIT: Okay, I've narrowed down the problem. It throws this exception whenever I set TACGridViewController as the Main Interface in the iPad deployment info. Does that help?

Sounds like an incorrect XIB.

  1. check that you have spelled the class name correctly in both your source and xib file.

  2. do you have a custom setter for any of your IB outlets? That backtrace indicates not, but just checking.

  3. make sure all of your outlets are spelled correctly and identically between the xib file and your source.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜