iPhone - Create not persistant entities in core data
Posted
by ncohen
on Stack Overflow
See other posts from Stack Overflow
or by ncohen
Published on 2010-04-22T19:22:16Z
Indexed on
2010/04/22
19:23 UTC
Read the original article
Hit count: 186
Hi everyone,
I would like to use entity objects but not store them... I read that I could create them like this:
myElement = (Element *)[NSEntityDescription insertNewObjectForEntityForName:@"Element" inManagedObjectContext:managedObjectContext];
And right after that remove them:
[managedObjectContext deleteObject:myElement];
then I can use my elements:
myElement.property1 = @"Hello";
This works pretty well even though I think this is probably not the most optimal way to do it...
Then I try to use it in my UITableView... the problem is that the object get released after the initialization. My table becomes empty when I move it!
Thanks
© Stack Overflow or respective owner