iOS Development is easy with XCode, Swift3, UITableView, cocatouch, let's build iPhone, iPad and Macbook Applications.

Always pass weak reference of self into block in ARC?

I am a little confused about block usage in Objective-C. I currently use ARC and I have quite a lot of blocks in my app, currently always referring to self instead of its weak reference. May that be the cause of these blocks retaining self and keeping it from being dealloced ? The question is, […]

UILabel – string as text and links

I have a UILabel whose text I am getting from a server. Some of the text is to be identified as links, and on touching those links some action should be performed. e.g. NSString *str = @”My phone number is 645-345-2345 and my address is xyz”; This is the complete text for UILabel. I have […]

Convert string to date in my iPhone app

I have made a calendar application for the iPhone in which I have a date in string format (e.g. “Tue, 25 May 2010 12:53:58 +0000”). I want to convert this to an NSDate. What do I need to use to do that?

Create and and export an animated gif via iOS?

I have a series of user-customized images within an iOS app that are being animated in a simple, frame-by-frame flip book style. My question is this: is there a way to allow users to export their animation as an animated gif? Ideally, I’d like to enable them to email, social share (T/FB) or (worst case..) […]

iOS7 UITextView contentsize.height alternative

I’m porting one of apps from iOS 6.1 to iOS 7. I’m using a layout where there’s a UITextView that has a fix width, but it’s height is based on its contentsize. For iOS 6.1 checking the contentsize.height and setting it as the textview’s frame height was enough, but it doesn’t work on iOS 7. […]

How do you add an in-app purchase to an iOS application?

How do you add an in-app purchase to an iOS app? What are all the details and is there any sample code? This is meant to be a catch-all of sorts for how to add in-app purchases to iOS apps

IOS 7 Navigation Bar text and arrow color

I want to set background for Navigation Bar to be black and all colors inside it to be white. So, I used this code : [[UINavigationBar appearance] setTitleTextAttributes: [NSDictionary dictionaryWithObjectsAndKeys: [UIColor whiteColor], NSForegroundColorAttributeName, [UIColor whiteColor], NSForegroundColorAttributeName, [NSValue valueWithUIOffset:UIOffsetMake(0, -1)], NSForegroundColorAttributeName, [UIFont fontWithName:@”Arial-Bold” size:0.0], NSFontAttributeName, nil]]; But back button text color, arrow and bar button have […]

Reading and writing images to an SQLite DB for iPhone use

I’ve set up a SQLite DB that currently reads and writes NSStrings perfectly. I also want to store an image in the database and recall it later. I’ve read up a bit on using NSData and encoding the image, but I’m not entirely sure what the syntax is for what I want to do. Any […]

GCM Notifications not receiving when app is in background mode in iOS

I have configured GCM in my existing app and i am receiving the notifications there. Now i am facing two problem: 1) I am not receiving notifications When i exit the application or application is in the background. 2) I am not receiving notification in iphone’s notification area, only when my app is running i […]

iOS Image Orientation has Strange Behavior

For the past few weeks I’ve been working with images in objective-c and noticing a lot of strange behavior. First, like many other people, I’ve been having this problem where images taken with the camera (or taken with somebody else’s camera and MMS’d to me) are rotated 90 degrees. I wasn’t sure why in the […]