// // CCEmoji.m // CCFC // // Created by xichen on 11-12-23. // Copyright 2011 ccteam. All rights reserved. // #import "CCEmoji.h" #import "CCUITextView.h" @implementation CCEmoji // returns a textView that contains nearly all the emojis + (UITextView *)returnAllEmojiTextView { NSMutableString *s = [[NSMutableString alloc] initWithString: @"This is a smiley \ue415 \ue533 face\n"]; // ee8081 ~ ee94b7 unsigned char str[] = {0xee, 0x80, 0x80, 0}; unsigned char secondByte[] = {0x80, 0x81, 0x84, 0x85, 0x88, 0x89, 0x8c, 0x8d, 0x90, 0x91, 0x94}; int secondByteLen = sizeof(secondByte) / sizeof(secondByte[0]); NSLog(@"secondByteLen is %d", secondByteLen); for(int j = 0; j < secondByteLen; ++j) // get nearly all emoji info { str[1] = secondByte[j]; if(str[1] == (unsigned char)0x80) { for(int i = 1; i <= (0xbf - 0x80); ++i) { str[2] += (unsigned char)i; [s appendFormat:@"0xee%x%x:", (int)str[1], (int)str[2]]; [s appendString:[NSString stringWithUTF8String:(const char *)str]]; [s appendString:@"\r"]; str[2] = 0x80; } } if(str[1] == (unsigned char)0x81) { for(int i = 0; i <= (0x9a - 0x80); ++i) { str[2] += (unsigned char)i; [s appendFormat:@"0xee%x%x:", str[1], str[2]]; [s appendString:[NSString stringWithUTF8String:(const char *)str]]; [s appendString:@"\r"]; str[2] = 0x80; } } if(str[1] == (unsigned char)0x84 || str[1] == (unsigned char)0x8c || str[1] == (unsigned char)0x90) { for(int i = 1; i <= (0xbf - 0x80); ++i) { str[2] += (unsigned char)i; [s appendFormat:@"0xee%x%x:", str[1], str[2]]; [s appendString:[NSString stringWithUTF8String:(const char *)str]]; [s appendString:@"\r"]; str[2] = 0x80; } } if(str[1] == (unsigned char)0x85) { for(int i = 0; i <= (0x9a - 0x80); ++i) { str[2] += (unsigned char)i; [s appendFormat:@"0xee%x%x:", str[1], str[2]]; [s appendString:[NSString stringWithUTF8String:(const char *)str]]; [s appendString:@"\r"]; str[2] = 0x80; } } if(str[1] == (unsigned char)0x88) { for(int i = 1; i <= (0xbf - 0x80); ++i) { str[2] += (unsigned char)i; [s appendFormat:@"0xee%x%x:", str[1], str[2]]; [s appendString:[NSString stringWithUTF8String:(const char *)str]]; [s appendString:@"\r"]; str[2] = 0x80; } } if(str[1] == (unsigned char)0x89) { for(int i = 0; i <= (0x93 - 0x80); ++i) { str[2] += (unsigned char)i; [s appendFormat:@"0xee%x%x:", str[1], str[2]]; [s appendString:[NSString stringWithUTF8String:(const char *)str]]; [s appendString:@"\r"]; str[2] = 0x80; } } if(str[1] == (unsigned char)0x8d) { for(int i = 0; i <= (0x8d - 0x80); ++i) { str[2] += (unsigned char)i; [s appendFormat:@"0xee%x%x:", str[1], str[2]]; [s appendString:[NSString stringWithUTF8String:(const char *)str]]; [s appendString:@"\r"]; str[2] = 0x80; } } if(str[1] == (unsigned char)0x91) { for(int i = 0; i <= (0x8c - 0x80); ++i) { str[2] += (unsigned char)i; [s appendFormat:@"0xee%x%x:", str[1], str[2]]; [s appendString:[NSString stringWithUTF8String:(const char *)str]]; [s appendString:@"\r"]; str[2] = 0x80; } } if(str[1] == (unsigned char)0x94) { for(int i = 1; i <= (0xb7 - 0x80); ++i) { str[2] += (unsigned char)i; [s appendFormat:@"0xee%x%x:", (int)str[1], (int)str[2]]; [s appendString:[NSString stringWithUTF8String:(const char *)str]]; [s appendString:@"\r"]; str[2] = 0x80; } } } UITextView *textView = [UITextView createCommonTextView:CGRectMake(0, 60, 320, 260) withText:s]; [s release]; return textView; } @end
googlecode链接地址(会有更新):http://code.google.com/p/iphone-common-codes-ccteam/source/browse/trunk/CCFC/files/CCEmoji.m
发表评论
-
iphone-common-codes-ccteam源代码 CCEncoding.h
2012-01-12 09:55 646// // CCEncoding.h // C ... -
iphone-common-codes-ccteam源代码 CCEmoji.h
2012-01-12 09:53 664// // CCEmoji.h // CCFC ... -
iphone-common-codes-ccteam源代码 CCDylib.m
2012-01-12 09:52 651// // CCDylib.m // CCFC ... -
iphone-common-codes-ccteam源代码 CCDylib.h
2012-01-12 09:51 710// // CCDylib.h // CCFC ... -
iphone-common-codes-ccteam源代码 CCDepend.m
2012-01-11 10:17 646// // CCDepend.m // CCF ... -
iphone-common-codes-ccteam源代码 CCDepend.h
2012-01-11 10:17 692// // CCDepend.h // CCF ... -
iphone-common-codes-ccteam源代码 CCDelete.h
2012-01-11 10:15 635// // CCDelete.h // CCF ... -
iphone-common-codes-ccteam源代码 CCDelete.m
2012-01-11 10:14 674// // CCDelete.m // CCF ... -
iphone-common-codes-ccteam源代码 CCDebug.h
2012-01-11 10:14 658// // CCFileUtil.h // C ... -
iphone-common-codes-ccteam源代码 CCContact.m
2012-01-10 09:41 915// // CCContact.m // ... -
iphone-common-codes-ccteam源代码 CCConfig.m
2012-01-10 09:39 604// // CCConfig.m // CCF ... -
iphone-common-codes-ccteam源代码 CCConfig.h
2012-01-10 09:37 741// // CCConfig.h // CCF ... -
iphone-common-codes-ccteam源代码 CCCompile.m
2012-01-10 09:36 565// // CCCompile.m // CC ... -
iphone-common-codes-ccteam源代码 CCCompile.h
2012-01-08 10:48 570// // CCCompile.h // CC ... -
iphone-common-codes-ccteam源代码 CCCommon.m
2012-01-08 10:47 521// // CCCommon.m // CCF ... -
iphone-common-codes-ccteam源代码 CCCommon.h
2012-01-08 10:46 571// // CCCommon.h // CCF ... -
iphone-common-codes-ccteam源代码 CCCamera.m
2012-01-08 10:45 639// // CCCamera.m // CCF ... -
iphone-common-codes-ccteam源代码 CCCamera.h
2012-01-08 10:44 750// // CCCamera.h // CCF ... -
iphone-common-codes-ccteam源代码 CCCALayer.m
2012-01-07 10:13 598// // CCCALayer.m // CC ... -
iphone-common-codes-ccteam源代码 CCCALayer.h
2012-01-07 10:11 576// // CCCALayer.h // CC ...
相关推荐
github-recovery-codes.txt
codes = """--..-- .-.-.- ----- .---- ..--- ...-- ....- ..... -.... --... ---.. ----. ..--.. .- -... -.-. -... . ..-. --. .... .. .--- -.- .-.. -- -. --- .--. --.- .-. ... - ..- ...- .-- -.
在"threejs-3d-fly-codes_jb51"文件夹中,我们通常会看到以下核心文件: 1. index.html:这是项目的主页面,包含HTML结构和JavaScript脚本引用。 2. main.js:主要的JavaScript代码,实现3D场景的创建和动画逻辑。 ...
LearningMATLAB-All_Statistics_Codes.zip All_Statistics_Codes.zip MatlabLearn.pdf
LearningMATLAB-All_Various_Codes.zip All_Statistics_Codes.zip MatlabLearn.pdf
这个“activiti-in-action-codes-master.zip”压缩包包含了与《Activiti in Action》这本书配套的源代码,帮助读者深入理解Activiti的工作原理和实践应用。 首先,让我们了解什么是BPMN 2.0。Business Process ...
标题中的"Ch-2.-Matlab-Codes.rar_NLS_TOA_single"暗示这是一组MATLAB代码,专门用于非线性最小二乘(NLS)方法在单次试验中的到达时间(TOA)定位问题。非线性最小二乘法是一种优化技术,常用于解决在数据拟合过程...
在给定的压缩包文件“CSR-bc5-Source-Codes.rar”中,包含了CSR BC5的相关源代码,这对于开发者来说是极其宝贵的资源,可以深入了解CSR BC5的工作原理,并进行定制化开发。 CSR BC5是基于ADK (Application ...
No_Description_Self-Driving-Car-Course-Codes
单bit错误校正,多bit错误检测的ECC算法论文;比传统的Hamming更加简洁、高效。
下面我们将详细探讨标题为"Ongoing-ns-2-codes.zip_sample tcl"的压缩包中的TCL样本代码及其相关知识点。 一、NS2基本概念 1. 模块化设计:NS2由一系列模块组成,包括节点(nodes)、网络接口(interfaces)、...
标题中的"Clinic-Management-PHP-MySQL-Source-Codes.zip_clinic_clinic php"表明这是一个基于PHP和MySQL开发的诊所管理系统源代码包。这个系统主要用于管理医疗诊所的日常运营和患者服务。从描述中我们可以了解到,...
标题 "jquery-select-auto-complete-codes.rar" 涉及的是一个使用JQuery实现的自动完成功能,特别针对搜索框的交互设计。JQuery是一个广泛使用的JavaScript库,它简化了DOM操作、事件处理、动画效果以及Ajax交互。在...
### 低密度奇偶校验码(Low-Density Parity-Check Codes,简称LDPC码) #### 引言 在1963年,罗伯特·G·加勒格在其博士论文中首次提出了低密度奇偶校验码的概念。这篇论文不仅为通信工程领域带来了重大的突破,...
目录 Invited Talks.- Understanding and Inductive Inference.- Computing with Cells: Membrane... Zero-Knowledge Argument for Simultaneous Discrete Logarithms.- Directed Figure Codes: Decidability Frontier.
南京大学“开源仓库代码挖掘和可视化”创新项目代码_Git-Repository-Miner-Codes
实验四-代码-UAV-AmBC-TWC-simulation codes.zip
- **克尔多克码(Kerdock Codes)**与**预备拉塔码(Preparata Codes)**:这两类码具有良好的非线性性质,适合于某些特定的应用场景。 - **自对偶码(Self-Dual Codes)**:这类码具有独特的数学性质,在编码理论中占有...
在【压缩包子文件的文件名称列表】"M.Tech-Computer-F.Y.-Common-Codes-main"中,"main"可能指的是主目录或主要代码库,可能包含子目录和不同主题的Python代码文件。这些文件可能是按课程单元或项目分类的,每个文件...
Website_for_pid_codes.7z