ios - NSObject +(BOOL)isSubclassOfClass: method returning wrong result -
ios - NSObject +(BOOL)isSubclassOfClass: method returning wrong result -
i have 3 classes: classa, classb , classc.
classc inherits classb inherits classa.
i'm trying write unit test verify classc inherits classb:
xctasserttrue([classc issubclassofclass:[classb class]]);
this returns false.
xctasserttrue([classc issubclassofclass:[classa class]]);
returns true.
[classc class] superclass]
returns classb.
note when test [classc issubclassofclass:[classb class]]
in console returns true, when test before code in unit test returns false same test!
can explain how happen?
i tried bryan's suggestion comments. logging unit test get:
0x102a8c4e0 0x110d21820
logging console get:
0x102a8c4e0 0x102a8c4e0
it's have of classes added both app target , unit test target.
your class should ever added app target.
from edit, looks it's classb
that's @ fault - it's worth checking 3 of them.
sentest/xctest utilize test harness makes classes included in app available tests without having explicitly include implementation.
including both has given duplicates of classes, why have different memory addresses.
ios nsobject
Comments
Post a Comment