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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T12:21:45+00:00 2026-06-10T12:21:45+00:00

I have this code: – (void)pickerView:(UIPickerView *)pickerView didSelectRow:(NSInteger)row inComponent:(NSInteger)component { NSDictionary *data = [list1

  • 0

I have this code:

- (void)pickerView:(UIPickerView *)pickerView didSelectRow:(NSInteger)row inComponent:(NSInteger)component
{
    NSDictionary *data = [list1 objectAtIndex:row];
    NSNumber *strt = [data objectForKey:@"ab1"];
    NSNumber *strt2 = [data objectForKey:@"ab1"];
    forlb1 = [NSString stringWithFormat:@"%d", strt.intValue];
    forlb2 = [NSString stringWithFormat:@"%d", strt2.intValue];

    NSDictionary *xt = [list1 objectAtIndex:row];
    NSString *name = [xt objectForKey:@"name"];

    NSDictionary *xx = [list1 objectAtIndex:row];
    NSString *name2 = [xx objectForKey:@"name"];

    switch (component)
    {   
        case 0:
            show1 = name;
            label1.text = forlb1;
            break;

        case 1:
            show2 = name2;
            label2.text = forlb2;
            break;
    }
}

- (IBAction)goView:(id)sender 
{    
    if (label1.text < labe2.tex)
    {
        ViewController1 *first = [[ViewController1 alloc]init];
        first.modalTransitionStyle = UIModalTransitionStyleFlipHorizontal;
        [self presentModalViewController:first animated:YES];
    }
    else
    {
        ViewController3 *third = [[ViewController3 alloc]init];
        third.modalTransitionStyle = UIModalTransitionStyleFlipHorizontal;
        [self presentModalViewController:third animated:YES];
    }
}

My problem is: I can’t get ViewController3 if my label1.text < label2.text

When I select from component 1 of Picker view, one of my labels show the Name, and Another, label1 show me a number, same thing happens with component 2 of Picker view, now is ok, but when I should touch the button, I need to go to viewcontroller 1 or viewcontroller 2, depends of: label1.text < label2.text

Help me 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-10T12:21:46+00:00Added an answer on June 10, 2026 at 12:21 pm

    You should not be comparing label.text using the less then < operator. Depending on the content of the label, you should either convert the text to number and do a check, or compare strings alphabetically.

    This is how to compare strings numerically, assuming that the text represents an integer number:

    if ([label1.text intValue] < [labe2.text intValue]) {
        ....
    }
    

    This is how to compare strings alphabetically:

    if ([label1.text compare:labe2.text] ==  NSOrderedAscending) {
        ....
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have this code : void Main() { System.Timers.Timer t = new System.Timers.Timer (1000);
I have this code for changing the image of a button: - (void)mouseEntered:(NSEvent *)event
I have this code to sort an array of objects. The data in the
I have this code which export data from GridView to csv. It works with
I have this code: - (void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event { mouseSwiped = NO; UITouch
I have this code: public void onPlayerInteract(PlayerInteractEvent event) { final Action action = event.getAction();
I have this code: - (void)parser:(NSXMLParser *)parser foundCDATA:(NSData *)CDATABlock { NSString *someString = [[NSString
have this code: void set(list<Person*>* listP){ Person timmy = Person(10); listP->push_back(&timmy); } int main()
I have this code and need to complete it.. string conn_str = @Data Source=.\SQLEXPRESS;AttachDbFilename=|DataDirectory|\mydb.mdf;
I have this code while($row = mysql_fetch_row($result)) { echo '<tr>'; $pk = $row[0]['ARTICLE_NO']; foreach($row

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.