• 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: "Ken Ferry" <email@hidden>
  • Date: Thu, 22 Mar 2007 01:13:33 -0700

Hi Sam,

It sounds like you might have created two different window controller
objects, perhaps one in the nib and one in code.

Could you try verifying that?  Try logging the value of the self
pointer in your init method and in your actions.  If they aren't the
same, this is the problem.

NSLog(@"this window controller is at %p", self);

-Ken

On 3/22/07, Sam Dunster <email@hidden> wrote:
Hi all, I'm relatively 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?


Thanks in advance, i've been trying to fix this for over a day now, given up, Sam _______________________________________________

Cocoa-dev mailing list (email@hidden)

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

_______________________________________________

Cocoa-dev mailing list (email@hidden)

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


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

  • Prev by Date: Retained ivars being set to 0x0
  • Next by Date: Re: NSBezierPath Arc bug, intel.
  • Previous by thread: Retained ivars being set to 0x0
  • Next by thread: Re: Retained ivars being set to 0x0 (SOLVED)
  • Index(es):
    • Date
    • Thread