objective c - NSManagedobject copywithzone unrecognised selector -


i have got error thrown on runtime in line of code:

[numberformatter setcurrencysymbol:[theobject valueforkey:kfieldcurrency]]; 

kfieldcurrency constant defined follows:

#define kvaluecurrency          @"currency" 

printing value of theobject provides output: printing description of theobject:

<nsmanagedobject: 0x7836bf0> (entity: customvalue; id: 0x78373d0 <x-coredata://84240925-2d7d-485e-ad9d-8dd48f602c00/customvalue/p5> ; data: {     contract = "0x78e4a20 <x-coredata://84240925-2d7d-485e-ad9d-8dd48f602c00/contract/p3>";     currency = "0x7839810 <x-coredata://84240925-2d7d-485e-ad9d-8dd48f602c00/currency/p5>";     datetimevalue = nil;     ischangeablebyuser = 1;     islisted = 1;     listname = geldwert;     numvalue = 10;     numberofdigits = 0;     stringvalue = nil;     tagname = geldwert;     type = 5; }) 

the error message is:

-[nsmanagedobject copywithzone:]: unrecognized selector sent instance 0x7c1c930 

and:

*** terminating app due uncaught exception 'nsinvalidargumentexception', reason: '-[nsmanagedobject copywithzone:]: unrecognized selector sent instance 0x7c1c930' *** first throw call stack: (0x1959012 0x1690e7e 0x19e44bd 0x1948bbc 0x194894e 0xe77afd 0x28d4d 0x2922f 0x2c53a 0x2d14f 0x2d67a 0x27ecd 0x3a61c7 0x3a6232 0x3a64da 0x3bd8e5 0x3bd9cb 0x3bdc76 0x3bdd71 0x3be89b 0x3bee93 0xc8d83f7 0x3bea88 0x71ae63 0x70cb99 0x3a6dd2 0xc8d012c 0x10763 0x16a4705 0x2c82c0 0x504a64 0x16a4705 0x2c82c0 0x2c8258 0x389021 0x38957f 0x3886e8 0x2f7cef 0x2f7f02 0x2d5d4a 0x2c7698 0x23c5df9 0x23c5ad0 0x18cebf5 0x18ce962 0x18ffbb6 0x18fef44 0x18fee1b 0x23c47e3 0x23c4668 0x2c4ffc 0x289d 0x27c5) libc++abi.dylib: terminate called throwing exception 

i have noticed, nsobject (from nsmanagedobject inherits) implements +copywithzone: none -copywithzone:. error message indicates copywithzone: has been sent instance of class, not class itself.

theobject local method's parameter.

- (nsstring *) outputvalue: (nsmanagedobject *) theobject {...} 

and see in debuggers output of type. , have property currency different nil.

any ideas? happy provide more code don't know yet sniplets insterested in.

this general available sdk 6.1 based on current xcode , copiler versions, non of circluating beta stuff.

from nslog output

<nsmanagedobject: 0x7836bf0> (entity: customvalue; id: 0x78373d0 <x-coredata://84240925-2d7d-485e-ad9d-8dd48f602c00/customvalue/p5> ; data: {     contract = "0x78e4a20 <x-coredata://84240925-2d7d-485e-ad9d-8dd48f602c00/contract/p3>";     currency = "0x7839810 <x-coredata://84240925-2d7d-485e-ad9d-8dd48f602c00/currency/p5>";     ... 

it seems "currency" relationship entity,

[theobject valueforkey:kfieldcurrency] 

would return object of entity , not string, expected setcurrencysymbol: method.

perhaps want similar to

[numberformatter setcurrencysymbol:[theobject valueforkeypath:@"currency.symbol]]; 

assuming "symbol" string attribute of "currency" entity.


Comments

Popular posts from this blog

ios - UICollectionView Self Sizing Cells with Auto Layout -

node.js - ldapjs - write after end error -

DOM Manipulation in Wordpress (and elsewhere) using php -