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
1
vote
2 answers

Sending the managedObjectContext to viewController crashes

I am trying to send my managedObjectContext from my masterViewController to anotherController via a segue and I am always getting this error: -[UINavigationController setManagedObjectContext:]: unrecognized selector sent to instance 0x8d67c70 ***…
kalafun
  • 3,512
  • 6
  • 35
  • 49
1
vote
1 answer

Handling multiple managedobjectcontext

I have three managed object context, namely : masterManagedObjectContext(NSPrivateQueueConcurrencyType), backgroundMangedObjectContext(NSPrivateQueueConcurrencyType), uiManagedObjectContext(NSMainQueueConcurrencyType) Master is the parent, and…
1
vote
2 answers

Multiple sharedInstance called failed

In my application i have called sharedinstance multiple time in multiple method deffinition , Here my code, Method 1 -(void) showActionSheet:(id)sender forEvent:(UIEvent*)event { if(isQuantity==YES) { [[WebService sharedInstance]…
Globas techn
  • 95
  • 1
  • 6
1
vote
2 answers

How do I utilize CoreData when moving from collection view to detail view

I have an IOS app that is using RestKit to pull json formatted data from a server into a CoreData Entity. Some of the attributes of the entity help populate a collection view with an image and title for each cell. I am attempting to move from the…
Ben
  • 967
  • 3
  • 9
  • 23
1
vote
1 answer

Passing managedobjectContext to tabbarcontroller with navigation controllers in modal view

For a small app, I have a login screen. On Auth, A tab bar controller with two views (one with navigation controller) is presented. I am following this tutorial. It uses core data.…
aVC
  • 2,254
  • 2
  • 24
  • 46
1
vote
0 answers

ManagedObjectContext cancel rollback not fully deleting inserted data

I've seen a bunch of responses on similar threads but after following their recommendations am still having a bizarre issue and am banging my head against the wall. I have a table of people and have the option for the user to add an entry for…
Toby
  • 390
  • 4
  • 18
1
vote
1 answer

CoreData: Weird element on a managedObjectContext after deleting all elements

I am having trouble with the fetching. Checking with the sql editor I can see that the table webs with two fields (integer position AND string weburl) is empty just before the fetching. However, after the fetching: NSArray * arrwebs =…
archipestre
  • 182
  • 9
1
vote
1 answer

Error: [__NSCFConstantString path]: unrecognized selector sent

I'm trying to realise sync Core Data with iCloud. and when I try to [self fetchedResultsControllerICloud] performFetch:&error] in -(id)init [self managedObjectModelICloud]; [self managedObjectContextICloud]; if (![[self…
1
vote
2 answers

Is it possible to reuse one shared managed object context beetween threads, when each thread can work with data not related to data in other thread?

Simple example for the title question: one thread has prepared Place entity and is doing some processing on it (filling particular fields and their calculation takes time) and in the mean time the other thread has already prepared Category entity;…
Stanislav Pankevich
  • 11,044
  • 8
  • 69
  • 129
1
vote
3 answers

NSManagedObjectContext Reset appears to be losing data?

My core data store contains 51 Entry entities which have a message attribute reading "Test". Doing an NSFetchRequest for this confirms that they're all there. I have another part of my method however, which will be used for memory intensive…
Andrew
  • 15,935
  • 28
  • 121
  • 203
0
votes
0 answers

Batch updating CoreData without performance issues

I have a tableView which I populate with cells. The data is being fetched as json from a private api and stored as CoreData. As the cells are being reused I fetched their imageView via a delegate method (from web URL). The problem occurs when I try…
snksnk
  • 1,566
  • 4
  • 21
  • 46
0
votes
1 answer

How to handle (or avoid) 'An NSManagedObjectContext's retain policy cannot be changed...' when editing TextView in modal view

The iOS app I'm building iterates through a list of PhraseGroup objects defined in Core Data and displays the extraText contents associated with each PhraseGroup. This shows how PhraseGroup is defined: extension PhraseGroup { @nonobjc public class…
0
votes
2 answers

value of type AppDelegate has no member managedObjectContext

Code let managedObjectContext = (UIApplication.sharedApplication.delegate as! AppDelegate).managedObjectContext Error: Value of type AppDelegate has no member managedObjectContext, My problem is I want to use…
0
votes
1 answer

Re-inserting NSManagedObject to ManagedObjectContext

I have this instance of a NSManageObect that I create without a valid context just to use it to hold data and pass it around convenience init() { let entityDescription = NSEntityDescription.entityForName("UserEntity",…
0
votes
2 answers

core data not saving when I want to

I'm developing an app that saves medical records. I'm using core data with a single context and a single physical store. Despite calling the [managedObjectContext save:&error], if I extract the container via Xcode, the sqlite db doesn't show the…
RandomDev
  • 3
  • 5