34 lines · plain
1#import <Foundation/Foundation.h>2 3@protocol MyProtocol4-(void)aMethod;5@end6 7@interface MyClass : NSObject {8 id <MyProtocol> myId;9 NSObject <MyProtocol> *myObject;10};11 12-(void)doSomething;13 14@end15 16@implementation MyClass17 18-(void)doSomething19{20 NSLog(@"Hello"); //% self.expect("expression -- myId", DATA_TYPES_DISPLAYED_CORRECTLY, substrs = ["id"]);21 //% self.expect("expression -- myObject", DATA_TYPES_DISPLAYED_CORRECTLY, substrs = ["NSObject"]);22}23 24@end25 26int main ()27{28 @autoreleasepool29 {30 MyClass *c = [MyClass alloc];31 [c doSomething];32 }33}34