diff options
author | Vitaly Takmazov | 2017-12-06 23:31:30 +0300 |
---|---|---|
committer | Vitaly Takmazov | 2017-12-06 23:31:30 +0300 |
commit | 48234265991dd8ba8e26bd1fa7ea296a9f192ce9 (patch) | |
tree | 9fc13790f32597d9ac06bf017cde1ccad03ff415 /Juick/ViewControllers/DiscoverViewController.m | |
parent | b8b49289ceb00255c689e4a373d6e116248b9c6b (diff) |
refactor
Diffstat (limited to 'Juick/ViewControllers/DiscoverViewController.m')
-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]]; } } |