Okay so what I have right now is two arrays with data.
myArray1 has a long list of headings and myArray2 has a long list of descriptions. The relevant description for the heading is located in the adjacent point of the array. For instance if ‘Water’ is at one point in my Array1, then ‘Is a drinkable fluid’ would be at the same point, but in myArray2.
THEN myArray1 is displayed into a UITableView and when you click which ever entry, this passes the row number you have clicked into another view which loads, then on that view there is a textfield which is loaded with myArray2 objectAtIndex: whatever index was passed across.
This all works fine! so where is the question? I have been trying to implement a search bar like shown in this tutorial:
http://www.youtube.com/watch?v=SlhrYJxE_rY
But now my search results are displayed in the UITableView and when clicked the row that is passed is not specific to myArray2 because they are different sizes and I am getting the wrong description!!
So, how can I either store my data with the heading and description in the same entity? or how can I avoid search results truncating the actual table?
You can get the index of object in the array and then pass this index to next controller to show the description.You can get index as
Hope it will help 🙂