I have a NSMutableArray containing custom objects of type Episode. Each of these objects has multiple NSStrings as properties. Now I would like to filter the array to check if I have this episode (parsed from an XML) already and update it or create a new Episode object.
I use the following code:
NSPredicate *predicate = [NSPredicate predicateWithFormat:@"weblink = %@", currentEpisode.weblink];
NSArray* hits = [appDelegate.episodesList filteredArrayUsingPredicate:predicate];
currentEpisode is the episode I parsed from the XML and I want to check for, episodeList is my NSMutableArray with Episode objects. weblink is one of the NSString properties containing an URL.
When I check on weblink everything works fine. BUT URLs in Podcastfeeds can change so I want to check on an other property called kuhid which is a unique identifier provided in the feed. 'kuhid' is also an NSString (example: 644ED540-EDCA-4D4F-882E-4B3106DDAAB3). When I check on 'kuhid' the predicate never matches and I get duplicates. Both properties are NSStrings, both correctly synthesized. Same if I try one of my other NSString (e.g. title) propierties.
Have anybody an idea why that work only with weblink and not with any of my other properties?