我正在聊天應用程序中使用表情符號。從iOS中的UILabel的Unicode顯示錶情符號
當有人給我發送表情符號時,它看起來像這樣: - Hello...(worried) how are you(happy)?
。這裏爲(worried)and (happy)
指定了emojis的密鑰。
這是列表emojis和鍵和值。
dictemoji = [NSMutableDictionary dictionaryWithObjectsAndKeys:
@"worried-48.gif",@"(worried)",
@"sad-48.gif",@"(sad)",
@"bandit48.gif",@"(bandit)",
@"wink48.gif",@"(wink)",
@"surprised48.gif",@"(surprised)",
@"smirking48.gif",@"(smirking)",
@"laugh48.gif",@"(laugh)",
@"cool48.gif",@"(cool)",
@"stoned-48.gif",@"(stoned)",
@"smile-48.gif",@"(smile)",
@"nerd-48.gif",@"(nerd)",
@"happy-48.gif",@"(happy)",
@"evil-grin-48.gif",@"(evil-grin)",
@"tongue48.gif",@"(tongue)",
@"lips-sealed-48.gif",@"(lips-sealed)",
@"GIF48.gif",@"(GIF)",
@"dull48.gif",@"(dull)",
nil];
當我收到消息Hello...(worried) how are you(happy)?
我想看到我的表情符號,而不是(擔心)和(高興)的標籤。
那麼我怎麼能把表情符號而不是這些單詞?
編輯: - 當有人送我的表情符號與文字訊息,它會與詞典值替換:
for (NSString *emojiKey in dictemoji.allKeys)
{
if ([message containsString:emojiKey])
{
message = [message stringByReplacingOccurrencesOfString:emojiKey withString:[dictemoji valueForKey:emojiKey]];
}
}
// helllo(sad)...how are you(smile)...? ----->it will look like helllo(sad-48.gif)...how are you(smile-48.gif)...?
NSLog(@"message updated:%@",message);
cell.textLabel.text=message;
所以,我想顯示的表情符號,其中(SAD-48.gif)和(smile-48.gif)印在標籤上。
@ChintaN謝謝..我已經檢查過這個鏈接,但這不是我所要求的。 –