• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Random "Controller cannot be nil" crash
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Random "Controller cannot be nil" crash


  • Subject: Random "Controller cannot be nil" crash
  • From: Jean-Nicolas Jolivet <email@hidden>
  • Date: Tue, 30 Mar 2010 14:31:23 -0400

I'm having a very frustrating issue that I can't seem to be able to pinpoint...

When I run my app, I randomly get a crash on startup with the following message(s) in the console:

==============================================================================================
2010-03-30 13:57:52.599 MyApp[6292:a0f] An uncaught exception was raised
2010-03-30 13:57:52.599 MyApp[6292:a0f] Controller cannot be nil
2010-03-30 13:57:52.601 MyApp[6292:a0f] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: 'Controller cannot be nil'
*** Call stack at first throw:
(
	0   CoreFoundation                      0x989dc40a __raiseError + 410
	1   libobjc.A.dylib                     0x91bbe509 objc_exception_throw + 56
	2   CoreFoundation                      0x989dc138 +[NSException raise:format:arguments:] + 136
	3   CoreFoundation                      0x989dc0aa +[NSException raise:format:] + 58
	4   AppKit                              0x977e771b -[NSBinder addBinding:toController:withKeyPath:valueTransformer:options:] + 252
	5   AppKit                              0x977e00f2 -[NSObject(NSKeyValueBindingCreation) bind:toObject:withKeyPath:options:] + 703
	6   AppKit                              0x9788c067 -[NSNibBindingConnector establishConnection] + 156
	7   AppKit                              0x977bb33b -[NSIBObjectData nibInstantiateWithOwner:topLevelObjects:] + 1249
	8   AppKit                              0x977b9450 loadNib + 257
	9   AppKit                              0x977b8848 +[NSBundle(NSNibLoading) _loadNibFile:nameTable:withZone:ownerBundle:] + 228
	10  AppKit                              0x977b8759 +[NSBundle(NSNibLoading) loadNibFile:externalNameTable:withZone:] + 158
	11  AppKit                              0x977b86a4 +[NSBundle(NSNibLoading) loadNibNamed:owner:] + 383
	12  AppKit                              0x977b54a9 NSApplicationMain + 434
	13  MyApp                               0x00002694 main + 36
	14  MyApp                               0x00002665 start + 53
)
sharedlibrary apply-load-rules all
kill
quit

==============================================================================================

Judging by the trace, I'm thinking it might have something to do with bindings? It appears to be really random... I'd say 1 times out of 3 my app starts normally, the other 2 attempts, I get this error...

Most of my controllers (that have bindings anyway) are singletons, but I tried changing that (i.e. to have my sharedController method return "(sharedController = [[[self class] alloc] init]);"  instead)... the bug still occur...

I'm out of ideas... I guess the problem could be in my nib but I also tried to perform a "diff" on my nib file (when the app actually runs and when it crashes), but the nib is exactly the same in both occasions... I can post my singleton code if it would help but it's a singleton template that I use all the time without any problems

If anyone has a clue as to what could be happening, it would be really appreciated as I really have no idea what to try next...

Jean-Nicolas Jolivet

_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

  • Follow-Ups:
    • Re: Random "Controller cannot be nil" crash
      • From: Jean-Nicolas Jolivet <email@hidden>
  • Prev by Date: Re: Creating a Virtual (Webcam) Device
  • Next by Date: Re: "-forwardInvocation:" like NSInvocation creation
  • Previous by thread: Re: Creating a Virtual (Webcam) Device
  • Next by thread: Re: Random "Controller cannot be nil" crash
  • Index(es):
    • Date
    • Thread