Code Structure - Swift


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> { ... }  } 
 

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

Popular posts from this blog

Sean Penn, "Chapo Guzman", and Rolling Stone

Subler - What is "Fix Audio Fallbacks"?

Help please Strange logs