ios - NSFetchedResultsController with additional objects -
i trying use nsfetchedresultscontroller fetch objects db display in tableview. append custom objects fetched objects displaying purposes. best way this?
my current method store [fetchedresultscontroller fetchedobjects] in array called objectsdatasource , append objects it. use objectsdatasource datasource tableview. when receive controllerdidchangecontent, call fetchedobjects again , reload objectsdatasource. there performance issue?
alternative abandon nsfetchedresultscontroller , create own array , add observer nsmanagedobjectdidsavenotification.
does [fetchedresultscontroller fetchedobjects] fetch objects faults , fire fault when property accessed?
i avoid copying array returned fetch results controller , keep added results in seperate array when possible (the array returned fetch results controller virtual cursor actual data stored in db, , might not actualy hold entire dataset in memory).
if aditional items not mixed results returned fetch results controller, might put them in own section of table.
does [fetchedresultscontroller fetchedobjects] fetch objects faults , fire fault when property accessed?
this depends on fetch request assigned fetch results controller. if set: [request setreturnsobjectsasfaults:no]
, [request setincludespropertyvalues:yes]
, controller fault object first fetched db , not again when faulted (much beter performance).
Comments
Post a Comment