iphone - How To Get Name From NSArray -
i have nsfetchrequest search of core data entities. finds them fine, want set cell's text entity's name
attribute.
i have setting object title, instead of name attribute, how can fix this?
nsfetchrequest *fetchrequest = [[nsfetchrequest alloc] init]; nsentitydescription *entity = [nsentitydescription entityforname:@"routine" inmanagedobjectcontext:self.managedobjectcontext]; [fetchrequest setentity:entity]; nserror *error = nil; nsarray *results = [managedobjectcontext executefetchrequest:fetchrequest error:&error]; self.routinearray = results; [fetchrequest release]; cell.textlabel.text = [self.routinearray objectatindex:indexpath.row];
try :
cell.textlabel.text = [[self.routinearray objectatindex:indexpath.row] name];
edit
if routine
instances in routinearray
(given name, suppose) :
// routine instance routine *r = [self.routinearray objectatindex:indexpath.row]; // got instance, set want on r... // ... // , set name text textlabel using previous instruction
Comments
Post a Comment