xcode/ios/coredata: Last record in tableview displays twice when after adding new record -
i having strange problem. when add record entities i.e. core data screens, table view instead of showing new record, repeats previous record.
it happens entities , screens, i.e. if add records, 1,2,3 etc. display 1,1,1. other screens , entities use identical code, happens, after 8 through tenth record.
in these cases, if add records named 1,2,3…10, display 1,2,3,4,5,6,7,8,8,8,8,8,8 etc.
has ever encountered strange/spooky behavior? why think new record same previous record either right away or @ point i.e. when number of records hits 8 or so?
note, saves fine in core data when close simulator , rebuild, shows right records.
the delegate pattern seems working—somewhat—as shows new record when 1 added, shows copy of last record , record on got stuck, i.e. 8,8,8 etc.
thanks suggestions. has been driving me crazy week now.
am posting without code not accept code posted reason... happy post code requested.
edit:
#pragma mark - table view data source - (uitableviewcell *)tableview:(uitableview *)tableview cellforrowatindexpath:(nsindexpath *)indexpath { uitableviewcell *cell = [self.tableview dequeuereusablecellwithidentifier:@"cell"]; lists *list = [self.fetchedresultscontroller objectatindexpath:indexpath]; cell.textlabel.text = list.listname; cell.detailtextlabel.text = list.list; return cell; }
in response duncan:
apple's documentation states:
"a delegate must implement @ least 1 of change tracking delegate methods in order change tracking enabled. providing empty implementation of controllerdidchangecontent: sufficient."
my code includes:
#pragma mark - nsfetchedresultscontrollerdelegate -(void)controllerdidchangecontent:(nsfetchedresultscontroller *)controller { //change }
i know there more verbose method change content , did change content switch statement different cases documentation says not necessary. (i tried , did not fix problem.) declare list file delegate in header with:
@interface listsvc : uitableviewcontroller<uitableviewdatasource, uitableviewdelegate,nsfetchedresultscontrollerdelegate>
for me, it's bug in tableview
. in fact, last row twice displayed "last" row empty. solved problem adding code in linked css (fill empty rows whit same background , text-fill color , remove borders. works fine!
.table-row-cell:empty .table-cell -fx-border-width: 0px; -fx-background-color: white; -fx-text-fill: white;
Comments
Post a Comment