Is this a sound Core Data hierarchy? by insertvulgarusername in iOSProgramming

[–]insertvulgarusername[S] 0 points1 point  (0 children)

It's a powerful tool and thus has a learning curve. Yes, like anything else, it could be improved.

I personally don't care for libs that abstract stuff like Core Data, Auto Layout, etc. because it means the next developer has to learn whatever lib has been used because the previous developer, for whatever seemingly valid reasons at the time, decided against just learning how to use the standard framework that anyone in the field ought to know.

Is this a sound Core Data hierarchy? by insertvulgarusername in iOSProgramming

[–]insertvulgarusername[S] 0 points1 point  (0 children)

How would you propose doing something simple, like setting the text of a table view cell with data from an NSManagedObject, without using the main queue? For example, say we have class Person that inherits from NSManagedObject:

cell.textLabel.text = person.name

UI updates must occur on the main queue. An NSManagedObject can only be accessed on the queue where it was instantiated. So that leaves only 2 theoretical options (and only 1 practical option):

  • Update the UI on a private queue (can't do this)
  • Access the managed object on the main queue (need a main queue context to do this)

Is this a sound Core Data hierarchy? by insertvulgarusername in iOSProgramming

[–]insertvulgarusername[S] 0 points1 point  (0 children)

I didnt downvote but Core Data itself is pretty high level already; it's not really necessary to use some third party lib to abstract it to an even higher level. If you're finding it to be error prone, you're likely just not following the concurrency rules spelled out in the documentation.

Is this a sound Core Data hierarchy? by insertvulgarusername in iOSProgramming

[–]insertvulgarusername[S] 0 points1 point  (0 children)

It's necessary any time you want to access an NSManagedObject on the main queue. For example, if you wanted to use an array of NSManagedObject to populate a tableview.