Hi all,
I have made an application in which I am using core-data, array-
controllers to show data in two tables, such that -
table1 => entity: table1Entity (attributes: detail)
table2 => table2Entity (from, to, detail)
Now I am trying to perform drag from table1 and drop on table2, such
that an entity added to array controller of table2 contains value of
attribute - 'detail' from table1Entity, which is dropped.
I know that we can add an entity to an array controller subclass in
following way-
But
I am not getting, how can we extract information from dropped
object(NSManagedObject) and modify the entity(NSEntityDescription)
using it.
Can anyone suggest me how to do it?
Thanks,
Monaj
I have made an application in which I am using core-data, array-
controllers to show data in two tables, such that -
table1 => entity: table1Entity (attributes: detail)
table2 => table2Entity (from, to, detail)
Now I am trying to perform drag from table1 and drop on table2, such
that an entity added to array controller of table2 contains value of
attribute - 'detail' from table1Entity, which is dropped.
I know that we can add an entity to an array controller subclass in
following way-
Code:
NSManagedObjectContext *mangagedObjectContext = [self
managedObjectContext];
NSString *entityName = [self entityName];
NSManagedObjectModel *managedObjectModel = [[mangagedObjectContext
persistentStoreCoordinator] managedObjectModel];
NSEntityDescription *entity = [[managedObjectModel entitiesByName]
objectForKey:entityName];
id newObject = [[NSManagedObject alloc] initWithEntity:entity
insertIntoManagedObjectContext:mangagedObjectContext];
[self addObject:newObject];
But
I am not getting, how can we extract information from dropped
object(NSManagedObject) and modify the entity(NSEntityDescription)
using it.
Can anyone suggest me how to do it?
Thanks,
Monaj