CoreData issue: -[NSManagedObject setValue:]: unrecognized selector sent to instance

后端 未结 8 615
温柔的废话
温柔的废话 2021-02-05 08:29

I just started with CoreData yesterday, and I\'m going crazy :( I created a project that uses CoreData (ticked the box -use CoreData). Created the entities, and then created the

8条回答
  •  悲哀的现实
    2021-02-05 08:37

    Looks to me like Title attribute may not be set to string. Have you check that?

    Usually, unrecognized selector sent to instance is a runtime error cause by sending a message to an object that the object doesn't know how to handle.

    Subscriptions *sbs = (Subscriptions *)[NSEntityDescription insertNewObjectForEntityForName:@"Subscriptions" inManagedObjectContext:context];
    sbs.Title = @"OK";
    

    Hope that help

    I made simple project here.

提交回复
热议问题