Skip to content

Instantly share code, notes, and snippets.

@william8th
Created November 19, 2015 14:22
Show Gist options
  • Save william8th/86a010f335d9431a8933 to your computer and use it in GitHub Desktop.
Save william8th/86a010f335d9431a8933 to your computer and use it in GitHub Desktop.
Objective-C @Property dot syntax
#import "WHYPerson.h"
...
@implmentation WHYPerson
...
- (NSString *)doSomething {
return [NSString stringWithFormat:@"Hello, %@", [self firstName]];
// Can also be done using dot syntax as it's just a wrapper around [self firstName]
// This works too:
// return [NSString stringWithFormat:@"Hello, %@", self.firstName];
}
...
@end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment