FROM : malcom
DATE : Sat Mar 22 11:32:37 2008
Hello,
I'm working with Core-Data.
I've a simple cd structure (look here: ) with two entities: Draft and
Data. Draft contains some infos about the draft itself while the data
entity contains the body of the draft (I've used it in order to avoid
to load the entire article while I need to put some basic info in a
tableview).
Now I need to store the body into the body. My statments are:
NSManagedObject *linkedData = [draftObj valueForKey: DraftPackage_LinkedBody];
[linkedData setValue: [[ass_editingTextView textStorage] string]
forKey: DraftPackage_DataBody];
It's simple...but it does not works. I've tried to put an NSLog at
the end of the second line and the data was written correctly into the
entity but, when I read it again (for example when I select the draft
from the table) it returns the old value (or a empty string?!!?).
These operations was made inside the main managedobjectcontext and
inside the main app thread.
I've tried to make a refreshObject:mergeChanges with YES in merge but
it does not work.
Same thing by doing processPendingChanges.
I've also tried to saving it to disk with save: command.
What's the way to propagate changes, insert, deletes? Need I to fetch
this entity instead of taking it from draftObject relationship?
Thanks a lot.
malcom
DATE : Sat Mar 22 11:32:37 2008
Hello,
I'm working with Core-Data.
I've a simple cd structure (look here: ) with two entities: Draft and
Data. Draft contains some infos about the draft itself while the data
entity contains the body of the draft (I've used it in order to avoid
to load the entire article while I need to put some basic info in a
tableview).
Now I need to store the body into the body. My statments are:
NSManagedObject *linkedData = [draftObj valueForKey: DraftPackage_LinkedBody];
[linkedData setValue: [[ass_editingTextView textStorage] string]
forKey: DraftPackage_DataBody];
It's simple...but it does not works. I've tried to put an NSLog at
the end of the second line and the data was written correctly into the
entity but, when I read it again (for example when I select the draft
from the table) it returns the old value (or a empty string?!!?).
These operations was made inside the main managedobjectcontext and
inside the main app thread.
I've tried to make a refreshObject:mergeChanges with YES in merge but
it does not work.
Same thing by doing processPendingChanges.
I've also tried to saving it to disk with save: command.
What's the way to propagate changes, insert, deletes? Need I to fetch
this entity instead of taking it from draftObject relationship?
Thanks a lot.
malcom
| Related mails | Author | Date |
|---|---|---|
| malcom | Mar 22, 11:32 | |
| malcom | Mar 22, 12:25 | |
| malcom | Mar 22, 19:45 | |
| Andrew Merenbach | Mar 23, 02:21 |






Cocoa mail archive

