select row in UITableView

Discussion in 'iPhone' started by tusharsquad, Apr 27, 2010.

  1. tusharsquad macrumors newbie

    Apr 23, 2010
    hi ,

    I have added a table as subview to mainview and added UITableViewDelegate to respond the events and made it's delegat to self

    it is working fine and data also loading

    But i want to select first row as Default select and should be highlighted
    i know code to select first row
    that is

    NSIndexPath *ip=[NSIndexPath indexPathForRow:0 inSection:0]
    [tblview selectRowAtInedexpath:ip ..............];

    But where i will have to write this code

    PLZ help me
  2. CocoaPuffs macrumors 68010

    Aug 23, 2008
    Sheesh you are a bad listener.

    But I'll throw you a bone, even though I doubt you'll read a single reply even after 3 previous posts.

    You obviously have to connect the method to an event, which is probably table onLoad or something. I quit programming on iPhone a year ago.

    But hey in all honesty, if you don't know where to place the method, then you are in way over your head.
  3. tusharsquad thread starter macrumors newbie

    Apr 23, 2010

    Thank's for suggestion

    But for your kind information
    there is no method called table onLoad or table DidLoad or like that

    OK ????
  4. CocoaPuffs macrumors 68010

    Aug 23, 2008
    You're making me bust out xcode for the first time in over a year.

    The key here is to tie the method to an event. If the table is load when the view is load, then you should put the highlight method in one of the default methods for tableview.

    Best is to seek help in the right spot, my half ass attempt won't help you.

Share This Page