OK Thank you for your help!
I know this is a bit confusing, but the idea is very simple. I have got two arrays: arraywithsongtitle and arraywithartists. They are filled with the informations in my music library. So in arraywithsongtitle there are all the songs as strings and in arraywithsongtitle there are the artists which belongs to these songs. Now both informations are in a normal tableview. It is very similar to your iPod app. Now I want to search this tableview. And I don't just want to search for a title - this is easy. I want to search for both artists and titles. Therefore I wrote this loop. When I type something in my search bar it looks throw all the artists - for (NSString*strinoftitle1 in arraywithartists).
When it finds an artist (as a string) which is equal to what I typed in my search bar, it should remember the location of that artist in the array. So this is nice because I know now which titles there are to present, you understand? I just say that it should write the song titles of the artist into the cells. (contentforthisrow=[arraywithsongtitles objectAtIndex:t]) and I am adding 1 to t every time the loop ran throw. It sounds logically for me and I think it should work, but unfortunately the tableview just presents the first title in arraywithtitles of a special artist.
I know that it is a bit confuse, but thank you for any kind of an answer. I don't know who to ask (-;
Last edited by iAppCode; 01-27-2012 at 04:59 PM.
|