Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Releasing an NSWindow without destroying the underlying Carbon windowRef?




On May 5, 2005, at 10:30 AM, Jonathan del Strother wrote:

I'm creating an NSWindow using initWithWindowRef, and passing in the windowRef of the iTunes window.

This is so I can query some properties of the screen that the iTunes window is on from my Cocoa code.

Once I've finished with it, I need to release it, but doing so appears to destroy the iTunes window in a rather nasty crash.
I've tried just not releasing it - However, I'm having some odd problem where iTunes stops responding to button presses, and I believe that this is the cause.


How can I relinquish Cocoa's hold on the window without actually destroying it?

Creating a Cocoa window within a Carbon app like iTunes (that is, a Carbon app that you're not in control of) is a tricky business. What do you want to find out that you can't get from NSScreen, or NSGraphicsContext?


-jcr


John C. Randolph <email@hidden> (408) 974-8819 Sr. Cocoa Software Engineer, Apple Worldwide Developer Relations http://developer.apple.com/cocoa/index.html



_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/email@hidden

This email sent to email@hidden
References: 
 >Releasing an NSWindow without destroying the underlying Carbon windowRef? (From: Jonathan del Strother <email@hidden>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.