Hi,
I need just a little hint from you. Here is my code:
Code:
contentForThisRow = [[self searchResults] objectAtIndex:row];
for (NSString*strinoftitle1 in arraywithartists){
if ([strinoftitle1 isEqualToString:contentForThisRow]){
contentForThisRow=[arraywithsongtitles objectAtIndex:t];
}
t++;
}
It is not so difficult as it sounds (-; I get a search result from a search tableview and look if it is equal to a string in a mutable array. If this is the case, another string of a mutable array which belongs to this string should be shown in a cell. Unfortunately there are more than one in "arraywithartists". So when I look up for for example "Stevie Wonder" this string is found very often(because Stevie Wonder has got more than one song), but there is only the first song from him shown [arraywithsongtitles objectatindex:t].
I believe that I have to say my for loop that it should go on with the next stringoftitle1 after objectatindex:t was opened.
Maybe some of you know how to do that? This would be so nice because it is the last thing I have to do. Thank you very much!
Greetings,
Tim
Hi,
I need just a little hint from you. Here is my code:
Code:
contentForThisRow = [[self searchResults] objectAtIndex:row];
for (NSString*strinoftitle1 in arraywithartists){
if ([strinoftitle1 isEqualToString:contentForThisRow]){
contentForThisRow=[arraywithsongtitles objectAtIndex:t];
}
t++;
}
It is not so difficult as it sounds (-; I get a search result from a search tableview and look if it is equal to a string in a mutable array. If this is the case, another string of a mutable array which belongs to this string should be shown in a cell. Unfortunately there are more than one in "arraywithartists". So when I look up for for example "Stevie Wonder" this string is found very often(because Stevie Wonder has got more than one song), but there is only the first song from him shown [arraywithsongtitles objectatindex:t].
I believe that I have to say my for loop that it should go on with the next stringoftitle1 after objectatindex:t was opened.
Maybe some of you know how to do that? This would be so nice because it is the last thing I have to do. Thank you very much!
Greetings,
Tim
I need more information (preferably in a less verbose manner, remember programmers = lazy)
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 (-;
not sure exactly what u are doing, but what you probably want is a 3rd mutable array. And 2 seperate for loops, one for artist and one for song title. whenever you find a song or artist matching your search, put the contents onto the third array. After finishing both loops, your 3rd array will be complete. Use that one to populate your cells.