Unrecognized selector sent to instance using Storyboards

前端 未结 3 1441
既然无缘
既然无缘 2020-12-25 14:43

I\'m using storyboard for an iOS application, my storyboard looks like this: http://d.pr/7yAY (droplr url)

The problem is when I click the login button, I send the u

3条回答
  •  猫巷女王i
    2020-12-25 15:18

    Your segue's destination view controller is your Navigation Controller, not your Events Table View controller.

    You can get the Events controller by accessing the Navigation controller's topViewController property.

    Try this:

    UINavigationController *navController = (UINavigationController*)[segue destinationViewController];
    EventsTableViewController *eventsController = [navController topViewController];
    
    NSString * username = [[NSString alloc] initWithFormat:@"%@", username_tf.text];
    [eventsController setUsername:username];
    

提交回复
热议问题