I have a new view controller that gets instantiated from the app delegate when a push notification is received. In the view controller's header file, I have an NSDictionary created, and I set it the value of the dictionary to be the userInfo in the app delegate's didReceiveRemoteNotification.
The dictionary is being populated with the userInfo, but none of the labels are appearing. I know this because I logged it in the view controller. The problem, is that the view is completely blank.
I tried changing a bunch of things around, like using viewDidLoad, viewDidAppear, viewWillAppear, but none have helped.
Here is the code
-(void)viewDidAppear:(BOOL)animated
{
[super viewDidAppear:NO];
NSLog(@"VIEW DID Appear");
NSLog(@"TDICTIONARY: %@", tDictionary);
self.taskAddress.text = [tDictionary objectForKey:@"address"];
NSLog(@"Address: %@", [tDictionary objectForKey:@"address"]);
self.taskName.text = [tDictionary objectForKey:@"task"];
NSLog(@"Name: %@", [tDictionary objectForKey:@"task"]);
...
I've been pulling my hair out trying to figure this out, so any help would be great appreciated!
Edit the following is the code that instantiates the view. I do not think this is the issue, because the dictionary is being passed to the view controller (I know this because I logged it from the view controller), but I very well could be wrong about that.
let storyboard = UIStoryboard(name: "Main", bundle: nil)
self.window = UIWindow(frame: UIScreen.mainScreen().bounds)
self.window!.rootViewController = remoteViewController()
let vc = storyboard.instantiateViewControllerWithIdentifier("remoteViewController") as remoteViewController
vc.tDictionary = userInfo
println("DICTIONARY \(vc.tDictionary)")
self.window!.makeKeyAndVisible()
println("VIEW CONTROLLER \(vc)")
self.window!.rootViewController!.presentViewController(vc, animated: false, completion:
{() -> Void in println("new view")
})
Edit 2 I disconnected the labels and the labels with the text "label" show up on the view. When I reconnected them, they went blank again. Only more convinced now that this has to do with viewDidAppear.