Re: Cocoa-dev Digest, Vol 3, Issue 1396
Re: Cocoa-dev Digest, Vol 3, Issue 1396
- Subject: Re: Cocoa-dev Digest, Vol 3, Issue 1396
- From: Gorazd Krosl <email@hidden>
- Date: Sun, 26 Nov 2006 08:11:29 -0500 (EST)
Hi Daniel,
I think you will need to use NSDictionary for that. I
remember seeing that somewhere in docs. Yes, it is an
inconveniance.
Gorazd
------------------------
Hi. I asked this question on the Quartz Composer list,
but no one
answered, o I figured I would ask here.
I want to make some data available from my Cocoa
application to a
Quartz composition that will render the view. The data
consists of an
array of objects of a custom class, something like:
@interface CustomObject : NSObject {
NSString *name;
NSImage *image;
}
- (NSString *)name;
- (NSImage *)image;
@end
On my composition, I declared a root input for the
structure. It
receives an NSArray of CustomObjects, so it works fine
and I can get
any object using the Structure Index Member patch. The
problem is to
extract data from the resulting CustomObject. I tried
using the
"Structure Key Member" patch with key "name" to
extract the name, but
I get blank. How does that patch work? What method is
it calling, if
any? I would expect it to call valueForKey:@"name" on
my custom
object, which in turn would call the "- name" method,
but that
doesn't seem to be the case.
Any ideas? Would the only option be to implement my
CustomObject as
an NSMutableDictionary? I don't want the model design
be influenced
by restrictions of the view.
Thanks,
Daniel
__________________________________________________
Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around
http://mail.yahoo.com
_______________________________________________
Cocoa-dev mailing list (email@hidden)
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