My search always returns first item. Something to do with indexPath.row

Discussion in 'iOS Programming' started by dalearyous, Feb 4, 2011.

Thread Status:
Not open for further replies.
  1. macrumors newbie

    Oct 24, 2010
    so basically when you run a search, it returns the correct items but for some reason no matter which search results comes up, if you select it it always loads the first item in the row. i know it has something to do with objectAtIndex:indexPath.row. i thought i could either retain the original value of indexPath.row (prior to the search), or pass it to a new index variable, or create a seperate index that accesses the just the array. but i must be doing something wrong.

    any ideas? i would be willing to email my project. pm or reply. thanks!
  2. dalearyous, Feb 7, 2011
    Last edited: Feb 7, 2011

    thread starter macrumors newbie

    Oct 24, 2010
    ok after some reading and research i think i have a much better way to explain it:

    basically the first array let say has 4 names: (0)bob, (1)jim, (2)david, & (3)carl. when you select anyone one it loads their correct array item based on the index (0,1,2,3). however, when you go to search and type d it narrows the table down to just (0)david which is now in row 0. so when you select david it loads bob from the original array. how do i retain their index value?
  3. Moderator


    Staff Member

    Sep 2, 2004
    The Centennial State
    Mod note: Thread closed since it looks like you're getting help for this issue in this thread.
Thread Status:
Not open for further replies.

Share This Page