Skip to content

Instantly share code, notes, and snippets.

@DefV
Created February 27, 2012 13:59
Show Gist options
  • Save DefV/1923960 to your computer and use it in GitHub Desktop.
Save DefV/1923960 to your computer and use it in GitHub Desktop.
[[MyClass alloc] initWithItem:self.item]
@implementation MyClass
- (void) speak
{
NSLog(@"%@ costs %@", self.item.title, self.item.price);
}
// OR
[[MyClass alloc] initWithTitle:self.item.title andPrice:self.item.price]
@implementation MyClass
- (void) speak
{
NSLog(@"%@ costs %@", self.title, self.price);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment