ios - Compare a enum type in a If -
i'm having problems comparing enum type.
this enum:
enum typeson {folder, service}; enum typeson *type; and have 1 method on class return method type.
-(void) settype: (enum typeson) t; -(enum typeson) gettype; and if this, works:
nslog(@"object type: %d", [[[actualnode sons] objectatindex:indexpath.row] gettype]); it returns 1 or 0 depends on type. problem when this:
if (![[[actualnode sons] objectatindex:indexpath.row] gettype]==service) { nslog(@"this service type"); } it doesn't work. have tried change 'service' 1, '1'... nothing happens. thanks
// ! shouldn't there. // v if (![[[actualnode sons] objectatindex:indexpath.row] gettype]==service) { nslog(@"this service type"); }
Comments
Post a Comment