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 8221605
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T13:58:57+00:00 2026-06-07T13:58:57+00:00

I am creating a Rock Paper Scissors game in Objective-C and currently I’m having

  • 0

I am creating a Rock Paper Scissors game in Objective-C and currently I’m having an issue with bringing an integer from one View Controller to another.

I am using the utility application template and I am using the FlipsideViewController as an area to set the rounds in the best (Best out of 3, 5, 7, etc.). However, I am unable to bring that integer back to the MainViewController to put it in to use. I read through the other questions on this topic but couldn’t get it to work.

Here is the protocol in the FlipSideViewController.h file

 @class FlipsideViewController;
 @protocol FlipsideViewControllerDelegate
  - (void)addItemViewController: (FlipsideViewController *)controller didFinishEnteringItem: (int)rounds;
 @end

Here is the action that occurs when the button is pressed to finalize the amount of rounds

- (IBAction)submitBOO:(id)sender {
int rounds = 0;
rounds = _textField.text.intValue;

if (rounds % 2 ==0){ 
   _labelBOO.text = @"Pick an odd number!"; 

}   
else 
    [self.delegate addItemViewController:self didFinishEnteringItem:rounds];
}

The button in MainViewController.m that switches to FlipsideViewController

- (IBAction)beginGame:(id)sender {
FlipsideViewController *controller = [[FlipsideViewController alloc]    initWithNibName:@"FlipsideViewController" bundle:nil];


controller.delegate = self;
controller.modalTransitionStyle = UIModalTransitionStyleFlipHorizontal;
[self presentModalViewController:controller animated:YES];

}
  • 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-07T13:58:59+00:00Added an answer on June 7, 2026 at 1:58 pm

    Declaring a property for an int is different than declaring for an object like a NSNumber or NSString.

    All you need to do is to add this to your header:

    @property int someInt;
    

    and synthesize in your implementation. You do not need to release this property because it isnt a true object. It doesnt have any retains on it. And if you’re in ARC you dont need to worry about that anyways.

    If this doesnt answer your question, please post what you have tried (ie give us some code to work with) and you’ll probably get a more informed answer. Better question = better answer.

    The qualifiers strong/weak do not apply to int’s or other primitive data types, but you would still be wise to use (nonatomic) and also maybe (unsafe_unretained) if you are targeting for iOS4.

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

Sidebar

Related Questions

I am creating a simple Rock Paper Scissors game, but changing the traditional way
creating 20 viewcontrollers and calling them one after the other from the mainviewcontroller as
Creating a simple RPG game, first time using XNA. Trying to get my character
Creating simple php login scripts is easy, with simple one table mysql integration. I
Creating a popup window from main page with window.open, the child/popup page uses the
I'm creating JSON encoded data from PHP arrays that can be two or three
Creating a Certificate authority signing request (Keychain Access, Certificate Assistant: Request Certificate from Certificate
Creating my tables from my models.py . I donno how to do 2 things
Creating a link to an issue in Mantis is done via the hash symbol
When creating an array, such as int[], does this inherit from anything? I thought

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.