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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T23:30:51+00:00 2026-06-10T23:30:51+00:00

I am just starting out in xCode and I have built a very simple

  • 0

I am just starting out in xCode and I have built a very simple (mac, not iPhone) app that pops up a window with a text field, a label and a button.

I can get the app to pop up a message box with the string value of the text box, but I can’t seem to set the string value of the text field with some default text.

The code I am using to try to populate the text field is:

[_txtBox setStringValue:@"Hello World"];

the set string method is the only method that looks like it should set the value of the box. The program runs with no errors and when I click on the button, no error’s are thrown.

If the text field contains text, the text displays in the label as it should.

If I place the line of code above just before the code that reads and outputs the text field, then instead of the text box showing that text box, the text box text just disappears as if I had over written the contents of the field with an empty string. The label is also blank.

Suggestionsn would be welcome; the almost identical expression I am using on the label works fine:

 [_lblOutPut setStringValue:_txtIP];

So I have no idea what I am doing wrong…

Cheers!

Dave

  • 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-10T23:30:53+00:00Added an answer on June 10, 2026 at 11:30 pm

    Check whether you are using “NSTextField with NumberFormatter” or “NSTextField“.

    “NSTextField with NumberFormatter” allows only numerals. If you try to set NSString it will display only an empty string.

    Try this

    [_txtBox setStringValue:@"123"];
    

    Now, If you are getting 123 in your output, then definitely you are using “NSTextField with NumberFormatter“

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

Sidebar

Related Questions

Just starting out with an iPhone application using xcode 4.2. I understand that it
I'm just starting with applescript in xcode and currently have an app that asks
Just starting out with C#, so this may be overly simple that I keep
Just starting out with my first commercial app for the iStore but dont have
Just starting out here, I have a Article.rb model that stores articles. So it
Hey - just starting out trying to get some openGL into my iphone app
Just starting out with subversion, have set up repos for 3 current projects and
Just starting out, this should be a simple one but I haven't been able
I'm just starting out with using Core Data on the iPhone SDK and I'm
I've noticed for a while that the iPhone app I'm developing takes a very

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.