Missing connection

Discussion in 'iOS Programming' started by Kapthehat, Jul 5, 2013.

  1. Kapthehat macrumors member

    Joined:
    Jul 1, 2013
    #1
    I am working through the Big Nerd Ranch IOS Programming book page 107. I am looking at Chapter 5 -and trying to construct a graphical user interface. My XIB file has three objects (MKMapView, a UITextField and UIActivityIndicatorView. However, :-
    1) I am missing a connection from the "LocationTitleField" to the "Text Field"
    2) the connection view to view should be "view" to "text view"

    Can somebody explain why I cannot make these connections. Much appreciated.

    Thanks

    Kaps
     

    Attached Files:

  2. Duncan C macrumors 6502a

    Duncan C

    Joined:
    Jan 21, 2008
    Location:
    Northern Virginia
    #2
    It's not clear what you are trying to do. I think what you are saying is that you are trying to drag a connection from the "locationTitleField" on the left "Connection Inspector" onto the "Text view" entry in the hierarchical list of view objects in your XIB file.

    Can you open that screen-shot in an image editor and draw circles around the two points you are trying to connect and then a line between them? (say in red at 2 pixel line thickness and 50% opacity)

    If that's what you are trying to do, it would create an iBOutlet link from the "locationTitleFileld" outlet defined in your view controller's header to a text field in your XIB.

    If I had to guess, I would guess that your "Text View" is a UITextView object, and the outlet is set up as a UITextField object.

    UITextView and UITextField objects are not the same type of object, and you can't make a connection between objects of different types.

    You need to switch one or the other object to the correct type.
     
  3. Kapthehat thread starter macrumors member

    Joined:
    Jul 1, 2013
    #3
    Thank you Duncan - as you inferred, I have mixed up UITextView and UITextField. I will make these changes and then revise the connections. Much appreciated.

    kind regards

    Kaps
     
  4. Kapthehat thread starter macrumors member

    Joined:
    Jul 1, 2013
    #4
    Thanks. now making more progress. I have all the correction connections except one - "view" to "view". Apparently this should be created by the template - but I can't see how !!!

    regards

    Kaps
     
  5. Tander macrumors 6502a

    Tander

    Joined:
    Oct 21, 2011
    Location:
    Johannesburg, South Africa
    #5
    Remember when I got you to drag from the view to file owner in your last thread?
    Do the same thing again :cool:

    Control - Drag from the view of your app to the icon - file owner. When you let go it will pop up and show you "view" - click on it and this should sort out that connection.
     
  6. Kapthehat thread starter macrumors member

    Joined:
    Jul 1, 2013
    #6
    Tander,

    I thought it would be like that - but when I do as you've instructed, I dont get the relevant option pop up. Any thoughts ? thanks

    Kaps
     
  7. Tander macrumors 6502a

    Tander

    Joined:
    Oct 21, 2011
    Location:
    Johannesburg, South Africa
    #7
    Go to your connections and see if view shows it's connected?

    It might already be connected.

    What happens when you launch the app as is now?
    Any compile errors?
     
  8. Kapthehat thread starter macrumors member

    Joined:
    Jul 1, 2013
    #8
    Its not in the connections - I learnt the significance of that from last time.

    No compile errors.

    Nothing happens when I launch the simulator.
     

Share This Page