I was programming and I got the error “SIGABRT”… But I don’t know why
Please try to help me, I will be very happy
in this code is “SIGABRT”:
-(void)list
{
NSLog(@"===List of songs===");
for (Song *theSong in playlist)
{ NSLog(@"Title:'%@'",theSong.title); //SIGABRT ERROR
NSLog(@"Artist:'%@'",theSong.artist);
NSLog(@"Album:'%@'",theSong.album);
NSLog(@"-------NEXT SONG-------");}
}
and in my main.m I got that error after writing this:
Playlists *searchRes;
searchRes = [playlistNow lookup:@"In"];
[searchRes list];
For lookup method code is this:
-(Playlists *)lookup:(NSString *)theTitle
{
Playlists *result = [[Playlists alloc]initWithName:@"results"];
for (Song *theSong in playlist)
{
if([theSong.title rangeOfString:theTitle options:NSCaseInsensitiveSearch].location != NSNotFound)
{
[result addSong:theTitle];
}
}
return result;
}