• 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: Cmd+key shortcuts not being sent to NSWindow on Tiger
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Cmd+key shortcuts not being sent to NSWindow on Tiger


  • Subject: Re: Cmd+key shortcuts not being sent to NSWindow on Tiger
  • From: Kirk Swenson <email@hidden>
  • Date: Mon, 10 Aug 2009 23:47:35 -0700


On Aug 10, 2009, at 11:04 PM, Uli Kusterer wrote:

On Aug 8, 2009, at 3:30 AM, Kirk Swenson wrote:

- (id) windowWillReturnFieldEditor: (NSWindow*) aWindow toObject: (id) anObject
{
// myTextFieldEditor is a member variable, so there will only be one of them.
if( myTextFieldEditor == nil) {
myTextFieldEditor = [[MyTextView alloc] init];

Isn't that missing an autorelease? Or is this documented as an exception somewhere? Looks like you're leaking a text view each time this is called.

As the comment suggests, myTextFieldEditor is an instance variable. It's released in the dealloc method. It's worth pointing out that according to the documentation, "This method may be called multiple times while a control is first responder. Therefore, you must return the same field editor object for the control while the control is being edited." In other words, the pointer has to be cached -- creating a new one on every call would violate the requirements of the method.


Kirk Swenson
Senior Software Engineer
KCP Technologies

_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please 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


  • Follow-Ups:
    • Re: Cmd+key shortcuts not being sent to NSWindow on Tiger
      • From: Uli Kusterer <email@hidden>
References: 
 >Re: Cmd+key shortcuts not being sent to NSWindow on Tiger (From: Kirk Swenson <email@hidden>)
 >Re: Cmd+key shortcuts not being sent to NSWindow on Tiger (From: Uli Kusterer <email@hidden>)

  • Prev by Date: Re: System Sound, and Audio Services [solved more] (was: NSSound play often fails)
  • Next by Date: Re: Testing if a NSPipe has available data
  • Previous by thread: Re: Cmd+key shortcuts not being sent to NSWindow on Tiger
  • Next by thread: Re: Cmd+key shortcuts not being sent to NSWindow on Tiger
  • Index(es):
    • Date
    • Thread