Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8473657
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T17:24:42+00:00 2026-06-10T17:24:42+00:00

I am new to IOS programming. So far I have been programming in android.

  • 0

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.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-10T17:24:44+00:00Added an answer on June 10, 2026 at 5:24 pm

    Declare an iVar for your UIViewController ( Android’s Activity) like a property in Java.

    In MainViewController.m

    OtherUIViewController * contr = [[OtherUIViewController alloc] initWithNibname...];
    contr.data = yourData;
    

    Edited: added full code…

    Intent i = new Intent(MainScreen.this,OtherScreen.class);
    Bundle b = new Bundle();
    b.putString(“data_1”,data);

    here the MainScreen is the calling code, now in iOS it will be the MainUIViewcontroller

    • create a OtherUIViewController like this:

    OtherUIViewController.h

    @interface OtherUIViewController : UIViewController
    {
           NSData* data;
    }
    @property (strong, nonatomic) NSData* data;
    

    in the OtherUIViewController.m

    @implementation OtherUIViewController.m
    @synthetize data;
    
    // override
    - (void)viewDidLoad
    {
        [super viewDidLoad];
    // do something with data here
    }
    

    to have the 3 different behaviors, the data can be an int, or an NSString.
    And in the - (void)viewDidLoad you will check the data value and do 3 diff things.

    I hope it helps

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am very new to iOS Programming and have been learning for only a
I'm a new iOS programming and I'm developing a simple iPhone game that needs
I am new to iOS programming. I see that there are functions defined in
I am new to iOS 5 programming so I'm sure that these are basic
I'm new to iOS programming and I am working on a easy project that
I'm fairly new to iOS programming, but have a basic understanding of it. I
I'm very new to IOS programming and i have doubt with NSThread. My problem
I'm new to iOS programming, I have a project going on and along with
I'm new to iOS programming and being the organizational freak that I am, I'd
I'm fairly new to iOS programming and I'm working on an iPad app that

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.