iphone - Default fetchrequest result order changed every time -



iphone - Default fetchrequest result order changed every time -

i executedfetchrequest entity @"tanid" contiains 5 records 1,2,3,4,5

--> problem first time shows 2,3,4,5,1 --> if 1 time again running shows 4,2,1,3,5

super dooper

any 1 tell how rectify problem.

you can utilize nssortdescriptor sort nsfetchrequest. otherwise, order not guaranteed. there examples in fetching managed objects section of core info programming guide.

nssortdescriptor *sortdescriptor = [[nssortdescriptor alloc] initwithkey:@"firstname" ascending:yes]; [request setsortdescriptors:@[sortdescriptor]];

iphone objective-c iphonecoredatarecipes

Comments

Popular posts from this blog

javascript - mongodb won't find my schema method in nested container -

Hibernate criteria by a list of natural ids -

ios - Lagging ScrollView with UIWebview inside -