passing parameter to view in IOS after a button is pressed

Posted by ghostrider on Stack Overflow See other posts from Stack Overflow or by ghostrider
Published on 2012-09-03T20:22:47Z Indexed on 2012/09/03 21:38 UTC
Read the original article Hit count: 200

Filed under:
|

I am new to IOS programming. So far I have been programming in android. So in android when pressing a button code for passing an argument would be like that:

Intent i = new Intent(MainScreen.this,OtherScreen.class);
Bundle b = new Bundle();
b.putString("data_1",data);
i.putExtras(b);
startActivity(i);

and on the activity that opens, i would write something like this:

Bundle b = getIntent().getExtras();
ski_center=b.getString("data_1");

what methods should I need to change in MainScreen and in OtherScreen in IOS to achieve the above.

Basically I will have 3 buttons lets say in my MainScreen and each of it will open the Otherview but each time a different parameter will be passed.

Foe example for each button i have code like these in MainScreen.m

@synthesize fl;
-(IBAction) ifl:(id) sender {
}

So I need your help in where to place the "missing" code, too.

© Stack Overflow or respective owner

Related posts about ios

Related posts about xcode