superview question

Discussion in 'iOS Programming' started by larswik, Dec 8, 2011.

  1. larswik macrumors 68000

    Joined:
    Sep 8, 2006
    #1
    Tonight I found an answer online to moving a TextField object to the front with code. I have a bunch of textFields and as the user selects one of them I have a UIImage alpha change from 0.0 to 0.8 to darken the UIImage, textFields, Lables under so the whole image appears much darker. The goal is to make the selected TextField stand out so I also needed to move the textfield to the front above the UIImage with the changing alpha.

    Code:
    [[phoneNumberTextField superview] bringSubviewToFront:phoneNumberTextField]; 
    was my solution. I understand this code except for the superview. I have a blank xib window and added a UIView that has a png on it. On top of that I have Lables, TextFields and so on.

    Is that superview code referring the the UIView the TextField object is sitting on? I am unsure as to what the superview of a UITextField is referring to?

    Thanks
     
  2. dejo Moderator

    dejo

    Staff Member

    Joined:
    Sep 2, 2004
    Location:
    The Centennial State
    #2
  3. larswik thread starter macrumors 68000

    Joined:
    Sep 8, 2006
    #3
    I have not read it. I have read other doc's and a couple books on Object-C. I will read through that doc you provided to better understand it, i hope.

    Thanks.
     
  4. dejo Moderator

    dejo

    Staff Member

    Joined:
    Sep 2, 2004
    Location:
    The Centennial State
    #4
    Have you read any books on iOS Development? Ones that don't just cover Objective-C but deal with the specifics of programming for iOS (a.k.a. Cocoa Touch)? If so, which books? Please provide titles, authors, and editions. If not, now might be a good time to do so.
     
  5. larswik thread starter macrumors 68000

    Joined:
    Sep 8, 2006
    #5
    The book that I read cover to cover was "Learn Objective-C on the Mac". I really enjoyed the "Learn C on the mac" and I have to say the second one was disappointing and full of errors. Also I just took my final for my Java class I was taking at city college and that gave me a good foundation of objects so far.

    As far as reading any books for IOS development cover to cover, no. But I am now reading through a book called Beginning iPhone Games Development. It's written for Xcode 3 but I am comfortable enough with Xcode 4 that I work around the differences.

    There are some holes in my understanding. Book learning is only good if you understand what you are reading. That's when internet searching is good and this forum for specific questions. I would love to take a class for interaction and to fill in the gaps. But for now it is reading, asking questions and testing out code.
     

Share This Page