ios - NSCounted set ignoring a property -


this question has answer here:

i'm trying nscountedset need ignore property, tried overriding isequal method of object, , doing manual compare of properties except 1 want ignore doesn't work

any idea on how achieve it?

update

my class

@interface gsordermenumenucontent : gsbasemodel  @property (copy, nonatomic) nsnumber        *order_content_id; @property (copy, nonatomic) nsnumber        *item_id;  @property (copy, nonatomic) nsnumber        *price; @property (copy, nonatomic) nsnumber        *pricewithmodifiers;  @property (copy, nonatomic) nsstring        *course; @property (copy, nonatomic) nsstring        *itemname;  @property (nonatomic) gsmenuitem*           item; @property (nonatomic) nsmutablearray        *modifiers;  @property (copy, nonatomic) nsnumber        *isalreadyprinted;  @property (copy,nonatomic)  nsnumber        *isdeleted;  -(gsordermenumenucontent*)deepcopy;  -(gsordercontent*)  ordercontent;  -(bool)isequal:(gsordermenumenucontent*)object; @end 

usage:

    nscountedset* countedset    = [[nscountedset alloc] initwitharray:contents]; 

where contents array of class objects

adding breakpoint isequal gets not called (however if doing [nsarray containsobject:...]

as mentioned in docs isequal: method, must implement corresponding hash method. 2 methods must implemented together.

two objects compare equal must return same hash value.


Comments

Popular posts from this blog

javascript - gulp-nodemon - nodejs restart after file change - Error: listen EADDRINUSE events.js:85 -

Fatal Python error: Py_Initialize: unable to load the file system codec. ImportError: No module named 'encodings' -

javascript - oscilloscope of speaker input stops rendering after a few seconds -