• 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
Re: Init controller called twice
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Init controller called twice


  • Subject: Re: Init controller called twice
  • From: Zac Tolley <email@hidden>
  • Date: Sun, 7 Aug 2005 23:59:05 +0100

Yes, you are right, I just realized that too.

I need to move some things from my controller back into my document, I had them in the controller why I was working on things and hence I needed it in 2 places, thanks.


zac



On 7 Aug 2005, at 23:57, Daniel Jalkut wrote:

It looks like you probably have a window controller instantiated in your MainMenu (or otherwise named "main" nib file). Look for an instantiated "element" in your main nib file. You probably don't want that one in there...

D

PS Please don't reply to the list when somebody responds to you off- list...

On Aug 7, 2005, at 6:44 PM, Zac Tolley wrote:


I look in the stack the first time the app loads and get something like what you see below, I guess it's because it's the owner of the nib, but doesn't it have to be if it's the controller for this window?

How do I tell it not to load this nib by default, but have the nib loaded by the document?


Zac

0 -[MainWindowController init]
1 -[NSCustomObject nibInstantiate]
2 -[NSIBObjectData instantiateObject:]
3 -[NSIBObjectData nibInstantiateWithOwner:topLevelObjects:]
4 loadnib
5 +[NSBundle(NSNibLoading) _loadNibFile:nameTable:withZone:ownerBundle:]
6 +[NSBundle(NSNibLoading) loadNibFile:externalNameTable:withZone:]
7 +[NSBundle(NSNibLoading) loadNibNamed:owner:]
8 NSApplicationMain
9 main








On 7 Aug 2005, at 15:36, Daniel Jalkut wrote:



Have you set a breakpoint on the init routine and looked at the stack crawl at that point?

D

On Aug 7, 2005, at 7:02 AM, Zac Tolley wrote:




I have a weird one that I'm sure is a simple error.

I created a cocoa document app and then modified it to be modal/ view/controller based. I have a MyDocument, I created a window controller, I made that the owner of my window and I have overwritten makewindowcontrollers.

The problem is my window controllers init function gets called twice. It gets called, then after that the MyDocument created it in it makewindowcontrollers call.

What would be creating it the first time?
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
sweater.com


This email sent to email@hidden












_______________________________________________ Do not post admin requests to the list. They will be ignored. Cocoa-dev mailing list (email@hidden) Help/Unsubscribe/Update your Subscription: This email sent to email@hidden
References: 
 >Init controller called twice (From: Zac Tolley <email@hidden>)
 >Re: Init controller called twice (From: Zac Tolley <email@hidden>)

  • Prev by Date: Re: Init controller called twice
  • Next by Date: Modifying bitmap data
  • Previous by thread: Re: Init controller called twice
  • Next by thread: Coredata and plugins...
  • Index(es):
    • Date
    • Thread