Featured post
iphone - Deleting all objects from a section in a Core Data backed UITableView doesn't trigger the selection to delete? -
i'm having problem managing sections in core data backed uitableview, using nsfetchedresultscontroller.
my table view can have 2 sections, first static section , displayed conditionally. second section being populated fetched results controller. i'm using following determine how many sections display. if delete of fetched objects in second section, expect section deleted well.
- (nsinteger)numberofsectionsintableview:(uitableview *)atableview { nsinteger numberofsections = 0; if (self.locationenabled) numberofsections++; if ([[[self.fetchedresultscontroller sections] lastobject] numberofobjects]) numberofsections++; return numberofsections; }
the problem approach datasource method informing table should displaying 1 section because there no fetched objects remaining, removing last object never triggered deletion of section through fetched results manager delegate methods.
how trigger section deletion avoid receiving uikit inconsistency errors?
edit: should point out have sectionnamekeypath set nil since results don't share in common section by.
- Get link
- X
- Other Apps
Comments
Post a Comment