• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: objectifying a struct
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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

References: 
 >objectifying a struct (From: Keith Ray <email@hidden>)
 >Re: objectifying a struct (From: Daniel Jalkut <email@hidden>)

  • Prev by Date: RV: first steps
  • Next by Date: Re: RV: first steps
  • Previous by thread: Re: objectifying a struct
  • Next by thread: Starting in Cocoa and a bit lost !
  • Index(es):
    • Date
    • Thread