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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T02:13:26+00:00 2026-05-30T02:13:26+00:00

When I try to compile this I get this error. What do I need

  • 0

When I try to compile this I get this error. What do I need to add for the property declaration in the interface? If textBox is an instance variable, why does it need to be declared as a property?

ViewController.h

#import <UIKit/UIKit.h>

@interface TNRViewController : UIViewController {

    IBOutlet UITextField *textBox;
    IBOutlet UILabel *label;
}
- (IBAction)button:(id)sender;

@end

ViewController.m

#import "TNRViewController.h"

@implementation TNRViewController
@synthesize textBox;

- (void)didReceiveMemoryWarning
{
    [super didReceiveMemoryWarning];
    // Release any cached data, images, etc that aren't in use.
}

#pragma mark - View lifecycle

- (void)viewDidLoad
{
    [super viewDidLoad];
    // Do any additional setup after loading the view, typically from a nib.
}

- (void)dealloc {
    [textBox release];
    [label release];
    [super dealloc];
}
- (IBAction)button:(id)sender {
    NSString *Name = textBox.text;
    NSString *Output = Nil;
    Output = [[NSString alloc] initWithFormat:@"%@ says: Hello World!", Name];
    label.text = Output;
    [Output release];
}

- (BOOL)textFieldShouldReturn:(UITextField *)theTextField {
    [textBox resignFirstResponder];
    return YES;
}
@end
  • 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-30T02:13:27+00:00Added an answer on May 30, 2026 at 2:13 am

    textBox needs to be declared as a property because you are @synthesizing it in your implementation.

    You need to either:

    1. Add the @property declaration for textBox in your interface.

    2. OR, You could remove the @sythesize line from your implementation if you don’t plan on needing the setter/getter methods.

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

Sidebar

Related Questions

I'm getting a nothing to repeat error when I try to compile this: search
Got this error whenever I try to compile something: F1027 Unit not found: 'System.pas'
When I try to compile this code: struct BasicVertexProperties { Vect3Df position; }; struct
When I try to compile this: import java.awt.* ; class obj { public static
When I try to compile this: public static Rand searchCount (int[] x) { int
When i try to compile this: public static int compareCardhl (Card c1, Card c2)
When I try to compile TOSSIM in tiny OS v-2.0.2 , this is the
I try to compile this code: static uint64_t push(int fd, SOCKET sock, SSL *ssl,
Whatever I try to compile in Cygwin I get the following output: checking for
This compiles: class Ex1 { public int show() { try { int a=10/10; return

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.