Accessing properties of a generic class
Accessing properties of a generic class
- Subject: Accessing properties of a generic class
- From: John Murphy <email@hidden>
- Date: Wed, 20 Aug 2008 19:54:09 -0700 (PDT)
I have a Person class with name and image properties stored in an array. When I access its properties from within the controller class like this:
Person *person = [objectArray objectAtIndex:0];
[nameField setStringValue:person.name];
[imageArea setImage:person.image];
everything works fine. But when I try to do it generically:
id object = [objectArray objectAtIndex:0];
[nameField setStringValue:object.name];
[imageArea setImage:object.image];
I get errors about the name and image properties not being in a structure or union.
_______________________________________________
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