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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T06:10:53+00:00 2026-05-14T06:10:53+00:00

I am trying to run an action when the application starts. The action checkAtStart

  • 0

I am trying to run an action when the application starts. The action checkAtStart is supposed to display an alert if there is no text in field1 and hide startView if there is text in field1. checkAtStart works fine if assigned to a button, but when I try to run it using (void)awakeFromNib, the alert will display no matter what and startView will never hide. Its probably something really simple that I’m forgetting. Any help is appreciated!

Here is my code:

- (void)awakeFromNib {
 [self checkAtStart:self];
}

- (IBAction)checkAtStart:(id)sender
{
 if (field1.text == nil || [field1.text isEqualToString:@""]) {
     NSString *msg = nil;

     msg = nil;

     UIAlertView *alert = [[UIAlertView alloc] 
        initWithTitle:@"Test Message" 
        message:@"Test Message"
        delegate:self 
        cancelButtonTitle:@"Close" 
        otherButtonTitles: nil];
     [alert show];
     [alert release];
     [msg release];
 }
 else
 {
     startView.hidden = 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-05-14T06:10:53+00:00Added an answer on May 14, 2026 at 6:10 am

    I’m assuming that all of this code is in a view controller of some sort.

    -awakeFromNib will be sent to the controller after it’s been loaded from a NIB. At this point there’s no value in the text field yet unless you put those values in the NIB file.

    You probably used -viewDidLoad or other view event messages to assign some value from your model into the text field. That’s what’s making your IBAction work when assigned to a button.

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

Sidebar

Related Questions

I'm trying to upgrade my rails application to Rails3. When I run functional tests,
While trying to make an automator action that opens multiple tabs from selected text
I am trying to run a Rails application, but I am getting the following
i'm trying to run aap-application. Version is 1.076 (tried higher). All commands send me
I am trying to run HelloWorld android application, but the application doesn't load in
I am trying run a program from a qmake .pro file which modifies the
Situation: I'm trying run an https store (xcart) under one domain secure.example.com and I
Trying to run the following command in php to run powershell command... the following
Trying to run my program in FreeBSD OS, I have the following results: $
When trying to run an Eclipse Dynamic Web Project under a Tomcat setup using

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.