Re: Should I be trying to use bindings for this?
Re: Should I be trying to use bindings for this?
- Subject: Re: Should I be trying to use bindings for this?
- From: Paul Bruneau <email@hidden>
- Date: Wed, 3 Oct 2007 16:32:45 -0400
On Oct 3, 2007, at 3:36 PM, Erik Buck wrote:
I am in the middle of my own journey to using Bindings, but I have
some questions for you. Your answers might solve your problem.
1) Why do you insist on pointer comparison for OperationTypes
instances. Why not inplement -compare: and test for equality of
two OperationTypes instances with compare:? Then it doesn't matter
if theye are different instances or not if the compare as
NSOrderedSame.
That approach seems reasonable to me, I considered something similar
but was lured in by the simplicity of the NSArray containsObject:
method and it just seemed clean and nice. It is probably better for
me to use something like an INT operation code in the operationType
object and compare that so that I'm not so reliant on the exact
operationType object always being in existence for things to work.
2) Why don't you just write [workCentersArrayController
valueForKeyPath: @"selection.operationTypes"]. Assuming that the
selected WorkCenter instance actually has an array instance
variable called "operationTypes", the above code should retrun that
array as an NSArray. Whatever is in the returned NSArray is what
is in the instance variable, so if the OperationTypes instances
have unexpected pointer values, the problem occured when the array
was filled and not when it was returned.
My problem wasn't with accessing the information from code, I was OK
in that respect. My problem was with the interface and the binding.
Thanks for writing!
_______________________________________________
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