Reading version from info.plist file in iphone development

We can read our info plist file as Dictionary ,here is the code for reading version number for your application.

NSDictionary *infoPlist = [NSBundle mainBundle]infoDictionary];

we stored info.Plist file as dictionary value, now we read version number from that

NSString *VersionNum = [infoPlist objectForKey:@”CFBundleVersion”];

i hope that this might be useful, thanks in advance for your feedback and queries.

home Button and Lock Button Event Handling in iPhone development

when you are developing game or app in ios, you should handle these events ,users may press HOME button or LOCK button ,or your application may get interrupted during call ,SMS . Now i hope that you understand the reason why we should handle that ,for this problem apple has some delegate functions in app delegate
               this method invokes when application enters background(HOME button pressed).
              this method invokes when application become active and about to start running your app.
              this method invokes when application resigns active.
             this method invokes when your app comes to foreground.
these methods are life cycle codes in iphone development.
expecting your feedback.Thank you

CoreLocation tutorial in iphone development

Implementing Built-in GPS in your app, it gives more advantage to you and users feel more comfortable with your apps, in ios development implementing this ,is very simple . Apple has powerful framework to do this,namely CoreLocation frameWork.But one thing is if you didnt properly use this methods,it would consume more power, so you have to do it properly,shutdown it as procedure,by doing this CoreLocation framework would consume less power, now we have look at this framework.

Since we’re going to be using Core Location with our iOS app, we need to add the header file (CoreLocation/CoreLocation.h) to our prefix header (usually with the extension .pch). In this prefix header, locate the #ifdef __OBJC__ line,

#ifdef __OBJC__



    #import  // added for Core Location



Next step is add CoreLocation framework in your right click on frameworks->add existing framework->CoreLocation frameWork,


this framework has some important delegate methods,


We need to implement two important delegates in our class where we want to get messages ,


(void)locationManager🙁CLLocationManager *)manager didUpdateToLocation🙁CLLocation *)newLocation fromLocation🙁CLLocation *)oldLocation


this method will be called when new location messages recieved..


(void)locationManager🙁CLLocationManager *)manager didFailWithError🙁NSError *)error


This Delegate will be invoked if corelocation needs to report us failure messages,


Next we need to store the data where we currently located, for this add these two lines in @interface definition file.


@property (strong, nonatomic) CLLocationManager *locationManager;

@property (strong, nonatomic) CLLocation *currentLocation;


and add this line in @implementation file


@synthesize locationManager, currentLocation;





(void)locationManager🙁CLLocationManager *)manager didUpdateToLocation🙁CLLocation *)newLocation fromLocation🙁CLLocation *)oldLocation {

    self.currentLocation = newLocation;


    if(newLocation.horizontalAccuracy <= 100.0f) 


         [locationManager stopUpdatingLocation]





– (void)locationManager:(CLLocationManager *)manager didFailWithError:(NSError *)error {

    if(error.code == kCLErrorDenied) {

        [locationManager stopUpdatingLocation];

    } else if(error.code == kCLErrorLocationUnknown) {

        // retry

    } else {

        UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@”Error retrieving location”

                              message:[error description]




        [alert show];






to setup corelocation you need to add these two line.


locationManager = [[CLLocationManager alloc] init];

locationManager.delegate = self;

[locationManager startUpdatingLocation];


Thats it,

I hope that this article might be useful, post your reviews and feedback below here to improve my skills.

best blogs ,sites and resources for iphone development

              From this site, you can sign up for the developer program and download the necessary tools required to build iPhone apps. There is a developer fee of $99/annually in order to submit your newly built creations to have them appear on the app store, but you can download the tools and play around with them with a free account.

                iPhone Dev SDK is a community for software developers interested in the iPhone SDK platform. Founded in March 2008, iPhone Dev SDK was one of the first communities for this revolutionary new platform.

What separates iPhone Dev SDK from the others is the friendly atmosphere the community provides for developers of all abilities. Whether you’ve been programming your entire life or are just now getting interested, you’ll find yourself welcomed to the community.

      features some of the best tutorials on the web, both on beginning and more advanced development concepts. It should get the novice beginner off to a good start as well as teach the established user a few things about parts of the API that they may have not explored yet. The blog is updated on a regular basis and would make a great addition to any iPhone developer’s bookmarks.

         Go through this site to earn more money with free apps with ad integration .

            useful one for tracking your application sales and graph .

getting ip address in iphone development

NSString*  ip=@“”;

NSURL *url = [[NSURL alloc] initWithString:ip];

NSString *ans = [NSString stringWithContentsOfURL:url encoding:NSASCIIStringEncoding error:&error];


one more method



Import UIDevice-Reachability.h in your project then try with one of those commands:

NSString *myIp = [UIDevice localIPAddress];

NSString *myIp = [UIDevice localWiFiIPAddress];

NSString *myIp = [UIDevice whatismyipdotcom];


How to get country name and country code in iOS development

  NSLocale *locale = [NSLocale currentLocale];

    NSString *countryCode = [locale objectForKey: NSLocaleCountryCode];


    NSString *countryName = [locale displayNameForKey: NSLocaleCountryCode

                                                                             value: countryCode]];

use this string for your use..

there is a drawback in this code ..this will not return string in english it returns that string in device language what user used in device,,, to get string alwys in english

use this code 


NSLocale *locale = [NSLocale currentLocale];

NSString *countryCode = [locale objectForKey: NSLocaleCountryCode];

NSLocale *usLocale = [[[NSLocale alloc] initWithLocaleIdentifier:@“en_US”] autorelease];

NSString *country = [usLocale displayNameForKey: NSLocaleCountryCode value: countryCode];

Binary Search

Binary Search in C Programming Following program explains binary Search:
Binary Search finds the position of a given value from an array .
It starts with the middle element of the list.
1. If the middle element of the list is equal to the ‘input key’ then we have found the position the specified value.
2. Else if the ‘input key’ is greater than the middle element then the ‘input key’ has to be present in the last half of the list.
3. Or if the ‘input key’ is lesser than the middle element then the ‘input key’ has to be present in the first half of the list.

int main(){
int a[10],i,n,m,c,l,u;
printf(“Enter the size of an array: “);
printf(“Enter the elements of the array: ” );
printf(“Enter the number to be search: “);
printf(“Number is not found.”);
printf(“Number is found.”);
return 0;
int binary(int a[],int n,int m,int l,int u){
int mid,c=0;
else if(m<a[mid]){
return binary(a,n,m,l,mid-1);
return binary(a,n,m,mid+1,u);
return c;

Bubble Sort

Bubble Sort in C Programming

int arr[20];
int n;
void get();
void BubbleSort();
void Show();

void main(){
printf(“- This Program Explains Sorting Using Bubble Sort Algorithm -\n\n”);

void get(){
int i;
printf(“Enter the size of the elements :\n”);
printf(“Sorry the maximum no of elements is 20\n\n”);
printf(“Enter the values \n”);

void BubbleSort(){
int i,j;


if(arr[j]>arr[j+1]){      //for descending use “<”

int t;





void Show(){
int i;
printf(“Sorted Array Elements\n”);