How to send an NSString to another view controller

后端 未结 4 1903
时光说笑
时光说笑 2020-12-22 11:20

I have an IBAction that when triggered calls another method in a different view controller ( APICallsViewController). I\'m looking to also send that method an NSString (m

4条回答
  •  一生所求
    2020-12-22 12:08

    Why do you want to pass the String programmatically, instead of declaring a function parameter? You could change the Function to something like

    - (void) apiGraphUserCheckins:(NSString *)message;
    

    call it with

    [apiViewController apiGraphUserCheckins:[NSString stringWithFormat:@"Check out %@", nameLb.text]]; 
    

提交回复
热议问题