Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What does the -> mean in objective C

Can Anyone explain what this means:

oauth->url = [[NSURL alloc] initWithScheme:@"https" host:host path:unencodedPath];

It is variable assignment but why does it use '->' is this something to do with it being a Class method?

like image 579
Codr Avatar asked Jul 04 '11 12:07

Codr


People also ask

What does -> represent in C?

An Arrow operator in C/C++ allows to access elements in Structures and Unions. It is used with a pointer variable pointing to a structure or union. The arrow operator is formed by using a minus sign, followed by the greater than symbol as shown below. Syntax: (pointer_name)->(variable_name)

What does the -> operator do?

The -> (arrow) operator is used to access class, structure or union members using a pointer. A postfix expression, followed by an -> (arrow) operator, followed by a possibly qualified identifier or a pseudo-destructor name, designates a member of the object to which the pointer points.

What does arrow mean in Objective-C?

Arrow operator on an Objective-C object (pointer) (at run time) Dereference pointer. Return value of the field.

What is the at symbol in Objective-C?

The @ symbol is used in a few places in Objective-C, and basically it's a way to signal that whatever it's attached to is special to Objective-C and not part of regular C. This is important when the computer compiles Objective-C code.


1 Answers

It references the instance variable url of the oauth instance. It is pure C syntax.

like image 57
Felix Avatar answered Oct 17 '22 00:10

Felix