ios - How to create variable for segue name? -


If I have many segues from one view controller to another, then there is a way to assign your identifier to a variable So that the variable should be referred as, as shown below?

  - (void) Prepare ForSegue: (UIStoryboardSegue *) Sender from: (ID) Sender {NSLog (@ "% @", segue identifier); If (if the name of the identifier is changed) I like it if ([segue.identifier is EqualToString: @ "someSegueName"]) {// push to see controller}}   

This will update the variable assignment.

I have not met surprisingly, why are you trying to do this? You can try under logic if it is appropriate for you.

You can try enum with strings for that string values ​​and identifiers for different segments.

Use the array and accordingly

Another method would be to create a constant for each identifier.

Comments

Popular posts from this blog

Pass DB Connection parameters to a Kettle a.k.a PDI table Input step dynamically from Excel -

multithreading - PhantomJS-Node in a for Loop -

c++ - MATLAB .m file to .mex file using Matlab Compiler -