• 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
Memory management question.
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Memory management question.


  • Subject: Memory management question.
  • From: Scott Andrew <email@hidden>
  • Date: Fri, 11 Feb 2005 17:36:47 -0800

This is a newbie question....

I have a panel that I create using the following code.

-(IBAction)showBonusPane:(id)sender
{
    FTBonusPanelController* panel = [[FTBonusPanelController alloc]
initWithParent:[self window]];

    [NSApp beginSheet:[panel window]
        modalForWindow:[self window]
        modalDelegate:self
       didEndSelector: @selector(sheetEnded:returnCode:context:)
        contextInfo:NULL];

    //[NSApp runModalForWindow:[panel window] relativeToWindow:[self
window]];
}

My FTBonusPaneController has a handler for its "Close" push button that
calls endPanel and order out.

Is this OK code to write?


- (void)sheetEnded:(NSWindow*)sheet returnCode:(int)returnCode
context:(void*)contextInfo
{
    [[sheet windowController] release];
}

My thinking is isn't the windowController count at least 2? I have a
reference that I haven't released and the window has a reference?

Thanks for the help,
Scott Andrew

 _______________________________________________
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

  • Prev by Date: Re: Categories Generating Warnings?
  • Next by Date: Re: Philosophy of FSRef - way
  • Previous by thread: Re: Converting string equation to int
  • Next by thread: A few questions about Memory Management
  • Index(es):
    • Date
    • Thread