Ive been trying to find a solution to my problem all day with no success. I know its probably something silly since I am still new to OBjective C so heres my issue.
I'm trying to implement unicode Emoji Characters into a UILabel. So lets take it one step at a time.
Here is the Json String I am using:
"body":"\\U0001f61f \\U0001f62e \\U0001f621"
As you can see the Json Serializer im using escapes the unicode. I suspect this is my main problem.
I am retrieving the data like so:
dispatch_queue_t queue = dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_HIGH, 0ul);
dispatch_async(queue, ^{
[UIApplication sharedApplication].networkActivityIndicatorVisible = YES;
NSString *concat=[NSString stringWithFormat:@"MYURL?ID=%@",_TID];
NSURL *url = [NSURL URLWithString:concat];
NSData *jsonData=[NSData dataWithContentsOfURL:url];
dispatch_async(dispatch_get_main_queue(), ^{
if (jsonData!=nil) {
newX= [[NSJSONSerialization JSONObjectWithData:jsonData options:NSJSONReadingMutableLeaves error:nil]mutableCopy];
pageCounter=2;
[self.topicView reloadData];
[UIApplication sharedApplication].networkActivityIndicatorVisible = NO; }
[loadingView
performSelector:@selector(removeView)
withObject:nil
afterDelay:1];
});
});
After some time later the data is called and added to the UILabel.
UILabel *emo=(UILabel*)[Tcell viewWithTag:6];
NSString*body=[[[newX objectAtIndex:indexPath.row] valueForKey:@"body"] mutableCopy];
emo.text=body;
Which just gives me \U0001f61f \U0001f62e \U0001f621 as text. I know its probably just an encoding issue but I have no idea where to attack this.
Any help would be appreciated. :)