ios - FetchResultsController displaying no sections -


for reason, code below producing weird output.

#define initial_batch_size 500  // initializes nsfetchedresultscontroller following request - (void)initializefetchresultscontroller {     // makes request given entity     nsfetchrequest *request = [nsfetchrequest fetchrequestwithentityname:@"tweet"];     request.predicate = nil;     request.sortdescriptors = @[[nssortdescriptor sortdescriptorwithkey:@"timestamp"                                                               ascending:no]];     request.fetchbatchsize = initial_batch_size;      nsarray *matches = [self.managedobjectcontext executefetchrequest:request error:null];     nslog(@"%d", [matches count]);      // creates fetchedresultscontroller     self.fetchedresultscontroller = [[nsfetchedresultscontroller alloc] initwithfetchrequest:request                                                                         managedobjectcontext:self.managedobjectcontext                                                                           sectionnamekeypath:nil                                                                                    cachename:nil]; } 

when print out matches count 144192, when print out number of sections in self.fetchedresultscontroller 0 using code below.

- (nsinteger)numberofsectionsintableview:(uitableview *)tableview {     nslog(@"sections: %d", [[self.fetchedresultscontroller sections] count]);     return [[self.fetchedresultscontroller sections] count]; } 

i had initialized code in view did load , during debugging noticed self.fetchedresultscontroller initialized problem not deal initialized self.fetchedresultscontroller.

i trying find out reason cannot. more information, have uiviewcontroller contains tableview in hooked delegate , datasource don't think there problem causing issue.


Comments

Popular posts from this blog

javascript - Jquery show_hide, what to add in order to make the page scroll to the bottom of the hidden field once button is clicked -

javascript - Highcharts multi-color line -

javascript - Enter key does not work in search box -