Join the social network of Tech Nerds, increase skill rank, get work, manage projects...
 

How to display phone book contacts in iphone through coding

The following code will present viewController which will show all the contacts of phone book Please do add Addressbook.framework in your code. Also import AddressBookUI file to use the following code. ABPeoplePickerNavigationController *pic...

Objective C coding style

Language US English should be used. Preferred: UIColor *myColor = [UIColor whiteColor]; Not Preferred: UIColor *myColour = [UIColor whiteColor]; Code Organization Use #pragma mark - to categorize methods in functional groupin...

How to save file in document dicretory

Following code will help you to add or delete file from document directory. -(NSString *)saveFileWithOldName:(NSString*)oldNameStr { NSArray *dirPaths; NSString *docsDirs; NSString *tempStr2; dirPaths = NSSearchPathForDire...

Communicating with server via API to get data

Occasionally the programmer needs to communicate with the server to send and receive data from the iPhone. Usually the communication is done to get data from the database that is in the server. To communicate with the server the programmer has to...

How to get Cookies from UIWebview

The following code will get the cookies form the sever and will store in the array. Get the appropriate cookie from the array by its name. - (void)webViewDidFinishLoad:(UIWebView *)webView { NSHTTPCookieStorage *storage = [NSHTTPCookie...

Send iOS App request on Facebook in iOS

In terms of publicity or advertisement of an iOS app there is a feature where we can make our iOS app social or can share on facebook. Accepting a request from a app will direct the person to the Canvas Page URL of the app that sent the Request....

Different location manager delegate methods of iOS 5 and iOS 6

The delegate method iOS 5 used was as follows -(void)locationManager:(CLLocationManager *)manager didUpdateToLocation:(CLLocation *)newLocation fromLocation:(CLLocation *)oldLocation This delegate method used to access two locations name...

SDWebImage Framework integration issue in Latest xCode

Download and Add framework Step 1: Download and unzip the lastest version here: SDWebImage.Framework Step 2: Right-click on the project navigator and select "Add Files to "Your Project": In the dialog, select SDWebImage.framework, and chec...

Create photos album on Facebook sample code in iOS

Creating Photos album and uploading photos into the album. Two methods mentioned below creates album and uploads gallery pic on Facebook. /*========================================================= // Here we request connectin for creating ...

Import Facebook friends list using Facebook SDK in iOS

Facebook friend list import became easier after using latest Facebook SDK. Here is the method which imports friend list. Steps to follow:- Create App in your Facebook account or open (https://developers.facebook.com/apps?ref=mb). Go to A...

Import Facebook friends using custom UI in iOS

Facebook friend list import became easier after using latest Facebook SDK. Here is the method which imports friend list. NSMutableArray *arrfriendList = [[NSMutableArray alloc]init]; [FBRequestConnection startForMyFriendsWithCompletionHandler...

Login with Facebook sample code for iOS

Facebook Login Button to logged into the iOS app, here we are getting logged into the iOS application using Facebook login button. Steps to follow:- Create App in your Facebook account or open (https://developers.facebook.com/apps?ref=mb)...

Login with Facebook using custom login button in iOS

Custom Facebook Login Button to logged into the iOS app. Now a days most of the iOS apps provides "Login with Facebook" feature. Facebook also provides SDK for iOS platform, here we are getting logged into the iOS application using Facebook cred...

How to validate that string is email address or not.

During User registration it is very necessary to check that entered email id is valid or not. To check that following code will help you. - (BOOL)validateEmailWithString:(NSString*)email { NSString *emailRegex = @"[A-Z0-9a-z._%+-...

How to use search bar in UITableView

This is very helpful, if you want to use search functionality on UITableView. Code for ViewController.h @interface ViewController : UIViewController<UISearchBarDelegate,UITableViewDataSource,UITableViewDelegate,UISearchDisplayDelegate&g...

How to save and access value from NSUserDefaults

NSUserDefaults is very useful, if you want to save less data and want to access that data whenever you open the application. This data does not delete even after closing the app. To save data in NSUserDefaults NSUserDefaults *usr = [NSUser...

To perform a real-time capture

To perform a real-time capture, a client may instantiate AVCaptureSession and add appropriate AVCaptureInputs, such as AVCaptureDeviceInput, and outputs, such as AVCaptureMovieFileOutput. [AVCaptureSession startRunning] starts the flow ...

Two different custom cells

Hi all, If you want to add two different xibs in a tableView you can check out the code here. - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { if (tableView==carTable) { ...

Customizing UISegmented Control having 3 segments

A segmented control is a tool which provides segments as buttons. Each segment can be programmed to perform an action. Usually it is required to customize or modify the appearance of the UISegmentedControl in order to make it look like the rest o...

arranging the images at the center of the iPhone screen

It might be required to display a large number of images having different sizes, one by one on the screen. To make it look neat, all the images should be aligned at the center of the screen, irrespective of their size. So fixing the coordinates o...

changing the size of the frame with image

To change the size of frame of the UIImageView as the image change can be done by getting the width and height of the UIImage. This can be done by declaring 2 float variables, storing the width and height of the image of the image in the respecti...

Message posting in GooglePlus IOS sdk

If you integrating Google plus in your IOS app and want to post some message you can use share dialog. To post message first create an object of GPPShareBuilder then you can set the text or url in this object like below example. id<GPPShare...

How to detect tapped word in UItextview

We might face a situation when we need to add action on tapping a particular word from a string on the iPhone screen like a link or a hashtag etc. Now though we can easily add a UITapGestureRecognizer on a UITextView or UILabel, finding the exact...

Posting on facebook through ios app

Hi all, If you want to share some useful information on facebook through iphone app then use this code. Download latest facebook SDK from https://developers.facebook.com/docs/ios/. #import <Social/Social.h> SLComposeViewCont...

How to show ActivityIndicator before image load in iPhone

Show activity Indicator before image loads using SDWebImage SDK. UIView *myView; UIImageView *imgView; UIActivityIndicatorView *indicator = [[UIActivityIndicatorView alloc] initWithActivityIndicatorStyle:UIActivityIndicatorViewStyleGray]; ...

Add Section Index Title search in one section of UITableVIew in iPhone

Add Title search on UItableVIew - (NSArray *)sectionIndexTitlesForTableView:(UITableView *)tableView { return [NSArray arrayWithObjects:@"A", @"B", @"C",@"D",@"E",@"F",@"G",@"H",@"I",@"J",@"K",@"L",@"M",@"N",@"O",@"P",@"Q",@"R",@"S",@"T",...

Show HTML formatted code on UIWebView in iPhone

Steps to create HTML file and display on UIWebView. Step1. Add New File -> Resource -> Rich Text File. Step2. Change .txt extension to .html. Step3. Enter your HTML code as written below. <html><head><style>{text-al...

Increase Label height according to Text in iPhone

On top header area #define kDefaultCellFont [UIFont fontWithName:@"HoboStd" size:10.0f] NSString *text = @"This is a simple example of the versatility of blocks, but the standard frameworks are chock-full of other use cases. NSArray lets yo...

Hide and Show TabBarController in iPhone

Sometimes we need to hide or show TabBarController from the bottom of the screen then we can just use following functions to do so... In AppDelegate or Singleton class for .h class :- - (void) showTabBar:(UITabBarController *) tabbarcontro...

Exchangeable Image File (EXIF)

Exchangeable Image File abbreviated as (EXIF) is a format that is standard for storing information in digital photographs. Almost all new digital cameras, including the cameras on the mobile phones use the EXIF annotation. The EXIF stores an arra...

How to make UITableView separator touch ends of table in iOS7

In iOS7 separator of table view do not touch ends of the table/cell ,i.e, the separator don't cover complete length of the table/cell. For this we need to set the separatorInset property of table view. For example if we have a UITableView object ...

Apple's substitute to bluetooth - AIRDROP

Apple's user have been bogged down by the lack of a file sharing mechanism that allows them to share files to the nearby apple users, just like bluetooth. So after a long time, apple computers have heard the plea of their users and provided them ...

Display UIWebView from HTML string with custom font and size

Following code can be used to change the font and size of UIWebView displayed from HTML string. To implement this first change the font and size of HTML string then load the UIWebView with this string like below. UIFont *font = [UIFont fontWit...

Get Location (Latitude and Longitude) of Gallery Image

If you are using ImagePickerController and wants to get selected Image location then use below code:- - (void) imagePickerController:(UIImagePickerController *)picker didFinishPickingMediaWithInfo:(NSDictionary *)info{ // Get the asset ...

Get Custom font name to be used in your xcode project

Sometimes we add custom fonts to our xcode project. For example:- Suppose TwCenMT-Bold.ttf is the font name which you have added to your xcode project, but when you access this font, it does not reflects. *Reason:- * This font does not cont...

Web Based Mobile Testing

Website: http://www.keynotedeviceanywhere.com/ Keynote's DeviceAnywhere platform provides an end-to-end solution for testing and monitoring of mobile apps and websites to ensure the quality, performance and uptime of your products and service...

New features introduced in iOS7

Apple has added many features to its iOS7 operating system. Few are mentioned below:- Story Board in iOS7 app will have to ask user's permission to access the mic. The user can use [NSArray firstObject]; just like lastObject in previous...

Hiding status bar in iOS 7

One of the changes in iOS 7 API's is hiding the status bar. Prior to iOS 7 we could hide status bar by using : [[UIApplication sharedApplication] setStatusBarHidden:YES]; But now there is a slight change. We need to add a row "View contr...

Some necessary information to publish the application to app store

To submit an application to the App Store, you need to create an iOS provisioning profile for distribution (App should be signed with these certificate) for that you have to be a member of the iOS Developer Program. Note: iTunes Connect does n...

Using different Storyboards for different iPhone sizes

If we are using storyboards we can handle different sizes by creating different storyboards for iPhone 4 and iPhone 5 and handle them in didFinishLaunching method of AppDelegate in this way : Here for iPhone 4 we have storyboard named "Main_iP...

How to delete elements from array while iterating or delete multiple elements from array simultaneously

Sometimes we may face a situation when we need to remove objects from an array while iterating through the same array. We cannot remove elements from the same array on which we are fast enumerating (for in loop). And if we use the traditional "fo...

How to check network availability in iPhone programmatically

We can easily find out network availability using CFNetwork.framework. Following method can be used for this task : -(BOOL)isNetworkAvailable { CFNetDiagnosticRef dReference; dReference = CFNetDiagnosticCreateWithURL (N...

Picker View

A picker view is a funky way to allow users to select one item from a group of items. It consists of a rotating wheel which contains the given options. The user can turn the wheel up or down by swiping motion and the option in front of the wheel ...

Create thumbnails from a UIImage

Hi there, often programmers are required to display a large number of images on a a single screen, for example in a photo gallery. Displaying a group of images in their full size can be a bit tricky because it will take a lot of space and the the...

Change Facebook Login button Image of facebook SDK in iPhone

Simple steps to change the default facebook login button image of facebook SDK. After downloading Facebook SDK and its bundle resources add them to your xcode project Step 1. Click on your xcode Navigator Framework folder then, Step 2. Cl...

Use SDWebImage SDK for image caching in Objective C

Best approach for Image loading in iOS apps Best way to load Images in iOS apps than image sync. Download SDWebImage framework and Unzip it. **Steps to follow**:- Step 1. Add SDWebImage framework into your project. On Project navigator Cl...

Create a data object class and use its properties by passing this object in Objective C

Access your data using class object. Steps to follow:- 1. Create a NSObject class called DataObject. 2. Declare properties as below... Write below code in DataObject.h file @interface DataObject : NSObject @property (strong, nonat...

MultipeerConnectivity in iOS 7

New framework introduced in iOS 7 1) MultipeerConnectivity.framework This framework help to communicate nearby iOS devices using following infrastructure a) wi-fi network b) peer to peer wifi 3) bluetooth This framework is used...

Barcode and QR Code Reader

Hi there, today we are going to make a really simple app that scans the Bar Codes and QR Codes using the camera of your iPhone and displays the data stored in the code. The very first thing that we have to do is download and install the ZBarSD...

selecting multiple rows in a UITableView

The UITableView is the most used tool by the iPhone developers to display various types of data in a neat, clean and easy to manage format. The programmer can search the cells for data, can arrange the data according to the users need by sorting ...
1 12
Sign In
                           OR                           
                           OR                           
Register

Sign up using

                           OR                           
Forgot Password
Fill out the form below and instructions to reset your password will be emailed to you:
Reset Password
Fill out the form below and reset your password: