• 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: becomeFirstResponder override issue
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: becomeFirstResponder override issue


  • Subject: Re: becomeFirstResponder override issue
  • From: Keary Suska <email@hidden>
  • Date: Mon, 2 Feb 2009 09:44:54 -0700


On Feb 2, 2009, at 8:44 AM, Chris Anderson wrote:

Thanks. And yes the controller has content. In my example below it returns 0 when inside becomeFirstResponder and returns > 0 when I activate detectPicker in the same application instance.

I was more interested in whether myArrayController is nil when - becomeFirstResponder is called. The NSLog below won't tell you that, so I wasn't sure if you specifically checked for nil.


On 2-Feb-09, at 7:40 AM, Keary Suska wrote:


On Feb 1, 2009, at 10:32 PM, Chris Anderson wrote:

I've created a subclass of NSDatePicker to catch when a date picker has focus. I have overridden the becomeFirstResponder method and indeed it detects when it has focus. The code inside the method does work except for any IBOutlets that I may have connected. They don't respond to any requests.

I have verified that the IBOutlets are connected by adding a separate IBAction in the subclass and a simple button to invoke the action. Inside the IBAction I can call the same IBOutlets successfully.

I am baffled as to why when the IBOutlets are inside becomeFirstResponder they don't seem connected. Example below...

-(BOOL)becomeFirstResponder // myArrayController will not respond
{ NSLog(@"DetectDatePicker:firstResponder: %i", [[myArrayController arrangedObjects] count]);
return YES;
}
-(IBAction)detectPicker:(id)sender // myArrayController successfully responds
{ NSLog(@"DetectDatePicker:performClick: %i",[[myArrayController arrangedObjects] count]);
}


Have you checked whether myArrayController is nil, just whether it has content? Those would likely be two separate issues...



Keary Suska
Esoteritech, Inc.
"Demystifying technology for your home or business"

_______________________________________________

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: becomeFirstResponder override issue
      • From: Chris Anderson <email@hidden>
References: 
 >becomeFirstResponder override issue (From: Chris Anderson <email@hidden>)
 >Re: becomeFirstResponder override issue (From: Keary Suska <email@hidden>)
 >Re: becomeFirstResponder override issue (From: Chris Anderson <email@hidden>)

  • Prev by Date: Re: GUI threading question
  • Next by Date: Re: Questions regarding programming custom visual components
  • Previous by thread: Re: becomeFirstResponder override issue
  • Next by thread: Re: becomeFirstResponder override issue
  • Index(es):
    • Date
    • Thread