so i'm building pretty basic sheet music editor in swift. i'm using coredata store , update songs. add, delete , update methods change both data in songs array , add stuff coredata model. i'm wondering if dumb way structure code. should bypass songs array , interact core data directly? code:
class datastore { var songs: array<song> = [song]() init() { songs = loadsongsfromcoredata() } func addsong(song: song) { ... } func deletesongatindex(index: int) { ... } func updatesongatindex(song: song, index: int) { ... } func loadsongsfromcoredata() -> array<song> { ... } }
so i'm building pretty sheet music editor in swift. i'm using coredata store , update songs. add, delete , update methods change both data in songs array , add stuff coredata model. i'm wondering if dumb way structure code. should bypass songs array , interact core data directly?
code:
class datastore { var songs: array<song> = [song]() init() { songs = loadsongsfromcoredata() } func addsong(song: song) { ... } func deletesongatindex(index: int) { ... } func updatesongatindex(song: song, index: int) { ... } func loadsongsfromcoredata() -> array<song> { ... } } click expand...
it question actually. nsfetchedresultscontroller used tableviews. has cache function. curious if way better or worse performance wise.
Forums iPhone, iPad, and iPod Touch iOS Programming
iPhone Mac OS & System Software iPad Apple Watch Notebooks iTunes Apple ID iCloud Desktop Computers Apple Music Professional Applications iPod iWork Apple TV iLife Wireless
Comments
Post a Comment