D/Objective-C, extern (Objective-C)

Steven Schveighoffer schveiguy at yahoo.com
Mon Jun 24 11:33:29 PDT 2013


On Mon, 24 Jun 2013 14:25:40 -0400, Walter Bright  
<newshound2 at digitalmars.com> wrote:

> On 6/24/2013 11:03 AM, Steven Schveighoffer wrote:
>> All data members in Objective-C are private.  So the object can control  
>> when it
>> gives out this data, and take appropriate actions.  AFAIK, ARC does not  
>> worry
>> about internal pointers.
>
> Hmm, that's a good thought. (But recall that modules allow access to  
> private members.)
>

hehe, no I mean in Objective-C, instance variables are ALWAYS private.   
Unless you leak that address out to the world, nobody will be getting it.

Typically, you don't give out addresses to anything but Objective-C object  
members, which are themselves reference counted.  All member variables  
that are 'public' are accessed via properties.

If you do give out addresses to member variables, you have to be wary of  
this problem.

-Steve


More information about the Digitalmars-d-announce mailing list