> the -> operator is the same operator as it is in C, it dereferences a
> pointer, and then accesses a value from a struct/union:
I'm sorry.. I am afraid I don't really understand what any of that means...
Dereferences a pointer? So-- meaning when I do:
Foo *foo = [[Foo alloc] init];
I can somehow do "->" on foo and it will no longer be connected to the type
I still don't quite get struct/unions -- I mean, I get their 'text book
definition'. But I don't get their practical usage... When to use them, why,
etc.. It seems like if they are only data storage, why not use an array /
dictionary? What is the real benefit?
Patrick J. Collins
On Fri, 2 Jul 2010, Thomas Davie wrote:
> On 2 Jul 2010, at 09:59, Patrick J. Collins wrote:
> > Hi everyone,
> > I was looking over an article on properties:
> > http://www.cocoacast.com/?q=node/103
> > and I noticed the notation "->", which I am a bit unfamiliar with. It looks as
> > though it is a way to access the getter method from an object such as:
> > instance->property_name
> > Atleast, that's what I think is going on.. I have always done this as:
> > [instance property_name]
> > .. However, I tried doing the -> way in a test command-line tool and when I
> > did, I got a warning that an instance variable was protected and it will be a
> > hard failure in the future..
> > So obviously I am not understanding exactly what "->" is... From that error,
> > it seems like it's just a way to access an instance variable from within an
> > class----- but... why would you need to do self->var_name ? you should just be
> > able to do var_name by itself.. Right?
Do not post admin requests to the list. They will be ignored.
Objc-language mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden