Hi Richard,

You can't bind to the individual members of your struct.

You could create a pair of accessor methods for the object containing the struct. These methods could return the values of the struct. For example:

@interface MyManagedObject : NSManagedObject {
        NSPoint origin;
}

- (CGFloat)originX;
- (CGFloat)originY;

@end

@implementation MyManagedObject

- (CGFloat)originX
{
        return origin.x;
}

- (CGFloat)originY
{
        return origin.y;
}

@end

You would then implement two + (NSSet *)keyPathsForValuesAffectingOrigin[X | Y] and return the keypath to your struct ivar.

Hope this helps,

Kiel

On 15/04/2009, at 2:49 PM, Richard Somers wrote:

I have a model object which is a subclass of NSManagedObject. This object has a transformable property similar to NSPoint.

The frameworks automatically wrap and unwrap my NSPoint like struct in an NSValue instance. I would like to bind the individual struct members x and y to elements of the user interface with a key path. I can not seem to figure out how to get this work or if it is even possible.

Any suggestions?

Richard

_______________________________________________

Cocoa-dev mailing list ([email protected])

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:
http://lists.apple.com/mailman/options/cocoa-dev/kiel.gillard%40gmail.com

This email sent to [email protected]

_______________________________________________

Cocoa-dev mailing list ([email protected])

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to [email protected]

Reply via email to