Questions tagged [managedobjectcontext]

A managed object context represents a single object space, or scratch pad, in a Core Data application on iOS. It's primary responsibility is to manage a collection of managed objects.

An entity on the iOS platform.

A managed object context represents a single object space, or scratch pad, in a Core Data application. A managed object context is an instance of NSManagedObjectContext. Its primary responsibility is to manage a collection of managed objects. These managed objects represent an internally consistent view of one or more persistent stores. The context is a powerful object with a central role in the life-cycle of managed objects, with responsibilities from life-cycle management (including faulting) to validation, inverse relationship handling, and undo/redo.

Link.

48 questions
0
votes
2 answers

Swift - Reference viewControllers in navigationController by index number

This code illustrates what I am asking: For a simple app having 2 screens, the rootViewController and a TableViewController, the rootVC will be at index [0] in navigationController, the next views will increments the index by 1 import UIKit import…
Jay Nguyen
  • 342
  • 1
  • 2
  • 18
0
votes
2 answers

Objective-c newbie - UIViewController managedObjectContext unrecognized selector sent to instance

Using the code below I get the following error: 2016-04-25 10:04:51.520 eCoss[1700:620301] -[__NSCFString managedObjectContext]: unrecognized selector sent to instance 0x160383a0 objc[1700]: EXCEPTIONS: throwing 0x14f94500 (object 0x14d07b70, a…
jampez77
  • 5,012
  • 7
  • 32
  • 52
0
votes
1 answer

Change Value of Attribute Through Core Data Relationship

I'm struggling with updating a value stored in an entity that has a "one-to-many" relationship with another entity. My project is a budgeting app. Using NSFetchedResultsController, I can successfully add a transaction (which populates in the table)…
0
votes
1 answer

IOS/Xcode/CoreData: In Modal Controller how to Reference Presenting Controller

I have a modal controller controller2 that edits a view, created modally by controller1. modal controller2 is configured in storyboard but launched from controller1 in following code in viewdidload as follows. UIBarButtonItem *editButton =…
user1904273
  • 4,562
  • 11
  • 45
  • 96
0
votes
2 answers

BAD_EXC_ACCESS checking to see if data exist:SWIFT

I have a UITableViewController that I have data. If you tap on the row, you can edit the existing data, if you tap on the + in the UIBarButtonItem, you add new infomation. When my Segue passes the Core Data Object (vc.managedObjectID) my "detail"…
Paul S.
  • 1,342
  • 4
  • 22
  • 43
0
votes
2 answers

create relationship of new objects based on existing managed object property

I have the following datamodel: entityA<-->>entityB<<-->>entityC entityD<-->>entityE Note that entityD and entityE do not have relationship with A-C. My DetailViewController takes in properties from managed objects and saves as a new managed…
user3411663
  • 1,041
  • 1
  • 9
  • 12
0
votes
1 answer

NSCollectionView, How to send representedObject to code on Double Click?

I am using bindings for the first time on a core data store with a one to many relationship on my entities, I display the subItems using an NSCollectionView which shows an image and a title. Objects are: Subitems Array Controller…
GeoffCoope
  • 952
  • 9
  • 20
0
votes
3 answers

Getting error after trying to save core data record

i have a view controller to add a core data record. The core data entity name is FavoriteThings, the attribute is thingname. I have a save button action called SaveButtonAction. When I tap inside the button, the text inserted in the textfield called…
mvasco
  • 4,965
  • 7
  • 59
  • 120
0
votes
1 answer

Why would app try to save to PLSharedManagedObjectContext?

The following is a crash report I received from my crash reporting service, HockeyApp. The reason for the failure is a failure to save in PLSharedManagedObjectContext. I (think) I am doing all of my saves in the main app delegate…
0
votes
3 answers

Is it safe to perform save operations on an NSManagedContext object when using Objective-C fast enumeration

I was wondering if this sort of code would be ok to use NSManagedObjectContext *moc = [(AppDelegate*)[[UIApplication sharedApplication] delegate] managedObjectContext]; for (NSDictionary *dict in objects) { Object *object =…
0
votes
1 answer

Core Data: Modifying a Managed Object propagates to the rest of the UITableView records

I am in the process of writing a Master/Detail CoreData RSS reader for the fun of it. I use the following entities: Category 1->n Feed 0->n Post So in the left Pane of my UISplitView, there are the Feeds grouped by Category. Choosing a Feed will…
mirx
  • 148
  • 11
0
votes
1 answer

Passing managedObjectContext via presentViewController

I am trying the "pass the baton" method for passing the managedObjectContext (MOC) thru multiple views. I have it successfully passed to the rootViewController. From there I move to a tabBarController via presentViewController. I can't seem to…
Ben
  • 967
  • 3
  • 9
  • 23
0
votes
1 answer

iOS multiple entites for one managedObjectContext

There is a core data model with two entities i my iOS application. Entity: Unit / Attributes: unit_name - NSString ->> Relationship to Exercise (one to many) Entity: Exercise / Attributes: exercise_name - NSString . So one unit can have many…
Steffen Ruppel
  • 331
  • 2
  • 11
0
votes
1 answer

Delete request and sync RESTkit with core data and threading

To be clear... My objectives :- 1. Make a delete request to server (done), I get response but not sure whether its synced with core data DB or not. therefore, I need to know, how to delete a particular object from db using Restkit. 2.…
Sumitiscreative
  • 647
  • 3
  • 10
  • 24
0
votes
2 answers

More than one ManagedObjectContext

In my managedObjectModel I have several Entities. I think that it's possible to create ManagedObjectContext for each one... If it's true I would like to know: Do I need method - (NSManagedObjectModel *)managedObjectModel for each…
Romowski
  • 1,518
  • 5
  • 25
  • 50