Skip to content

Instantly share code, notes, and snippets.

@beelsebob
Last active December 12, 2015 02:18
Show Gist options
  • Select an option

  • Save beelsebob/4698128 to your computer and use it in GitHub Desktop.

Select an option

Save beelsebob/4698128 to your computer and use it in GitHub Desktop.
@interface JAHFirstViewController : UIViewController // Note, JAH class prefix, you should prefix all of your classes
@property (nonatomic, strong) NSMutableArray *json; /* this property is named poorly – it's not json, it's an array */
@end
// @synthesize json; <- this is completely unnecessary
- (void)doSomething
{
SecondViewController *secondViewController = [[SecondViewController alloc] init];
[secondViewController setSecondJSON:[self json]];
[[self navigationController] pushViewController:secondViewController animated:YES];
}
@interface JAHSecondViewController : UIViewController // Again, prefix your classes
@property (nonatomic, strong) NSMutableArray *secondJSON; // Again, this is named poorly, fix it!
@end
- (void)viewDidLoad
{
[super viewDidLoad];
NSLog(@"%@", [self secondJSON]);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment