1

I use stackmob as backend and coredata.

I have "User" and "Sport" objects (User <<-> Sport). All users must have a sport object as require. If some user is logged in, others can't use this sport object until all users are logged out. For example, I want to change my sport. When I change it I have a crash. Because, sport have reverse relation to users. Seems I can't use same object between users. How it possible? And how to resolve this situation?

Crashed here(SMIncrementalStore.m):

- (id)newValueForRelationship:(NSRelationshipDescription *)relationship
              forObjectWithID:(NSManagedObjectID *)objectID
                  withContext:(NSManagedObjectContext *)context
                        error:(NSError *__autoreleasing *)error

with crashlog:

*

** Terminating app due to uncaught exception 'SMExceptionIncompatibleObject', reason: 'No Attribute found for entity User which maps to the primary key on StackMob. The Attribute name should match one of the following formats: lowercasedEntityNameId or lowercasedEntityName_id. If the managed object subclass for User inherits from SMUserManagedObject, meaning it is intended to define user objects, you may return either of the above formats or whatever lowercase string with optional underscores matches the primary key field on StackMob.' * First throw call stack: (0x3916c2a3 0x3307e97f 0x3916c1c5 0x21c6e9 0x35a45bf3 0x341234b7 0x341279f7 0x35a359e7 0x35a45855 0x35a1d951 0x359edd4d 0x359ee3d5 0x3910e341 0x38e5a07b 0x38df2443 0x38e59f5d 0x35a31b57 0x10dfbd 0x1fdef9 0x3412411f 0x341234b7 0x341281bd 0x3913ff3b 0x390b2ebd 0x390b2d49 0x36c662eb 0x3b5382f9 0xd4ed5 0x32fc5b20)

Rost K.
  • 262
  • 2
  • 14

0 Answers0