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?
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)
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.
Arrow operator on an Objective-C object (pointer) (at run time) Dereference pointer. Return value of the field.
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.
It references the instance variable url
of the oauth
instance. It is pure C syntax.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With