objective c - CoreData NSArrayController addObject: Agonizingly Slow -
i have coredata app imports information *.xml file. file has 2 sections, summary , detail.
in essence, have 2 table views, tvsummary , tvdetail; 2 array controllers, acsummary , acdetail; , 1 mutable array, madetail.
i use [acsummary addobject:newsummarydata];
method add summary data records acsummary array controller when import file. once file imported summary data fields populate tvsummary table view.
when use [acdetail addobject:newdetaildata];
method add detail data records acdetail array controller can take upwards of twenty minutes import 72000 records (most files contain between 3600 , 21600 records). once lengthy process completed imported detail data fields populate tvdetail table view. when make selections in tvsummary table view data displayed in tvdetail table view changes match selected row. think how supposed work.
during cocoa / objective-c / core data learning process (i still neophyte) have found can copy 72000 records madetail mutable array in 5 seconds. have found can copy contents of madetail mutable array acdetail array controller in 2 seconds using [acdetail setcontent:madetail];
method.
what can not figure out how acdetail array controller remember content given when select different row in tvsummary table view. see references forcing array controller 'save', however, can not find documentation on how implement such method. advice or direction appreciated.
i'm not sure understand setup looks me not using array controllers core data. don't have add objects directly controller if using core data.
you should able add new objects directly core data object graph (just inserting them) , have controllers automatically pickup exist. conversely, controller should aware of deletions or updates.
the controllers observe core data context , responds changes in automatically. how binding works , why can write entire app virtually no code.
Comments
Post a Comment