Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 4609154
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T00:56:48+00:00 2026-05-22T00:56:48+00:00

So what I’m trying to do is when you click view on receiving a

  • 0

So what I’m trying to do is when you click view on receiving a push notification when the app opens it has the presented view push a new controller with details regarding the notification. I’m using a UITabBarController with UINavigationControllers. Any help would be much appreciated, I’ve tried searching but I couldn’t seem to find anything that pointed me in the right direction. Current code below:

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
[[UIApplication sharedApplication] registerForRemoteNotificationTypes:(UIRemoteNotificationTypeAlert | UIRemoteNotificationTypeSound)];

[application setStatusBarStyle:UIStatusBarStyleBlackOpaque];

tabBarController = [[UITabBarController alloc] init];

controller = [[controller alloc] init];
UINavigationController *controller1 = [[[UINavigationController alloc] initWithRootViewController:controller] autorelease];
controller1.tabBarItem.image = [UIImage imageNamed:@"icon_news.png"];
[controller setTitle:@"View"];
[controller release];

controller = [[controller alloc] init];
UINavigationController *controller2 = [[[UINavigationController alloc] initWithRootViewController:controller] autorelease];
controller2.tabBarItem.image = [UIImage imageNamed:@"icon_news.png"];
[controller setTitle:@"View"];
[controller release];

controller = [[controller alloc] init];
UINavigationController *controller3 = [[[UINavigationController alloc] initWithRootViewController:controller3] autorelease];
controller3.tabBarItem.image = [UIImage imageNamed:@"icon_news.png"];
[controller setTitle:@"View"];
[controller release];

controller = [[controller alloc] init];
UINavigationController *controller4 = [[[UINavigationController alloc] initWithRootViewController:controller] autorelease];
controller4.tabBarItem.image = [UIImage imageNamed:@"icon_news.png"];
[controller setTitle:@"View"];
[controller release];

controller = [[controller alloc] init];
UINavigationController *controller5 = [[[UINavigationController alloc] initWithRootViewController:controller] autorelease];
controller5.tabBarItem.image = [UIImage imageNamed:@"icon_news.png"];
[controller setTitle:@"View"];
[controller release];

tabBarController.viewControllers = [NSArray arrayWithObjects:controller1, controller2, controller3, controller4, controller5, nil];

[window addSubview:tabBarController.view];

[window makeKeyAndVisible];

launchDefault = YES;
//[self performSelector:@selector(handlePostLaunch) withObject:nil afterDelay:0];

// Push Notification info

NSDictionary *apns = [launchOptions objectForKey:UIApplicationLaunchOptionsRemoteNotificationKey];

NSString *result =  [[[apns valueForKey:@"aps"] valueForKey:@"alert"] valueForKey:@"loc-args"];

NSString *playerID = [NSString stringWithFormat:@"%@", result];

playerID = [[playerID componentsSeparatedByCharactersInSet:[NSCharacterSet newlineCharacterSet]] componentsJoinedByString:@""];

playerID = [playerID stringByReplacingOccurrencesOfString:@"  " withString:@""];

playerID = [playerID stringByReplacingOccurrencesOfString:@"(" withString:@""];

playerID = [playerID stringByReplacingOccurrencesOfString:@")" withString:@""];

NSLog(@"Player ID: %@", playerID);

if (![playerID isEqualToString:@"null"]) {
    if (!detailViewController) {
        detailViewController = [[PlayerDetailViewController alloc] init];
    }

    NSManagedObjectContext *moc = [[AppController sharedAppController] managedObjectContext];

    NSFetchRequest *req = [[NSFetchRequest alloc] init];

    NSEntityDescription *entity = [NSEntityDescription entityForName:@"Players"
                                              inManagedObjectContext:moc];
    [req setEntity:entity];

    NSPredicate *pre = [NSPredicate predicateWithFormat:@"playerID=%@", playerID];
    [req setPredicate:pre];

    NSError *error;
    NSArray *list = [moc executeFetchRequest:req error:&error];

    [req release];

    Players *player = [list lastObject];

    [detailViewController setPlayer:player];

    //Want to Push view here

    [detailViewController release];

    detailViewController = nil;
}

return YES;

}

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-22T00:56:49+00:00Added an answer on May 22, 2026 at 12:56 am

    If application is launched by a notification then it will be present in the application delegate’s application:didFinishLaunchingWithOptions: launchOptions dictionary under the key UIApplicationLaunchOptionsRemoteNotificationKey, which has all the info the notification has (JSON converted to NSDictionary I believe).

    EDIT:

    Got the question wrong, I think what you’re looking for is just the pointer to the currently selected navigation controller. You get that if you query [tabbarcontroller selectedViewController], which returns the visible navigation controller. Then simply push the newly created controller on top of the stack of that navigation controller.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Basically, what I'm trying to create is a page of div tags, each has
I'm parsing an RSS feed that has an ’ in it. SimpleXML turns this
I am trying to understand how to use SyndicationItem to display feed which is
I'm new to using the Perl treebuilder module for HTML parsing and can't figure
link Im having trouble converting the html entites into html characters, (&# 8217;) i
That's pretty much it. I'm using Nokogiri to scrape a web page what has
I want to count how many characters a certain string has in PHP, but
I've got a string that has curly quotes in it. I'd like to replace
I want use html5's new tag to play a wav file (currently only supported
We're building an app, our first using Rails 3, and we're having to build

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.