Re: objectifying a struct
Re: objectifying a struct
- Subject: Re: objectifying a struct
- From: Keith Ray <email@hidden>
- Date: Sun, 5 Feb 2006 06:25:07 -0800
Thanks!
On 2/4/06, Daniel Jalkut <email@hidden> wrote:
> Keith - you can declare a public section in your ObjC class and then access
> them "C-style." Just stick a "@public" at the beginning of your interface.
> The strategy will basically be the same as you described for C++:
>
> @interface MyObject : NSObject
> {
> @public
> int myYuckyPublicIVar;
> }
>
>
> Now you can do this:
>
> MyObject* yuckyObj = [[MyObject alloc] init];
> yuckyObj->myYuckyPublicIVar = 666;
>
> Daniel
>
> On Feb 4, 2006, at 7:37 PM, Keith Ray wrote:
>
>
> It seems like changing the "struct" declaration to an "interface"
>
> declaration immediately breaks a lot of code because the member
>
> variables immediately become private, but it has to be done earlier
>
> than in C++, in order to declare "init" and other methods.
>
--
C. Keith Ray
<http://homepage.mac.com/keithray/blog/index.html>
<http://homepage.mac.com/keithray/xpminifaq.html>
<http://homepage.mac.com/keithray/resume2.html>
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden