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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T12:58:25+00:00 2026-05-26T12:58:25+00:00

I added a text field in viewDidLoad but it did not show up on

  • 0

I added a text field in viewDidLoad but it did not show up on screen.

Here’s .h

#import <UIKit/UIKit.h>
@interface SecondViewController : UIViewController{
    UITextField *tfText;
}
@property (nonatomic, retain) UITextField *tfText;
@end

Here’s .m

- (void)viewDidLoad{
    [super viewDidLoad];    

    [self.view setBackgroundColor:[UIColor lightGrayColor]];

    tfText.frame = CGRectMake(65, 100, 200, 50);
    tfText.backgroundColor = [UIColor whiteColor];    
    [tfText setTextColor:[UIColor blackColor]];
    tfText.placeholder = @"Test";
    [tfText setBorderStyle:UITextBorderStyleNone];
    [self.view addSubview:tfText]; 
}
  • 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-26T12:58:26+00:00Added an answer on May 26, 2026 at 12:58 pm

    seems that you need to initialize the object… I mean

    UITextField *newTextField = [[UITextField alloc] init];
    self.tfText = newTextField;
    //....
    //all your code here
    //....
    [newTextField release];
    

    And dont forget to release your instance on dealloc method.

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

Sidebar

Related Questions

My text Field is not being added to my Jframe, I want to have
I added a text field, and when I tap in there, the keyboard slides
I added a new (text)field to a Lotus Notes form. The form is a
I've added a text field in one of the accessory views of my table
I'm using Filemaker Pro's Instant Web Publishing feature. I've added a simple text field
For each item in my application's settings, I've added text to its Description Property
I have a tableview with a navigation bar at the top. I've added text
I'm writing a console application in Visual Basic 2008 Express. I added several text
I added very big text to UItextView. My initial offset is -55. Then I
In C# 3.5 System.Speech.dll was added for doing text-to-speech and speech-to-text conversions. Searching on

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.