0

I am trying to save a ManagedObject to a property for use within a static framework

@interface Descriptor : NSObject

 @property (strong, nonatomic) NSManagedObject *managedObject;

@end

I assign it in the project I am using the framework on and it immediately on load crashes the app. with

CoreData: error: Failed to call designated initializer on NSManagedObject class 'Entity'

The 'Entity' is a simple Managed Object I setup in the project and I am assigning it like so

Descriptor *descriptor = [[Descriptor alloc] init];
descriptor.managedObject = [[Entity alloc] init];

Any pointers are welcome.

Thanks

mooncitizen
  • 464
  • 5
  • 10
  • thanks for the reply but those fixes on those pages dont apply to me I have tried them before asking this question! please read the question and or understand it before commenting – mooncitizen Oct 14 '13 at 09:29
  • 1
    Please read the other answers and fix `[[Entity alloc] init];` – Wain Oct 14 '13 at 09:32
  • *"those fixes on those pages dont apply to me"*: they probably do. – *"I have tried them before asking this question"*: show what you have tried and what did not work. – *"read the question and or understand it before commenting"*: read the other answers and understand them. – Martin R Oct 14 '13 at 09:40
  • 1
    ok I blame monday! I have it working now you were right I shouldn't have been alloc. I changed the parameter to NSEntityDescription and assigned it as such so it does work I was just looking for something specific but it dint work.. thanks! – mooncitizen Oct 14 '13 at 09:55

0 Answers0