Core Data’s NSPrivateQueueConcurrencyType and sharing objects between threads

When you use NSPrivateQueueConcurrencyType you need to do anything that touches that context or any object belonging to that context inside the -performBlock: method. Your code above is illegal since you’re passing those objects back to the main queue. The new API helps you in solving this, though: You create one context that’s associated with … Read more

Storyboard static cells: dequeueReusableCellWithIdentifier returns nil

With static content in a table view, you do not implement any of the datasource methods (including tableView:cellForRowAtIndexPath:, so you would never dequeue the cells. There is no dequeuing for static content (that you can get involved in, anyway). If you want to get a pointer to a particular cell: get it from the table … Read more

How to add a image in email body using MFMailComposeViewController

Set email format as HTML. This code is woking fine in my app. MFMailComposeViewController *emailDialog = [[MFMailComposeViewController alloc] init]; NSString *htmlMsg = @”<html><body><p>This is your message</p></body></html>”; NSData *jpegData = UIImageJPEGRepresentation(emailImage, 1.0); NSString *fileName = @”test”; fileName = [fileName stringByAppendingPathExtension:@”jpeg”]; [emailDialog addAttachmentData:jpegData mimeType:@”image/jpeg” fileName:fileName]; emailDialog setSubject:@”email subject”]; [emailDialog setMessageBody:htmlMsg isHTML:YES]; [self presentModalViewController:emailDialog animated:YES]; [emailDialog release]; Swift … Read more

iOS 5: How to convert an Emoji to a unicode character?

Please try this : Convert Emoji to unicode NSData *data = [strEmo dataUsingEncoding:NSNonLossyASCIIStringEncoding]; NSString *goodValue = [[NSString alloc] initWithData:data encoding:NSUTF8StringEncoding]; Very easy to convert unicode to Emoji NSData *data = [strEmo dataUsingEncoding:NSUTF8StringEncoding]; NSString *goodValue = [[NSString alloc] initWithData:data encoding:NSNonLossyASCIIStringEncoding];