Re: How to call on id
Re: How to call on id
- Subject: Re: How to call on id
- From: Graham Cox <email@hidden>
- Date: Thu, 25 Feb 2010 14:40:57 +1100
On 25/02/2010, at 2:31 PM, David Blanton wrote:
> I have an ivar tyoed as id as
>
> id m_view
>
> at some point m_view gets set to a particular view
>
> I would like to send messages to m_view as [m_view selector] but since it is not typed I get the message
>
> 'struct objc_object' has no member named 'selector'
>
> How does one work with / around this issue?
Type it as NSView* ?
In general type id should only be used when you have no other choice. Mostly you should strongly type wherever possible. Is there some reason you think you need to use type id here?
--Graham
_______________________________________________
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