Hi everyone,
I am sitting on this problem for quite a long time and just don't know the answer. I have got a tableview where you can find all the titles of your music library and in the detailtextlabel there you can find the artist of the song. So this is easy, but I want to search now for an artist and the tableview of the search bar should show me all the songs from the given artist. I want to do this with the following code:
Code:
int u=0;
for (NSString *newsong in arraywithartists)
{
untertitel = [[self searchResults] objectAtIndex:row];
if ([newsong rangeOfString:untertitel options:NSCaseInsensitiveSearch].location != NSNotFound)
{
contentForThisRow = [arraywithsongtitles objectAtIndex:u];
}
u++;
}
}
else{
contentForThisRow = [arraywithsongtitles objectAtIndex:row];
untertitel = [NSString stringWithFormat:@"%@ - %@",[arraywithartists objectAtIndex:row],[arraywithalbumtitles objectAtIndex:row]];
}
Unfortunately it does not work. The search table view shows me the number of the songs of the artist, but in contentforthisrow there is only one song of this artist which is shown in all cells. arraywithartists,arraywithsongtitles,arraywithalbu m are of cause the arrays with all my artists, songs and albums.
I don't know what to do. It just won't work. Thank you so much for any help!
Many greetings,
Tim