pfobject compare:options:range error when searching parse.com class
my code similar above link. working in ios 8.4.1 crashing in ios 9.3.2
nsstring *name = [nsstring stringwithcstring:combined_name encoding:nsasciistringencoding]; nscomparisonresult result = [name compare : searchtext options : (nscaseinsensitivesearch|nsdiacriticinsensitivesearch) range : nsmakerange(0, [searchtext length])]; if (result == nsorderedsame) { [self.list addobject:name]; }
in above code combined_name character array. guide me.
i using above code in following method.
- (void) updatesearchresultsforsearchcontroller:(uisearchcontroller *) searchcontroller
crashing in compare method.
the screenshot is
nsmakerange(0, [searchtext length]) causing problem.
below code working fine.
nscomparisonresult result = [name compare : searchtext options : (nscaseinsensitivesearch|nsdiacriticinsensitivesearch) range : [name rangeofstring: searchtext options : (nscaseinsensitivesearch|nsdiacriticinsensitivesearch)]];
Comments
Post a Comment