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

  • Home
  • SEARCH
  • 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 8820007
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T05:30:13+00:00 2026-06-14T05:30:13+00:00

I have 2 UILables: myScore.text; and hisScore.text; When my NSTimer reach 0, I have

  • 0

I have 2 UILables:

myScore.text; and hisScore.text;

When my NSTimer reach 0, I have this code:

if (MainInt <= 0) {
        [Mytimer invalidate];

        if (myScore.text < hisScore.text) {
            UIAlertView *win = [[UIAlertView alloc]initWithTitle:@"Congrats" message:@"You WIN" delegate:self cancelButtonTitle:@"OK" otherButtonTitles:nil, nil];
            [win show];
        }
        else if(myScore.text > hisScore.text) {
            UIAlertView *lose = [[UIAlertView alloc]initWithTitle:@"Hmmmm" message:@"You lose :(" delegate:self cancelButtonTitle:@"OK" otherButtonTitles:nil, nil];
            [lose show];
        }

        else if(myScore.text == hisScore.text) {
            UIAlertView *tie = [[UIAlertView alloc]initWithTitle:@"Not Bad" message:@"No winners. TIE" delegate:self cancelButtonTitle:@"OK" otherButtonTitles:nil, nil];
            [tie show];
        }
    }

How can I compare, if my score is > than his score? my code doesn’t work. Help please.

  • 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-14T05:30:14+00:00Added an answer on June 14, 2026 at 5:30 am

    You are currently comparing two strings.

    You will have to compare the integer values for those strings.
    To access the integer value of a string in Objective-C, you can use the intValue method as such:

    [myScore.text intValue]
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have these Views on which I add UILabels as text, The Views can
I have 3 objects in a cell. They are UILable with text (at left),
have written this little class, which generates a UUID every time an object of
I have a bunch of UILabels that I add through code and I want
I have a UILabel which should have transparency (alpha) = .6 but Text of
I have this strange issue, and im dealing with it for more than 8
I have an NSMutableArray full of UILabels and I want to modify the text
I have customized UITableViewCell (Static Content Loaded from nib). This cell contains one UILable
I'll get to this quick: I have an application for the iPhone OS 3.1.2
I have a weird problem in a custom UITableCell subClass.This custom cell has a

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.