摘要: //// CCNSThread.m// CCFC//// Created by xichen on 11-12-17.// Copyright 2011年 ccteam. All rights reserved.//#import "CCNSThread.h"@implementation CCNSThread@end可能有更新:googlecode链接地址:http://code.google.com/p/iphone-common-codes-ccteam/source/browse/trunk/CCFC/files/CCNSThread.mgithub地址: http 阅读全文
posted @ 2012-01-01 14:29 cc_team 阅读(132) 评论(0) 推荐(0)
摘要: //// CCNSThread.h// CCFC//// Created by xichen on 11-12-17.// Copyright 2011年 ccteam. All rights reserved.//#import <Foundation/Foundation.h>#define SLEEP(seconds) [NSThread sleepForTimeInterval:(seconds)]// 委托主线程执行#define PERFORM_ON_MAIN_THREAD(obj, func, withObj, isWaitUntilDone) \ ... 阅读全文
posted @ 2012-01-01 14:28 cc_team 阅读(155) 评论(0) 推荐(0)
摘要: //// CCNSString.m// CCFC_IPHONE//// Created by xuchen(陈旭), xichen(陈曦), qq:511272827 on 10-11-15.// Copyright 2010 cc_team. All rights reserved.// #include <wchar.h>#ifdef __OBJC__#import "CCNSString.h"#import "CCLog.h"@implementation NSString(cc)// 获取字符在字符串第一次出现的位置- (NSInte 阅读全文
posted @ 2012-01-01 14:27 cc_team 阅读(261) 评论(0) 推荐(0)
摘要: //// CCNSString.h// CCFC_IPHONE//// Created by xuchen(陈旭), xichen(陈曦), qq:511272827 on 10-11-15.// Copyright 2010 cc_team. All rights reserved.//#ifndef CC_NSSTRING#define CC_NSSTRING#ifdef __OBJC__#import <Foundation/Foundation.h>#define PASCAL_STR %.*s#de... 阅读全文
posted @ 2012-01-01 14:25 cc_team 阅读(262) 评论(0) 推荐(0)
摘要: //// CCNSRegularExpression.m// CCFC//// Created by xichen on 11-12-23.// Copyright 2011 ccteam. All rights reserved.//#import "CCNSRegularExpression.h"@implementation NSRegularExpression(cc)// get the common result array with pattern in the string: str;// returns the array of "NSTextC 阅读全文
posted @ 2012-01-01 14:24 cc_team 阅读(183) 评论(0) 推荐(0)
摘要: //// 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 阅读全文
posted @ 2012-01-01 14:23 cc_team 阅读(164) 评论(0) 推荐(0)
摘要: //// 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 阅读全文
posted @ 2012-01-01 12:11 cc_team 阅读(194) 评论(0) 推荐(0)
摘要: //// 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 阅读全文
posted @ 2012-01-01 12:09 cc_team 阅读(136) 评论(0) 推荐(0)
摘要: //// 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 阅读全文
posted @ 2012-01-01 12:04 cc_team 阅读(154) 评论(0) 推荐(0)
摘要: //// 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) \ ... 阅读全文
posted @ 2012-01-01 12:03 cc_team 阅读(169) 评论(0) 推荐(0)
摘要: //// 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 * 阅读全文
posted @ 2012-01-01 12:02 cc_team 阅读(260) 评论(0) 推荐(0)
摘要: //// 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)// 判断两个单... 阅读全文
posted @ 2012-01-01 11:56 cc_team 阅读(238) 评论(0) 推荐(0)
摘要: //// 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... 阅读全文
posted @ 2012-01-01 11:54 cc_team 阅读(165) 评论(0) 推荐(0)
摘要: //// 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)... 阅读全文
posted @ 2012-01-01 11:53 cc_team 阅读(144) 评论(0) 推荐(0)
摘要: //// 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... 阅读全文
posted @ 2012-01-01 11:52 cc_team 阅读(173) 评论(0) 推荐(0)
摘要: //// CCNSLocale.h// CCFC//// Created by xichen on 11-12-27.// Copyright 2011 ccteam. All rights reserved.//#import <Foundation/Foundation.h>@interface NSLocale(cc)+ (NSString *)localeLanguageCode;+ (NSString *)localeCountryCode;@end可能有更新:googlecode链接地址:http://code.google.com/p/iphone-common-co 阅读全文
posted @ 2012-01-01 11:51 cc_team 阅读(135) 评论(0) 推荐(0)
摘要: //// CCNSEnumerator.m// CCFC//// Created by xichen on 11-12-27.// Copyright 2011 ccteam. All rights reserved.//#import "CCNSEnumerator.h"@implementation NSEnumerator(cc)- (void)enumForSelector:(id)delegate selector:(SEL)selector{ id obj; while (obj = [self nextObject]) { ... 阅读全文
posted @ 2012-01-01 11:50 cc_team 阅读(171) 评论(0) 推荐(0)
摘要: //// CCNSEnumerator.h// CCFC//// Created by xichen on 11-12-27.// Copyright 2011 ccteam. All rights reserved.//#import <Foundation/Foundation.h>@interface NSEnumerator(cc)- (void)enumForSelector:(id)delegate selector:(SEL)selector;- (void)enumForSelector:(id)delegate selector:(SEL)selector use 阅读全文
posted @ 2012-01-01 11:49 cc_team 阅读(142) 评论(0) 推荐(0)
摘要: //// CCNSDate.m// CCFC//// Created by xichen on 11-12-17.// Copyright 2011年 ccteam. All rights reserved.//#import "CCNSDate.h"@implementation NSDate(cc)// 获取系统时间(yyyy-MM-dd HH:mm:ss.SSS格式)+ (NSString *)getSystemTimeStr{ NSDateFormatter *dateFormatter = [NSDateFormatter new]; [dateF... 阅读全文
posted @ 2012-01-01 11:48 cc_team 阅读(192) 评论(0) 推荐(0)
摘要: //// CCNSDate.h// CCFC//// Created by xichen on 11-12-17.// Copyright 2011年 ccteam. All rights reserved.//#import <Foundation/Foundation.h>@interface NSDate(cc) // 获取系统时间(yyyy-MM-dd HH:mm:ss.SSS格式)+ (NSString *)getSystemTimeStr;// print current time using printf func+ (void)printCurrentTime;/. 阅读全文
posted @ 2012-01-01 11:46 cc_team 阅读(210) 评论(0) 推荐(0)
摘要: //// CCNSData.m// CCFC//// Created by xichen on 11-12-17.// Copyright 2011年 ccteam. All rights reserved.//#import "CCNSData.h"@implementation NSData(cc)// 将UTF8格式的数据进行URL编码,返回编码后的总字节- (int)URLEncode:(char *)dest len:(const int)destLen{ int i; int j = 0; char ch; char *... 阅读全文
posted @ 2012-01-01 11:45 cc_team 阅读(252) 评论(0) 推荐(0)
摘要: //// CCNSData.h// CCFC//// Created by xichen on 11-12-17.// Copyright 2011年 ccteam. All rights reserved.//#import <Foundation/Foundation.h>typedef enum { NSDATA_UNIT_ONE = 1, NSDATA_UNIT_TWO = 2, NSDATA_UNIT_FOUR = 4, NSDATA_UNIT_MAX}NSD... 阅读全文
posted @ 2012-01-01 11:44 cc_team 阅读(177) 评论(0) 推荐(0)
摘要: //// CCNSCalendar.m// CCFC//// Created by xichen on 11-12-17.// Copyright 2011年 ccteam. All rights reserved.//#import "CCNSCalendar.h"@implementation NSCalendar(cc)+ (id)GregorianCalendar{ return [[[NSCalendar alloc] initWithCalendarIdentifier:NSGregorianCalendar] autorelease];}- (NSDateCo 阅读全文
posted @ 2012-01-01 11:43 cc_team 阅读(173) 评论(0) 推荐(0)
摘要: //// CCNSCalendar.h// CCFC//// Created by xichen on 11-12-17.// Copyright 2011年 ccteam. All rights reserved.//#import <Foundation/Foundation.h>@interface NSCalendar(cc) + (id)GregorianCalendar;- (NSDateComponents *)getComponents;// you should call this immediately after getComponents method t. 阅读全文
posted @ 2012-01-01 11:42 cc_team 阅读(171) 评论(0) 推荐(0)
摘要: //// CCNSArray.m// CCFC//// Created by xichen on 11-12-17.// Copyright 2011年 ccteam. All rights reserved.//#import "CCNSArray.h"#import "CCNSObject.h"@implementation NSArray(cc)// 判断一个对象指针(不是对象的值)是否在数组中存在- (BOOL)isPointerExistsInArray:(id)element{ for(id temp in self) { ... 阅读全文
posted @ 2012-01-01 11:40 cc_team 阅读(234) 评论(0) 推荐(0)
摘要: //// CCNSArray.h// CCFC//// Created by xichen on 11-12-17.// Copyright 2011年 ccteam. All rights reserved.//#import <Foundation/Foundation.h>@interface NSArray(cc)// 判断一个对象指针(不是对象的值)是否在数组中存在- (BOOL)isPointerExistsInArray:(id)element;// print the retainCount of each element- (void)printRetainCou 阅读全文
posted @ 2012-01-01 11:39 cc_team 阅读(149) 评论(0) 推荐(0)
摘要: //// CCMemory.m// CCFC//// Created by xichen on 11-12-23.// Copyright 2011 ccteam. All rights reserved.//#import "CCMemory.h"@implementation CCMemory// get the info of memory+ (BOOL)getMemoryInfo:(vm_statistics_data_t *)vmStats{ mach_msg_type_number_t infoCount = HOST_VM_INFO_COUNT; ... 阅读全文
posted @ 2012-01-01 11:37 cc_team 阅读(206) 评论(0) 推荐(0)
摘要: //// CCMemory.h// CCFC//// Created by xichen on 11-12-23.// Copyright 2011 ccteam. All rights reserved.//#import <Foundation/Foundation.h>#import <mach/mach.h>@interface CCMemory : NSObject {}// get the info of memory+ (BOOL)getMemoryInfo:(vm_statistics_data_t *)vmStats;@end可能有更新: google 阅读全文
posted @ 2012-01-01 11:35 cc_team 阅读(171) 评论(0) 推荐(0)
摘要: //// CCMapAnnotation.m// CCFC//// Created by xichen on 11-12-30.// Copyright 2011 ccteam. All rights reserved.//#import "CCMapAnnotation.h"#import "CCCommon.h"@implementation CCMapAnnotation@synthesize title = _title;@synthesize subtitle = _subtitle;@synthesize coordinate = _cord 阅读全文
posted @ 2012-01-01 11:33 cc_team 阅读(419) 评论(2) 推荐(1)