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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T15:15:04+00:00 2026-05-16T15:15:04+00:00

Just getting started on iPhone dev today and have run through Apple’s HelloWorld tutorial:

  • 0

Just getting started on iPhone dev today and have run through Apple’s HelloWorld tutorial:

http://developer.apple.com/iphone/library/documentation/iPhone/Conceptual/iPhone101/Articles/02_CreatingProject.html#//apple_ref/doc/uid/TP40007514-CH3-SW3

Couple of easy questions for you folks (sorry so long-winded but I’m hunting around in the dark here):

1) So I made MyViewController the delegate for the text field, in order to receive a message when the return key is pressed (textFieldShouldReturn). This seems inelegant because the method has to check which control sent the message. But to handle the touch event on the button the technique is different — a custom message (changeGreeting) gets sent which could be associated with one or several buttons in Interface Builder, and I could create different messages for different buttons.

That seems much better and avoids the need to test in code which control sent the event. Why these two different approaches in the sample, is it just to demonstrate the two? Would it be possible to rewrite the sample only using the latter approach, or is there something fundamentally different between the text field’s textFieldShouldReturn and the button’s ‘Touch Up’ that mandates making the view controller a delegate for the text field?

2) When I position the text field near the top of the view, if it’s a certain vertical displacement away from the grey status bar with the battery status symbol then it locks into place and you can see the vertical blue dashed line indicating the lock. In this mode, when I run the app the text field is too high, hard up against the status bar. I can resolve this by moving the text field very slightly so that the vertical dashed blue line no longer appears. Then the positioning seems relative to whatever’s above the text field, as I can select a larger Top Bar in the Simulated UI Elements and it moves down nicely.

I’d expect to see some explicit property in the Attributes Inspector that says whether the layout is relative or absolute, but I can’t find anything that changes between the two scenarios. Surely this is made more explicit somewhere in the Interface Builder UI?

Hope these Q’s represent some easy points for someone…

  • 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-16T15:15:05+00:00Added an answer on May 16, 2026 at 3:15 pm

    1) You can connect the UITextField “Did End On Exit” event to an IBAction, similar to the Buttons “Touch Up”.
    The benefit of using the delegate is that you get a higher level of interaction for free with the UITextfield, without having to assign every event to an IBAction in interface builder.

    2) In the Interface Builder Inspector, on the size tab (the little ruler icon) there are a set of controls which allow you to set the automatic positioning of a subview. I believe you are interested in the “Autosizing” section.

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

Sidebar

Ask A Question

Stats

  • Questions 538k
  • Answers 538k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer The simple way: using ortographic projection. x_2d = x_3d +… May 17, 2026 at 2:07 am
  • Editorial Team
    Editorial Team added an answer I had some other Python 2.5 installed. I forgot the… May 17, 2026 at 2:07 am
  • Editorial Team
    Editorial Team added an answer If its a high traffic website, i would suggest you… May 17, 2026 at 2:07 am

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

Related Questions

I am just getting started with iphone development I have a Tabbed application and
I just started getting into iPhone development. I have been mish-mashing tutorials and material
Just getting started with Powershell and have a quick question. Trying to run this
I'm just getting started with Mac and iPhone development, and naturally my first step
I just started getting this error today, seemingly out of nowhere. Any one see
I have found the Getting Started documents for developing apps on iPhone. I wanted
I'm just getting started with MySql and need to run simple queries on the
HI all, I'm just getting started with developing for Android. I'm looking to port
I'm just getting started with jQuery. I was using it to make a photo
I'm just getting started with Android app development on a Mac, and I keep

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.