• 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: Retained ivars being set to 0x0
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Retained ivars being set to 0x0


  • Subject: Re: Retained ivars being set to 0x0
  • From: Laurence Harris <email@hidden>
  • Date: Thu, 22 Mar 2007 03:36:31 -0400


On Mar 22, 2007, at 2:48 AM, Sam Dunster wrote:

Hi all, I'm new to the whole cocoa scene.

I have created a Bonjour based game that opens a new window for every
connection a user double clicks on in a NSTableView that i fill with
local services.

I have a NSWindow created in IB and a NSWindowController linked to that.

I create the window by like this:
      GameWindowController *windowController = [[GameWindowController
alloc] initWithConnection:handle name:[nameField stringValue]
asHost:NO];
      [windowController showWindow:self];

Once the initialiser is called, i store the connection handle and the
name of the player in ivars.

I can successfully call those ivars inside the initialising method,
but as soon as it drops back out of the initialiser and the window
starts firing other events, like when someone tries to chat, i some of
the ivars for the window controller (like player name and the
connection handle) are set to 0x0, and so they are unusable.

I have tried retaining the ivars, and even the window controller
itself, but nothing I know from reading the memoray allocation info
for cocoa seems to help.

There are other ivars that are set to 0x0 as well, like _windowNibName
that are set properly in the init but not anywhere else.

Is there anything you can suggest i should try?

Posting this on the cocoa-dev list? This list is for questions related to Xcode and other Apple tools. Coding questions should be directed to the appropriate list for the relevant technology to get the best responses.


Larry

_______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


References: 
 >Re: Retained ivars being set to 0x0 (From: "Sam Dunster" <email@hidden>)

  • Prev by Date: "Multiple build commands" warning message
  • Next by Date: Adding an Interface Palette target to an existing application project
  • Previous by thread: Re: Retained ivars being set to 0x0
  • Next by thread: "Multiple build commands" warning message
  • Index(es):
    • Date
    • Thread