Browse files

add protocol to unregistered class

  • Loading branch information...
1 parent f8f3ef4 commit 8f2fcd7d70376a74cada6a4cc27d0460529d16e0 @lemnar lemnar committed Sep 24, 2010
Showing with 8 additions and 0 deletions.
  1. +2 −0 RTUnregisteredClass.h
  2. +6 −0 RTUnregisteredClass.m
View
2 RTUnregisteredClass.h
@@ -2,6 +2,7 @@
#import <Foundation/Foundation.h>
+@class RTProtocol;
@class RTIvar;
@class RTMethod;
@@ -14,6 +15,7 @@
- (id)initWithClass: (Class)c;
+- (void)addProtocol: (RTProtocol *)protocol;
- (void)addIvar: (RTIvar *)ivar;
- (void)addMethod: (RTMethod *)method;
View
6 RTUnregisteredClass.m
@@ -1,6 +1,7 @@
#import "RTUnregisteredClass.h"
+#import "RTProtocol.h"
#import "RTIvar.h"
#import "RTMethod.h"
@@ -21,6 +22,11 @@ - (id)initWithClass: (Class)c
return self;
}
+- (void)addProtocol: (RTProtocol *)protocol
+{
+ class_addProtocol(_class, [protocol objCProtocol]);
+}
+
- (void)addIvar: (RTIvar *)ivar
{
const char *typeStr = [[ivar typeEncoding] UTF8String];

0 comments on commit 8f2fcd7

Please sign in to comment.