سؤال

I have a UITableView in which I have added sections. When using didSelectRowAtIndex with indexPath.row I am not getting the correct value. Let's say I'm in section 2, then it starts the row index (indexPath.row) at 0 again and therefore I am getting the wrong index.

let's say the first array has 4 names: (0)50 street, (1)apple, (2)boy, & (3)cat. when you select anyone one it loads their correct detailview based on the index (0,1,2,3). however, when you go to search and type 'b' it narrows the table down to just (2)boy which is now in row 0. so when you select 50 street it loads boy from the original array.

Can anyone tell me how to fix this? I realize that it is possible to get the section index by indexPath.section but I can't figure out how to use this.

لا يوجد حل صحيح

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top