Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- +(int) minHeight;
- +(int) minWidth;
- Class *class = NSClassFromString(childClassName);
- CGRect frame = CGRectMake(0, 0, [class minWidth], [class minWidth])
- MotherClass *view = [[class alloc] initWithFrame:frame];
- Class<MyCoolView> class = [NSClassFromString(childClassName);
- CGRect frame = CGRectMake(0, 0, [class getMinWidth], [class getMinWidth]);
- MotherClass *view = [[class alloc] initWithFrame:frame];
- #import <Foundation/Foundation.h>
- @interface MyChild
- + (int) minHeight;
- + (int) minWidth;
- @end
- @implementation MyChild
- + (int) minHeight { return 100; }
- + (int) minWidth { return 300; }
- @end
- int main(int argc, const char *argv[])
- {
- NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
- NSString *className = [NSString stringWithString: @"MyChild"];
- Class theClass = NSClassFromString(className);
- NSLog(@"%d %d", [theClass minHeight], [theClass minWidth]);
- [pool drain];
- return 0;
- }
- 2011-08-10 18:15:13.877 ClassMethods[5953:707] 100 300
Add Comment
Please, Sign In to add comment