Storing NSManagedObject in a dictionary (NSDictionary)

后端 未结 3 1797
闹比i
闹比i 2021-01-31 20:05

I have a custom class, which is a subclass of NSManagedObject. I would like to store it in a dictionary, but when trying to do so I receive a Property list in

3条回答
  •  孤街浪徒
    2021-01-31 20:24

    In my app I'm also storing MO's in a dictionary (but no hold on, I'm storing in an array) but without any cast. please try if this happens for an array too.

    And you can try to create the dictionary first and after that assign objects.

    NSMutableDictionary *dic = [NSMutableDictionary dictionary];
    [dic setValue:managedObject forKey:@"thisOne"];
    

提交回复
热议问题