IP_Address Check In iPhone

We will see in this example how to check IP Address in the iPhone. You can get easily the IP Address using this application.

Step 1: Create a View-base application using template . Give the application name IP Address Check.

Step 2: Xcode automatically creates the directory structure and adds essential frameworks to it. You can explore the directory structure to check out the content of the directory.

Step 3: Expand classes and notice Interface Builder created the IP_Address_CheckViewController class for you. Expand Resources and notice the template generated a separate nib,IP_Address_CheckViewController.xib for the IP_Address_CheckViewController.

Step 4: Open IP_Address_CheckViewController , add an UITextView for displaying the text . Make the following changes in the IP_Address_CheckViewController.h file.

 

 

 

Step 5: Double click the IP_Address_CheckViewController.xib file open it to the Interface Builder. Drag text view from the library and place it in the view window. Connect the File’s Owner to the TextView select textView. Save it and go back to the Xcode.

Step 6: In the IP_Address_CheckViewController.m file , make the following changes.

 

 

 

Step 7: Now compile and run the application, but we have to see output in the iPhone. It is not showing the actual output in the simulator.

Figure 1: The Simulator output

You can downloaded SourceCode from here IP Address Check 2

Leave a Comment:

3 comments
yogesh says October 3, 2011

How do I adjust the views in XODE such that Code editor, Resource, Library and other interfaces are displayed in different tabs on the same Xcode framework unlike coming strayed by default. May be I need it because I come from Windows background but this is something by default as it would save a lot of time for developers and make it easy for them to work.

Reply
Vinita Miranda says September 24, 2012

The method currentHost is deprecated. My application was rejected in app store due to the use of this method.

Reply
Samir Jwarchan says September 25, 2012

I Think NSHost only works for MAC application, not for iOS apps.

Reply
Add Your Reply