Questions tagged [nspersistentdocument]

NSPersistentDocument is a subclass of NSDocument intended to work with Core Data.

NSPersistentDocument is part of Apples Framework.

It is a subclass of that is intended to work with . It provides access to a document-wide object.

71 questions
0
votes
1 answer

Correct directory for NSPersistentDocument OSX

I am writing a shoebox type application wherein a user enters data into a single window. I’ve configured the data model with Code Data. Apple’s documentation states that user data should be stored in a Library Directory, however the auto-generated…
0
votes
1 answer

Runtime-generated Custom NSManagedObjectModel for NSPersistentDocument

I have a document-based (OS X) app that uses Core Data, so the document is a subclass of NSPersistentDocument. When the user creates a document, s/he specifies a setting that determines the number of attributes a particular entity in the managed…
user2105505
  • 686
  • 1
  • 9
  • 18
0
votes
1 answer

How to preset file format for document-based core data application's save-dialog to sqlite?

I started a document-based core data application targeting 10.9-only from the corresponding Xcode 5.1 template. When the save-dialog is opened from the file-menu of my application, the user is presented with three file format options: Binary,…
MartinW
  • 4,966
  • 2
  • 24
  • 60
0
votes
1 answer

Prevent warning sheet after NSPersistentDocument rename

Whenever my document is renamed , autosaving is blocked and the first save after the rename presents the pictured message. Technically its not an issue as either button takes the user back to a autosavable state but it is confusing for my users. I…
Warren Burton
  • 17,451
  • 3
  • 53
  • 73
0
votes
1 answer

Populate new NSPersistentDocuments with seed objects / Discard changes on close

Here's my issue: I have a document-based application, all written using Core Data. When a new document is created (on app start, or using doing File > New, or Cmd+N), I need this document to be populated with initial seed objects. Let's say my…
Micha Mazaheri
  • 3,481
  • 1
  • 21
  • 26
0
votes
1 answer

How to read an object from managedObjectContext in Core Data ( Xcode )

I have a program that gets some numbers in a tableView . I have a Core Data based program that has an entity with some attributes and could bind the columns of the tableview to those attributes. Now I want to have the sum of each column , but…
0
votes
1 answer

Core Data Reading Data in Thread that's added in the Main Thread

I have a Mac document-based app, using NSPersistentDocument for the document model. When new document is created, the app adds some default data (several sport objects and user data) to the document in the initiWithType method. -…
0
votes
1 answer

NSPersistentDocument and NSArrayController with MagicalRecord

I have a project where I use Core Data with bindings to NSArrayControllers. I found MagicalRecord and started to implement it. My question is, how do I implement MagicalRecord without having an AppDelegate? Or Shall I create my own AppDelegate and…
Mikael
  • 3,572
  • 1
  • 30
  • 43
0
votes
1 answer

Using custom NSManagedObjectContexts with NSPersistentDocument

I have an NSPersistentDocument. When I use the default managedObjectContext, it behaves as expected: the window shows the document is "edited" when new objects are added, and when I exit new, untitled, documents, the "save as" sheet appears. When I…
pickwick
  • 3,134
  • 22
  • 30
-1
votes
2 answers

NSTextView backed by core data

I have a NSTabViewController with a NSTextView in one tab. The text is saved in core data. I save the text when the view disappears. override func viewWillDisappear() { super.viewWillDisappear() self.saveText() } But how do I save the text…
user965972
  • 2,489
  • 2
  • 23
  • 39
-1
votes
1 answer

autosavesInPlace causes New Document save to fail

I have a NSPersistentDocument based app which fails to save a new document when autosavesInPlace is set to return YES , return NO and the problem disappears. I create a new document Make some changes Save it , thus running NSSaveAsOperation , the…
1 2 3 4
5