Skip to content

Instantly share code, notes, and snippets.

@shto
Last active August 29, 2015 13:57
Show Gist options
  • Save shto/9549594 to your computer and use it in GitHub Desktop.
Save shto/9549594 to your computer and use it in GitHub Desktop.
main method for demonstrating copy awesomeness
#import "ShoppingCart.h"
int main(int argc, const char * argv[])
{
@autoreleasepool {
ShoppingCart *cart = [[ShoppingCart alloc] init];
cart.couponCode = @"1235AB1";
NSMutableArray *items = [[NSMutableArray alloc] init];
[items addObjectsFromArray:@[@"Book", @"Guitar", @"Sweater", @"Coffee Pot"]];
cart.items = items;
NSLog(@"Our Items before removing: %@", items);
NSLog(@"Cart Items before removing: %@", cart.items);
[items removeObjectAtIndex:1];
NSLog(@"Our Items after removing: %@", items);
NSLog(@"Cart Items after removing: %@", cart.items);
}
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment