You can pass in an empty set, if you want an empty collection. Which I would recommend as otherwise you have to pass MOEntry objects and those are much harder to create. So create an empty collection (this method will already select the collection) and you can return an array of new NSDictionaries with the entries you want to add.
i try to modify programmatically links for an entry. it seems that Link is a MOLink class.
could you provide the definition of the MOLink class in order to be able to modified links ?
It's not possible to add a new link to an existing entry only to a new entry as you pass those as dictionaries and then get validated and the objects get created in the database. Creating an MOLink object is not enough, you would need to initialize it and add it to the NSManagedObjectContext.
I have added a convenience method for you in the beta, so download it again and add the following method to the MOEntry @interface in the MyControllerForPlugins.h file.
You have to get the mutable version of the linkSet (mutableSetValueForKey:). That alone will then give you and error when you try to quit DVDpedia as you left a link orphaned and this is against the Bookpedia rules. To delete the link as well download the beta again and you will be able to use the following new deleteObject: method.
Regarding collections, i'm trying the method to create a collection.
The created collection is an excluded collection, is it possible to add an included collection ?
I would like to be able to add an entry of the Library to a collection, could you provide a method to do that ?
i can do it only when i create a collection for example :
MOCollection *newCollection = [myCollections createCollectionWithName:@"superTest"]];
MOEntry *aDVD = [[manager arrangedEntries] lastObject]; // You will have to loop the next method to add more than one
[manager addEntry:anEntry toCollection:newCollection];
The folders are part of the collection returned by "allCollections" method. Loop through the results from that method and look for the name of the folder you wish to locate. You can also tell at that a collection is a folder if the "type" value is 30.
You can create a folder with the same new collection method and then setting the folder type flag. If you then create regular collections after creating a folder or selecting a folder, they will be added to the folder; however, you can't add existing collections to a folder, that can only be done via the drag and drop UI. The type value is also an internal implementation, so I can't promise it will always work, but I can't foresee a reason for changing it.