iphone-common-codes-ccteam源代码 CCNSObject.m

//
// CCNSObject.m
// CCFC
//
// Created by xichen on 11-12-17.
// Copyright 2011年 ccteam. All rights reserved.
//


#import "CCNSObject.h"




@implementation NSObject(cc)


- (void)showRetainCount
{
NSLog(@"%@'s retainCount is: %d", self, [self retainCount]);
}


- (IMP)getFuncPtr:(SEL)sel
{
return [self methodForSelector:sel];
}


+ (IMP)getStaticFuncPtr:(SEL)sel
{
return [NSObject instanceMethodForSelector:sel];
}


@end

 

可能有更新:

googlecode链接地址:http://code.google.com/p/iphone-common-codes-ccteam/source/browse/trunk/CCFC/files/CCNSObject.m

github地址: https://github.com/cxsjabc/iphone-common-codes-ccteam/tree/master/CCFC/files/CCNSObject.m

 

你可能感兴趣的:(iPhone)