摘要:
//// CCNSRegularExpression.h// CCFC//// Created by xichen on 11-12-23.// Copyright 2011 ccteam. All rights reserved.//#import <Foundation/Foundation.h>@interface NSRegularExpression(cc) // get the common result array with pattern in the string: str;// returns the array of "NSTextCheckingR 阅读全文
摘要:
//// CCNSPredicate.m// CCFC//// Created by xichen on 11-12-27.// Copyright 2011 ccteam. All rights reserved.//#import "CCNSPredicate.h"@implementation NSPredicate(cc)// returns whether the str is in accordance with the format+ (BOOL)isValidFormat:(NSString *)str withFormat:(NSString *)form 阅读全文
摘要:
//// CCNSPredicate.h// CCFC//// Created by xichen on 11-12-27.// Copyright 2011 ccteam. All rights reserved.//#import <Foundation/Foundation.h>@interface NSPredicate(cc)// returns whether the str is in accordance with the format+ (BOOL)isValidFormat:(NSString *)str withFormat:(NSString *)forma 阅读全文
摘要:
//// 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{ retu 阅读全文
摘要:
//// CCNSObject.h// CCFC//// Created by xichen on 11-12-17.// Copyright 2011年 ccteam. All rights reserved.//#import <Foundation/Foundation.h>#define SHOW_RETAIN_COUNT(obj) NSLog(@"retainCount is: %d", [(obj) retainCount])#define SHOW_RETAIN_COUNT_EX(obj, objStr) \ ... 阅读全文
摘要:
//// CCNSNumber.m// CCFC//// Created by xichen on 11-12-17.// Copyright 2011年 ccteam. All rights reserved.//#import "CCNSNumber.h"#import <math.h>@implementation NSNumber(cc)- (BOOL)floatEqualToZero{ return FLOAT_EQUAL_TO_ZERO([self floatValue]);}- (BOOL)floatEqualToFloat:(NSNumber * 阅读全文
摘要:
//// CCNSNumber.h// CCFC//// Created by xichen on 11-12-17.// Copyright 2011年 ccteam. All rights reserved.//#import <Foundation/Foundation.h>//单精度浮点数是否可以看成等于0 (默认精确到小数点第六位)#define FLOAT_EQUAL_TO_ZERO(floatNumber) \ (fabsf((float)(floatNumber) - 0.0f) < (float)1e-6)// 判断两个单... 阅读全文
摘要:
//// CCNSNotificationCenter.m// CCFC//// Created by xichen on 11-12-27.// Copyright 2011 ccteam. All rights reserved.//#import "CCNSNotificationCenter.h"@implementation NSNotificationCenter(cc) + (void)defaultCenterAddObserver:(id)observer selector... 阅读全文
摘要:
//// CCNSNotificationCenter.h// CCFC//// Created by xichen on 11-12-27.// Copyright 2011 ccteam. All rights reserved.//#import <Foundation/Foundation.h>@interface NSNotificationCenter(cc) + (void)defaultCenterAddObserver:(id)observer selector:(SEL)... 阅读全文
摘要:
//// CCNSLocale.m// CCFC//// Created by xichen on 11-12-27.// Copyright 2011 ccteam. All rights reserved.//#import "CCNSLocale.h"@implementation NSLocale(cc)+ (NSString *)localeLanguageCode{ NSLocale *currentLocale = [NSLocale currentLocale]; return [currentLocale objectForKey:NSLo... 阅读全文