Re: objectifying a struct
Re: objectifying a struct
- Subject: Re: objectifying a struct
- From: Daniel Jalkut <email@hidden>
- Date: Sat, 4 Feb 2006 20:19:24 -0500
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.
_______________________________________________
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