From 48234265991dd8ba8e26bd1fa7ea296a9f192ce9 Mon Sep 17 00:00:00 2001 From: Vitaly Takmazov Date: Wed, 6 Dec 2017 23:31:30 +0300 Subject: refactor --- Juick/ViewControllers/DiscoverViewController.m | 14 ++------------ 1 file changed, 2 insertions(+), 12 deletions(-) (limited to 'Juick/ViewControllers') 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]]; } } -- cgit v1.2.3