Some queries about iPhone application development

Discussion in 'iOS Programming' started by masumbuet, Dec 7, 2008.

  1. macrumors newbie

    Oct 30, 2008
    I have the following questions about iPhone application development.

    1. Does it make any distinction from the perspective of an iPhone network application whether the iPhone is using 3G or Wi-Fi for network support? If yes, then what are the differences from application development perspective?

    2. What happens when my application running on the iPhone is interfered by an incoming phone call? My running application terminates or runs in the background allowing the reception of the phone call or anything else?

    3. How to add "Previous" and "Next" keys on iPhone's default keyboard and their functionalities?
    4. How to dynamically reduce the View size to make place for the keyboard appearance and prevent elements at lower portion of the View from being hidden beneath the appeared keyboard?

    5. Which approach is better for building a View:
    1. Use a nib file
    2. Create the view dynamically in initWithFrame:

    and why? Is it possible for a View that is initialized by a nib file to reduce its size?

    6. How to determine that a UITextField has become the firstResponder (currently selected) just now?

    7. If I use a navigation controller and push a view in it, the back button is automatically added to top left corner with the title of the previous View. How can I make the title "back" instead of the "Previous View title"?

    Thanks in advance.
  2. macrumors 68000

    Aug 20, 2003
    Long Beach, California
    Alright, here’s my best go at all of your questions.

    I’m not sure what you mean by this question. You can detect whether the iPhone is on a Wifi network or the service providor's network.
    The application is sent events when the phone interruption starts and ends. I don’t believe that you can do anything during the interruption, just at the start and end of it. Remember that your application might be in use during a phone call as well.
    I don’t quite know the answer to this one. I presume you’re talking about the mini toolbar that you see in Safari with the previous, next, and done buttons. Sorry!
    Changing the frame size FTW.
    I use nibs for almost everything, especially if I can reuse it across the application.
    Implement UITextField’s textFieldDidBeginEditing: delegate method.
    Check out the backBarButtonItem for the navigation item that belongs to the view that is the back button. I haven’t ever tried to change it, but that should work. [P.S. You should have a really good reason for changing it. Really good.]

    Hopefully that helps you a bit!
  3. macrumors 604

    Jul 29, 2003
    Silicon Valley
    If an incoming phone call is rejected, your app runs in the background while it is being rejected. If the call is accepted, your app is terminated (and will be killed if it refuses to terminate).

  4. macrumors regular

    Mar 13, 2008
    if you're asking if it makes any difference for an app whether the connection si 3G or wi-fi or whatever, generally the answer is "no": your app connects to the same internet ;) of course the connection speed varies. if you ask whether you can make the distinction between the two, the answer is "yes".

    while the phone is ringing, your application execution is suspended; some of the events are queued, some others are dropped. if you decline to answer, your application continues the execution from the point it was left, and processes the events in the queue. if you answer the call, your application will terminate gracefully (i.e. the applicationWillTerminate() function will get called, and you can add your stuff in there to save the current app state). you may use the saved state next time you start the app. i forgot whether the app is automatically restarted at the end of the call or not.

    you cant add or change buttons on the keyboard, but you can select from a few different keyboard types. however i'm affraid this is not what you asked.

    you may want to push up the view to make room for the keyboard, in case the field that you want to edit would otherwise get covered.

    nibs are generally easier to work with, in case you change your mind frequently about the layout. however, figuring out how to make all the connections with the code is not really intuitive for a beginner. i remember i was really frustrated when i started using the IB, and on a few occasions i gave up and reverted to implementing everything in code. once you learn how to use the IB, you will prefer nibs.

    good luck.

Share This Page