Re: Connecting Outlet on Derived Array Controller
Re: Connecting Outlet on Derived Array Controller
- Subject: Re: Connecting Outlet on Derived Array Controller
- From: Joanna Carter <email@hidden>
- Date: Mon, 1 Mar 2010 19:00:29 +0000
Hi Quincey
> You want to "pass a property"? What does that mean? Never mind -- it's clear from your second paragraph that you mean "pass a value". I'm rudely pointing this out because using precise terms precisely is important, and you've led yourself astray multiple times in this thread by using them imprecisely.
Hey, I'm an experienced consultant who is also a member of TeamB (which is the techie/wizzy bunch who support Borland/Inprise/CodeGear/Embarcadero products. I have a brain the size of a planet and you still expect me to make cogent sense of the English language? <vbg>
> The classy version is only slightly more complicated:
>
> -- Define a protocol. Call it (say) extraPropertyProviderProtocol. The protocol contains just one thing, the "extraProperty" property definition.
>
> -- Have your window controller formally adopt the protocol. (It already implements it.)
>
> -- Declare your custom array controller outlet as IBOutlet NSObject<extraPropertyProviderProtocol>* extraPropertyProvider.
>
> -- Connect the outlet to File's Owner, as before.
>
> -- In your custom array controller's awakeFromNib method, do the following:
>
> myExtraProperty = extraPropertyProvider.extraProperty;
>
> That way, File's Owner isn't unnecessarily constrained to be a particular class of object. It can be any object that conforms to the protocol.
Doh!!! In non-Objective-C words, declare an interface and use that to surface the property/value on the main controller. Thank you so much for making a middle-aged woman happy ;-)
Having designed my own MVP and OPF frameworks for .NET, I'm still making the transition to Mac development. The biggest hurdle is just the shear size of the Cocoa frameworks. Oh, and getting used to the "dynamic" nature of Objective-C.
Can I just indulge by asking whether the protocol, in this situation, would best be formal or informal?
Joanna
--
Joanna Carter
Carter Consulting
_______________________________________________
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