我已将所有 uni-codes(表情符号字符)存储在 iphone 支持的 plist 中。当我直接写为
- (IBAction)sendButtonSelected:(id)sender {
NSMutableArray *emoticonsArray = [[NSMutableArray alloc]initWithObjects:@"\ue415",nil];
NSString *imageNameToPass = [NSString stringWithFormat:@"%@",[emoticonsArray objectAtIndex:0]];
NSLog(@"imageNameToPass1...%@",imageNameToPass);
messageTextView.text =imageNameToPass;
}
它在 textview 中显示表情符号,但只要我从 plist 中获取
NSString *plistPath1 = [[NSBundle mainBundle] pathForResource:@"unicodes" ofType:@"plist"];
NSDictionary *dictionary = [[NSDictionary alloc] initWithContentsOfFile:plistPath1];
activeArray= [dictionary objectForKey:categoryString];
NSLog(@"activeArray...%@",activeArray);
emoticonsArrayForHomeEmoji = [[NSMutableArray alloc]initWithCapacity:[activeArray count]];
for(int i=0; i<[activeArray count]; i++)
{
id objects = (id)[activeArray objectAtIndex:i];
[emoticonsArrayForHomeEmoji insertObject:objects atIndex:i];
}
NSString *imageNameToPass = [NSString stringWithFormat:@"%@",[emoticonsArrayForHomeEmoji
objectAtIndex:0]];
NSLog(@"imageNameToPass1...%@",imageNameToPass);
messageTextView.text =imageNameToPass;
然后它在文本视图中将 unicode 显示为文本 \ue415 而不是表情符号。
我做错了什么?请帮帮我!