ios - Objective-c: Making NSArray all lowercased -
i having strange problem when tryin catch data on plist.. so, here plist
so okay, getting data fine, used code know data
nsstring *path = [[nsbundle mainbundle] pathforresource:@"kurdiebg" oftype:@"plist"]; nsarray *plistdata = [nsarray arraywithcontentsoffile:path]; nspredicate *filter = [nspredicate predicatewithformat:@"english = %@", self.searchqwery.text]; nsarray *filtered = [plistdata filteredarrayusingpredicate:filter]; nslog(@"found matches: %@ : %@", filtered,[filtered valueforkey:@"kurdi"]); if (filtered.count>0) { nsdictionary *dic = filtered[0]; self.ss.text = dic[@"kurdi"]; }
but here strange part-- when try search abbey (lowercased)it returns right result, problem has twenty 2 thousand records they're not lowercased,
okay, when make first a capital, returns nothing
thanks visiting
you can case insensitive search adding [c]
. try this.
nspredicate *filter = [nspredicate predicatewithformat:@"english ==[c] %@", self.searchqwery.text];
Comments
Post a Comment