Category Archives: Objective-C
Programatically Set Autolayout Constraints in iOS.
Create a date in your format in IOS
Creating Tabs dynamically in ios with dynamic tab controller.
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 drag a place… Read More »
Making a GridView in iOS using UICollectionView.
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 Cells. So for… Read More »
What is @property in iOS mean?
The goal of @property directive in iOS is to create the getters and setters for that object so that you can access it in your program. It allows you to specify the behavior of a public property on a semantic level, and it takes care of the implementation details for you. This article also tells how you can… Read More »
Download an image with ProgressBar in iOS
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
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 download the complete… Read More »
NSURLConnection – A Simple example – Upload image to server using POST method.
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. First you have… Read More »
Select an image from Gallery and show it in an ImageView in ios.
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 download the complete… Read More »
Send Data to server in iOS using POST OR GET – A Simple Example
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. When copying this… Read More »
StoryBoards in iOS – A Simple Example
Hey everyone, Today we will see how we can use storyboards in an application. First we will Create a sample project named “StoryBoardDemo” Now we will Add the Navigation Controller For that Go To Menu -> Editor >Embed In -> NavigationController Now Double Click on the Title Bar and Add the title “Companies” Now Drag a table View… Read More »
Localhost for Android Emulator and iPhone Simulator.
If you are trying to access a file (PHP or java) residing in your server in your own machine, then you have to use a specific IP to access it. If it is public, then use the other System’s IP 1. If it is localhost, In Android you use it as 10.0.2.2 The localhost refers to the device… Read More »
Open Camera, Take Photo, Save it, Load it – iOS Sample code
Customizing UITableView using “Prototype Cells” in iOS.
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 it. Now Drag… Read More »
Handling Files in iOS
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 contents Check if… Read More »
How to add info button to right side or leftside of navigationbar in iPhone?
Random Integer array without repetition in Objective C Iphone
How to download an image from a URL in Objective C iPhone?
How to create a radioGroup in Android inside a Scrollview?
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 change it before… Read More »
How to split a string using a delimiter in iPhone and add it to a mutable array?
Apple fined by China court for copyright violation
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 news agency Xinhua.… Read More »
How to find your Google Plus ID
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 the URL above:… Read More »
How to move a body manually in Box2D? or Give a force to a body in Box2D, iPhone.
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 opposite direction. moving_rec->SetLinearVelocity(force);… Read More »