• 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: NSWindow alloc/dealloc problems
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: NSWindow alloc/dealloc problems


  • Subject: Re: NSWindow alloc/dealloc problems
  • From: j o a r <email@hidden>
  • Date: Mon, 29 Nov 2004 10:42:39 +0100


On 2004-11-29, at 10.32, Alex Reynolds wrote:

I tried [targetWindow release] and I get the same crash.
I have also tried:
[targetWindow setReleasedWhenClosed:YES];
when the targetWindow is allocated.
When I then try [targetWindow close], the first time I release my targetWindow it seems to work, but then when I allocate targetWindow again, it crashes with a type 11 error.

Are you sure that the problem is not somewhere else? You mention a "capture" button, sounds like you're using QuickTime? Are you sure that you've removed all references to your old window from other pieces of your code? The content view that you assign to your new windows - how is it created? Are you sure that it's not released and deallocated together with the first window?


I think only one targetWindow is being allocated, so I don't know why [targetWindow close] doesn't release that one object, so that the [NSWindow alloc] can run properly.

+[NSWindow alloc] doesn't care if you have other window instances or not - it will create a new window regardless.


Are there tools I can use to keep track of how many targetWindow objects there really are?

You mean "how many NSWindow instances". You can ask your NSApplication shared instance for a list of all windows in your application.


j o a r

Attachment: smime.p7s
Description: S/MIME cryptographic signature

 _______________________________________________
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

  • Follow-Ups:
    • Re: NSWindow alloc/dealloc problems
      • From: Alex Reynolds <email@hidden>
References: 
 >NSWindow alloc/dealloc problems (From: Alex Reynolds <email@hidden>)
 >Re: NSWindow alloc/dealloc problems (From: j o a r <email@hidden>)
 >Re: NSWindow alloc/dealloc problems (From: Alex Reynolds <email@hidden>)

  • Prev by Date: checking for line ending types
  • Next by Date: Re: NSWindow alloc/dealloc problems
  • Previous by thread: Re: NSWindow alloc/dealloc problems
  • Next by thread: Re: NSWindow alloc/dealloc problems
  • Index(es):
    • Date
    • Thread