Re: Synthesized ivar for std::tr1::shared_ptr<MyClass>?
Re: Synthesized ivar for std::tr1::shared_ptr<MyClass>?
- Subject: Re: Synthesized ivar for std::tr1::shared_ptr<MyClass>?
- From: Barry Wark <email@hidden>
- Date: Fri, 7 May 2010 16:25:33 -0700
On Fri, May 7, 2010 at 12:37 PM, Greg Parker <email@hidden> wrote:
> On May 7, 2010, at 12:33 PM, Kyle Sluder wrote:
>> On Fri, May 7, 2010 at 12:29 PM, Greg Parker <email@hidden> wrote:
>>> Is there some reason why you can't declare your instance variables explicitly, and tell @synthesize to use that ivar in the synthesized accessor methods?
>>
>> He's trying to keep C++ out of his ObjC headers.
>
> In that case, just stick an #ifdef __cplusplus around the instance variable declarations. Your non-C++ files won't see the ivars, but the non-fragile ivar support in the modern runtime means that they don't have to. It won't work on 32-bit Mac, but automatically synthesized ivars don't work there either.
Yes! That's the ticket. I hadn't realized that the runtime still
provided non-fragile ivar support even when you explicitly declared
the ivar. Leave it to the runtime guru. Thanks, Greg.
-Barry
>
>
> --
> Greg Parker email@hidden Runtime Wrangler
>
>
>
_______________________________________________
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