• 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: Binding problem
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Binding problem


  • Subject: Re: Binding problem
  • From: Tackel <email@hidden>
  • Date: Thu, 20 Jan 2005 22:31:16 +0100

Hi Mmalc,

I wanted to avoid adding any outlet i thought it would be simpler getting the info from the (id)object passed to addObject method but this object is always empty I cannot get any info from it. Do you know why it is empty?

Many thanks for your quick answer,
Tackel


On 20/01/2005, at 21:52, mmalcolm crawford wrote:


On Jan 20, 2005, at 10:24 AM, Tackel wrote:

Working with bindings I have a textField and button that adds the string in the textField to my ArrayController. That's working fine but when I override addObject method because i need to make some actions with the string (object) that is going to be added to the ArrayController I don't know how to do it, can't I get it from the object passed to the addObject method?
- (void)addObject:(id)object
{
?????
[super addObject: object];
}


I'm afraid it's not clear to me what you're asking. The 'object' parameter to the addObject: method above is the new object that will be added to your array (an instance of whatever is defined as the "Object Class Name" for your array controller). In addObject: you can modify the new object however you wish. You might also, though, consider overriding newObject instead. This method is called for both addObject: and insertObject:. If you need to retrieve information from your user interface to initialise your object, simply add outlets to your controller subclass, just as you would any other controller object.

mmalc

_______________________________________________
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


_______________________________________________ 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: Changing NSArrayControllers add: action (was: Binding problem)
      • From: Tim Lucas <email@hidden>
    • Re: Binding problem
      • From: mmalcolm crawford <email@hidden>
References: 
 >Binding problem (From: Tackel <email@hidden>)
 >Re: Binding problem (From: mmalcolm crawford <email@hidden>)

  • Prev by Date: Re: Is there any support in Cocoa for stupidly encoded UTF-8 string?
  • Next by Date: Re: Is there any support in Cocoa for stupidly encoded UTF-8 string?
  • Previous by thread: Re: Binding problem
  • Next by thread: Re: Binding problem
  • Index(es):
    • Date
    • Thread