NSMutableObject from existing custom class
- by A.S.
Hello there. I have an existing class that has methods to deserialise from XML in my code. Now I need to create correct CoreData model from that class. It's objects will be created not only from CoreData storage but also by deserializing XML (somehow like
instance->title = [[NSString stringWithUTF8String: (const char *)subNode->children->content] retain;
) without saving to CoreData, and sometimes I need to save it.
What is the correct steps to modify existing class to do that except of adding CoreData framework and making my class an NSManagedObject instead of NSObject?
Class sample:
@interface TSTSong : NSManagedObject<NTSerializableObject> {
NSString *identifier;
NSString *title;
float length;
NSURL *previewURL;
NSString *author;
NSURL *coverURL;
NSString *appStoreId;
BOOL isPurchased;
NSURL *bannerURL;
NSDecimalNumber *priceValue;
NSLocale *priceLocale;
}
P.S. I'm noob, so I'f I'm doing smth. wrong - please let me know. Sorry for my english.