iphone - Core Data NSPredicate with SQLITE store -


this code returns 0 objects not correct. however, when removing predicate, fetch request returns objects.

nserror *error = nil;  nsentitydescription *entitydescription = [nsentitydescription                                              entityforname:@"person"  inmanagedobjectcontext:[self managedobjectcontext]];  nspredicate * pr = [nspredicate predicatewithformat:@"%k beginswith '%@' ",                     @"fullname", searchtext];  //nspredicate * pr = [nspredicate predicatewithformat:@"personid == %@", searchtext]; works fine   nsfetchrequest *request = [[[nsfetchrequest alloc] init] autorelease]; [request setentity:entitydescription];  [request setpredicate:pr]; nsarray * arr = [[self managedobjectcontext] executefetchrequest:request error:&error]; 

the fullname attribute contains unicode data(arabic).

any appreciated.

try:

nspredicate * pr = [nspredicate predicatewithformat:@"fullname beginswith %@", searchtext]; 

Comments

Popular posts from this blog

python - Scipy curvefit RuntimeError:Optimal parameters not found: Number of calls to function has reached maxfev = 1000 -

c# - How to add a new treeview at the selected node? -

java - netbeans "Please wait - classpath scanning in progress..." -