View Full Version : My search always returns first item. Something to do with indexPath.row
Feb 4, 2011, 02:28 PM
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!
Feb 7, 2011, 01:27 PM
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?
Feb 7, 2011, 06:48 PM
Mod note: Thread closed since it looks like you're getting help for this issue in this thread (http://forums.macrumors.com/showthread.php?t=1092588).