OC判斷一個字符串是否都是中文code
-(BOOL)IsChinese:(NSString *)str { BOOL isChinese = YES; for(int i=0; i< [str length];i++){ int a = [str characterAtIndex:i]; if( a >= 0x4e00 && a <= 0x9fff) { }else{ isChinese = NO; } } return isChinese; }