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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T06:18:33+00:00 2026-06-06T06:18:33+00:00

I have been trying to do this on an app for a long time

  • 0

I have been trying to do this on an app for a long time but I cannot get it to work, please could someone help me and post some code on how I would do it. What I need to happen is when the text in the UITextField equal the UILabel. Thanks

h. viewcontroller

@interface AlphabetSceneViewController : UIViewController {

UILabel *stopWatchLabel;
NSTimer *stopWatchTimer;
NSDate *startDate;

IBOutlet UILabel *wordToType;
IBOutlet UITextField *wordTyped;

and the m. view controller

    - (void)updateTimer
{
    NSDate *currentDate = [NSDate date];
    NSTimeInterval timeInterval = [currentDate timeIntervalSinceDate:startDate];
    NSDate *timerDate = [NSDate dateWithTimeIntervalSince1970:timeInterval];

    NSDateFormatter *dateFormatter = [[NSDateFormatter alloc] init];
    [dateFormatter setDateFormat:@"mm:ss.SSS"];
    [dateFormatter setTimeZone:[NSTimeZone timeZoneForSecondsFromGMT:0.0]];
    NSString *timeString=[dateFormatter stringFromDate:timerDate];
    stopWatchLabel.text = timeString;
}

- (IBAction)onStartPressed:(id)sender {
    startDate = [NSDate date];

    stopWatchTimer = [NSTimer scheduledTimerWithTimeInterval:1.0/10.0
                                                      target:self
                                                    selector:@selector(updateTimer)
                                                    userInfo:nil
                                                     repeats:YES];
}

- (IBAction)onStopPressed:(id)sender {    

    [stopWatchTimer invalidate];
    stopWatchTimer = nil;
    [self updateTimer];

    if ([wordToType.text isEqualToString:@"stop"]) {

    }

}

Help much appreciated!

  • 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-06T06:18:35+00:00Added an answer on June 6, 2026 at 6:18 am

    I figured out how to do it, I’ll put up the code for anyone that wanted to know. It’s only code for the .m file and the alert view is just a bit of extra code on the end to make it show an alert when with the time that the user had when the timer stops.

    - (IBAction)stopTimer:(id)sender {
    
        if([wordTyped.text isEqualToString:wordToType.text]){
    
            [stopWatchTimer invalidate];
            stopWatchTimer = nil;
            [self updateTimer];
    
    
            UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"Nice Work" message:[NSString stringWithFormat:@"Good Job! You're time to type the alphabet was %@. Let's see if you can do better...", stopWatchLabel.text]
                                                           delegate:self cancelButtonTitle:@"Main Menu" otherButtonTitles: nil];
    
            [alert show];
        }
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have been trying to get this to work with several tutorials/answers here, but
I have been trying this for a little while nut just cannot get to
I have been trying to get this to work and I am nearly there
I have been trying to get this android service working but I can not
I have been trying this for a good while now but I can't seem
I have been trying this for a while now and can't get it to
I have been trying to figure this out for a while now, but every
been trying to search the reason for this error for a long time and
I've been trying to get an app hosted on EngineYard, and have run into
I have been trying to get culture specific resources to work on an asp.net

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.