How to use iPhone contacts in your own application

In this how to series, I have come up with yet another code snippet, which allows you to use iPhone’s contact data into your own application. The code is: -(void)retrieveContactList { ABAddressBookRef myAddressBook = ABAddressBookCreate(); NSArray *allPeople = (NSArray *)ABAddressBookCopyArrayOfAllPeople(myAddressBook); contactList = [[NSMutableArray alloc]initWithCapacity:[allPeople count]]; for (id record in allPeople)…

Merging two images in objective-c

While researching about image manipulation for my next project, I came across an interesting piece of code, using which, we can merge two images into a single image. Here’s the code: -(UIImage*)mergeImage:(UIImage*)mask overImage:(UIImage*)source inSize:(CGSize)size{ //Capture image context ref UIGraphicsBeginImageContext(size); [self.view.layer renderInContext:UIGraphicsGetCurrentContext()]; UIImage *viewImage = UIGraphicsGetImageFromCurrentImageContext(); UIGraphicsEndImageContext(); //Draw images onto the…