Category Archives: Objective-C

Create a date in your format in IOS

By | December 31, 2014

Below functions takes the current date and time and formats it to give a date-time string. You can customise it in the way you want. The string that the below function generates will be like this – 23-Dec-2014 4:23 PM Use “MMMM” for “December” and “MMM” for “Dec” in month.

Creating Tabs dynamically in ios with dynamic tab controller.

By | November 30, 2014

This article covers how do you create a tab based application in an ISOS Application. At first you Create a new Project and Click on Single View Application and name it accordingly. After creation of the project, open the storyboard and you can see a single view controller which is connected to class ViewController. Just… Read More »

Making a GridView in iOS using UICollectionView.

By | November 23, 2014

Hey all, In Today’s article you will study about the implementation of UICollectionView in iOS. It is similar to GridView in Android. First drag a UICollectionView [Not the Collection View Controller] in your interface and let it be there. we will come back to it later. We are going to create a UICollectionView with custom… Read More »

Download an image with ProgressBar in iOS

By | November 17, 2014

Hi all, Today I will show you how you can download an image showing complete progress. Make sure that you have an interface like the below image. You should link all the interface views with the corresponding variables in ViewController.h ViewController.h ViewController.m You can download the complete source code from here.

Creating a Custom Alert or PopUp in iOS

By | November 15, 2014

First we will write a class that extends UIView to create a Custom PopUp Create a Cocoa file and name it CustomPopUp You should get two files CustomPopUp.h and CustomPopUp.m CustomPopUp.h CustomPopUp.m I have a sample interface like this. Now the ViewController.m MAKE SURE YOU HOOK UP THE BUTTONS TO THEIR CORRESPONDING FUNCTIONS. You can… Read More »

NSURLConnection – A Simple example – Upload image to server using POST method.

By | November 13, 2014

Make sure you setup the server and have gone through this post before reading this article. You can read more about NSURLConnection Class from here. https://developer.apple.com/library/mac/documentation/Cocoa/Reference/Foundation/Classes/NSURLConnection_Class/index.html#//apple_ref/occ/instm/NSURLConnection/ Here In this article I am going to select an image from the gallery and upload to a server using 1. Synchronous method 2. Asynchronous method – different ways.… Read More »

Select an image from Gallery and show it in an ImageView in ios.

By | November 11, 2014

Hey all, This is a simple post showing how you can open the “Gallery” or “Photos” application in iOS. ViewController.m ViewController.m We add “UINavigationControllerDelegate,UIImagePickerControllerDelegate” to get the events after selecting the image from the Gallery. The below function is called after selecting image from Gallery – (void) imagePickerController:(UIImagePickerController *)picker didFinishPickingImage:(UIImage *)image editingInfo:(NSDictionary *)editingInfo You can… Read More »

Send Data to server in iOS using POST OR GET – A Simple Example

By | November 9, 2014

First Make sure you have this kind of layout and you have linked all the views to their respective variables. For server side I am using XAMPP for Localhost for now and My php file will be residing in Applications ▸ XAMPP ▸ xamppfiles ▸ htdocs You can download “XAMPP For Mac” from this link.… Read More »

Customizing UITableView using “Prototype Cells” in iOS.

By | November 3, 2014

Hi all, In today’s tutorial we will study how we can customize a UITableView using “Prototype Cells” in iOS which was introduced in XCode 5.0. First Create a new Project and Name it “CustomTBLView”. Now you will get the Main.storyBoard file with other ViewController and Delegate Files. Open Main.storyBoard and “Drag” a TableView on to… Read More »

Handling Files in iOS

By | October 29, 2014

Hi All, In Todays article we will see how we can handle files in Objective C. The list of the methods used for accessing and manipulating files are listed below. Here you have to replace the FilePath1, FilePath2 and FilePath strings to our required full file paths to get the desired action. Comparing two file… Read More »

How to download an image from a URL in Objective C iPhone?

By | February 15, 2014

This method downloads the image from the specified URL and stores in the documents directory and then shown in an ImageView. Make sure you have an imageview linked with the outlet in the UserInterface. Please leave your comments if you found this code useful.

How to create a radioGroup in Android inside a Scrollview?

By | February 14, 2014

Here is a sample code that creates a radiobutton group inside a scrollview. Please make sure you have a scrollview in your UI and its linked. // This function adds the radio buttons inside the scrollview. Here I am using some of my variables to generate the count of radio buttons. Please make sure to… Read More »

Apple fined by China court for copyright violation

By | December 28, 2012

A court in China has ordered Apple to pay compensation to eight Chinese writers and two companies for violating their copyrights. They had claimed that unlicensed electronic versions of their books had been sold on Apple’s online store. The court ordered Apple to pay them 1.03m yuan ($165,000; £100,000) in compensation, according to the official… Read More »

How to find your Google Plus ID

By | September 27, 2012

This is so simple 1. Go to your Google + account (https://plus.google.com/). 2. Click on the Profile icon on the Left. 3. If you look at the URL in the address bar, it should look something like this: https://plus.google.com/104653270154306099169/posts 4. The long numerical string in the URL is your Google+ ID. Here is CoderzHeaven’s from… Read More »

How to move a body manually in Box2D? or Give a force to a body in Box2D, iPhone.

By | April 28, 2012

This is a sample code to move a body in Box2D . First you have to make a body with variable name “moving_rec” and call the below function in a schedular at regular intervals. -(void) moveBody{ b2Vec2 force = b2Vec2(0,0); force = b2Vec2(0,3); //Giving the x an y to negative will move the body in… Read More »