diff options
Diffstat (limited to 'Juick/ViewControllers')
-rw-r--r-- | Juick/ViewControllers/DiscoverViewController.m | 14 |
1 files changed, 2 insertions, 12 deletions
diff --git a/Juick/ViewControllers/DiscoverViewController.m b/Juick/ViewControllers/DiscoverViewController.m index 3c473d5..f5d362f 100644 --- a/Juick/ViewControllers/DiscoverViewController.m +++ b/Juick/ViewControllers/DiscoverViewController.m @@ -18,17 +18,6 @@ @implementation DiscoverViewController -AppDelegate *appDelegate; - --(void) awakeFromNib { - [super awakeFromNib]; - appDelegate = (AppDelegate *)[UIApplication sharedApplication].delegate; - if (appDelegate.pushedThread != nil) { - [self performSegueWithIdentifier:@"threadViewSegue" sender:self]; - } -} - - -(void) tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath { NSString * cellIdentifier = @"messageCell"; MessageCell *cell = [tableView dequeueReusableCellWithIdentifier:cellIdentifier forIndexPath:indexPath]; @@ -38,6 +27,7 @@ AppDelegate *appDelegate; -(void) prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender { if ([segue.identifier isEqual: @"threadViewSegue"]) { NSNumber *mid; + AppDelegate *appDelegate = (AppDelegate *) [UIApplication sharedApplication].delegate; if (appDelegate.pushedThread != nil) { mid = appDelegate.pushedThread; } else { @@ -46,7 +36,7 @@ AppDelegate *appDelegate; } ThreadViewController *threadVC = (ThreadViewController *)segue.destinationViewController; [threadVC setPath:[APIClient threadUrl]]; - [threadVC setParams:[NSMutableDictionary dictionaryWithObjectsAndKeys:mid, @"mid", nil]]; + [threadVC setParams:[@{@"mid": mid } mutableCopy]]; } } |