ios - Get all records from core data and get string with one attribute from every record (MagicalRecord) -
i'm try elements user saved inside app(this easy), 1 attribute every record , have these attributes listed inside string(that's problem). how can it? wrote don't think right way. me please!
-(nsstring*)getallrecords { nsarray* arra = [newitem mr_findallsortedby:@"data" ascending:yes]; newitem* ctn = arra.;// have not idea return [nsstring stringwithformat:@"%@", [arra componentsjoinedbystring:@", "]]; }
if understand problem correctly, should want:
nsarray *elements = [newitem mr_findallsortedby:@"data" ascending:yes]; nsarray *attributes = [elements valueforkey:@"attributename"]; return [nsstring stringwithformat:@"%@", [attributes componentsjoinedbystring:@", "]];
applying valueforkey:key
array returns array containing results of invoking valueforkey:key
on each of array's objects.
Comments
Post a Comment