Skip to content

Instantly share code, notes, and snippets.

@mchirico
Created March 11, 2012 12:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mchirico/2016239 to your computer and use it in GitHub Desktop.
Save mchirico/2016239 to your computer and use it in GitHub Desktop.
prepareForSegue Template
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender
{
if ([segue.identifier hasPrefix:@"Create Label"]) {
AskerViewController *asker = (AskerViewController *)segue.destinationViewController;
asker.question = @"What";
asker.delegate = self;
}
// This is really cool.
if ([segue.identifier hasPrefix:@"Segue Table0"]) {
NSLog(@"Going to table");
SqliteDoer *sD = [ [SqliteDoer alloc] init];
[sD setPath];
//[sD drop: 0];
[sD create: 0];
[sD query: 0];
[sD pr];
NSMutableArray * n = [[NSMutableArray alloc] initWithObjects:nil];
[sD pr: n];
[segue.destinationViewController setDataArray:n];
/* //Here's a basic example
NSMutableArray *dataArray;
dataArray = [[NSMutableArray alloc] init ];
[dataArray addObject:@"brown"];
[dataArray addObject:@"red"];
[dataArray addObject:@"green"];
[dataArray addObject:@"yellow"];
[segue.destinationViewController setDataArray:dataArray];
*/
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment