Re: Accessing members from NSDictionary
Re: Accessing members from NSDictionary
- Subject: Re: Accessing members from NSDictionary
- From: Jens Alfke <email@hidden>
- Date: Fri, 05 Apr 2013 10:38:36 -0700
On Apr 5, 2013, at 7:03 AM, Pax <email@hidden> wrote:
> Ah, I see. I shall try that out. And, referring to my earlier question, would I be able to:
>
> [[device objectForKey:@"InformationWindowRef"].infoWindow cascadeTopLeftFromPoint:NSMakePoint(20,20)];
No, because -objectForKey: returns type id, i.e. a generic untyped object reference, but “.” syntax is strongly typed so it requires that the left-hand-side be an actual class that defines that property. Your choices are:
[[device objectForKey:@"InformationWindowRef”] infoWindow] ...
or
InfoWindowRef *ref = [[device objectForKey:@"InformationWindowRef”];
ref.infoWindow ...
—Jens
_______________________________________________
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