0

I'm experiencing this issue using Core Data.

CoreData: error: exception during fetchRowForObjectID: -[PharmaceuticalComp initWithCoder:]: unrecognized selector sent to instance 0x9ab1920 with userInfo of (null)
2014-08-18 07:56:55.784 HorizonMemory[1357:60b] CoreData: error: Serious application error.  Exception was caught during Core Data change processing.  This is usually a bug within an observer of NSManagedObjectContextObjectsDidChangeNotification.  -[PharmaceuticalComp initWithCoder:]: unrecognized selector sent to instance 0x9ab1920 with userInfo (null)
2014-08-18 07:56:55.786 HorizonMemory[1357:60b] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[PharmaceuticalComp initWithCoder:]: unrecognized selector sent to instance 0x9ab1920'
*** First throw call stack:
(
    0   CoreFoundation                      0x021981e4 __exceptionPreprocess + 180
    1   libobjc.A.dylib                     0x01f178e5 objc_exception_throw + 44
    2   CoreFoundation                      0x02235243 -[NSObject(NSObject) doesNotRecognizeSelector:] + 275
    3   CoreFoundation                      0x0218850b ___forwarding___ + 1019
    4   CoreFoundation                      0x021880ee _CF_forwarding_prep_0 + 14
    5   Foundation                          0x01b2a01a _decodeObjectBinary + 3498
    6   Foundation                          0x01b2b4d7 -[NSKeyedUnarchiver _decodeArrayOfObjectsForKey:] + 2204
    7   Foundation                          0x01b2b746 -[NSArray(NSArray) initWithCoder:] + 255
    8   Foundation                          0x01b2a01a _decodeObjectBinary + 3498
    9   Foundation                          0x01b2b4d7 -[NSKeyedUnarchiver _decodeArrayOfObjectsForKey:] + 2204
    10  Foundation                          0x01b37ff1 -[NSDictionary(NSDictionary) initWithCoder:] + 261
    11  Foundation                          0x01b2a01a _decodeObjectBinary + 3498
    12  Foundation                          0x01b29106 _decodeObject + 340
    13  Foundation                          0x01b28faa -[NSKeyedUnarchiver decodeObjectForKey:] + 181
    14  Foundation                          0x01b9aa86 +[NSKeyedUnarchiver unarchiveObjectWithData:] + 106
    15  Foundation                          0x01b197d5 -[_NSKeyedUnarchiveFromDataTransformer transformedValue:] + 47
    16  CoreData                            0x024205b9 _prepareResultsFromResultSet + 4105
    17  CoreData                            0x0241de33 newFetchedRowsForFetchPlan_MT + 1

PharmaComp is an NSManaged subclass linked to another entity User by a transient property -linkedPharma. User has this property in readonly mode. Every time I call linkedPharma it starts a fetch request that provides me the PharmaComp instance. When I try to delete User, i get this exception. the strange fact is that linkedPharma is a property not listed in the Model, thus PharmaComp shouldn't be involved in any sort of operation.The other fact is that it seems to try to use NSKeyedUnarchivier on it, but I don't understand why.
No object is hearing for NSManagedObjectContextObjectsDidChangeNotification.
I have no idea about where it came from.

2
  • Why a transient property? Would not a straight forward relationship be much more suitable for your use case? Commented Aug 18, 2014 at 8:38
  • Hi @Mundi I was like that from start of the project, I guess it is because the data resides on two different configurations, one readonly and one r/w. I think that I've found the error User has a transformable properties that contains the Pharmacomp.. that is probably why it tries to use initWithcoder. Commented Aug 18, 2014 at 11:27

1 Answer 1

1

The solution was pretty simple.
User had also another relationship with a transformable container (NSArray) which was holding (for a bug) a PharmaComp instance.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.