Home Tutorial Iphone Examples iPhone SDK Examples

 
 

Share on Google+Share on Google+
iPhone SDK Examples
Posted on: July 27, 2009 at 12:00 AM
Advertisement
In this section we are providing many examples to illustrate the concept of iPhone SDK programming. These are small tips to help you in developing iPhone application code quickly.

While developing the iPhone program, many times you need some code to copy and paste to make your development fast.

In this section we have compiled a list small example code that you can copy and paste in your code.

Small examples related to the UI components such as UIButton, UILable, UITextfield etc. are presented here.

We will discuss all the UI and other components of the iPhone SDK with examples.

In our examples we will be discussing about the following components.

  • Windows
  • Buttons
  • Fonts
  • Text
  • Orientation
  • Debugging
  • Audio

and many more tips and tricks of iPhone application development.

So, Let's get started:

iphone text field example
In this iPhone example you are going to see...how to add the value of two different textfield and printing it in another textfield. This is a quite easy! What all we have to do is to take three different textfield and assign them different names. We have named it textField, textField1 & textField2.
 
iPhone AlertView
In this tutorial will learn how to show Alert Box when text field is empty, The application we are going to do is based on View Based Application.
 
AlertViewWithPassWord iPhone
In this tutorial will learn how to show Alert Box when text field is empty and the AlertView is Consist of Two textfield one is for name and another is for Password. The application we are going to do is based on View Based Application.
 
iphone Button Action (changing background of window)
In this tutorial we will change the iPhone background color on clicking the button, This is Window Based application.
 
Button with Image
In the given Iphone SDK tutorial, we are creating a button with image on it. There is nothing in adding image on button if you are aware of the features available in the interface builder toolbar...lets find out the steps.
 
iPhone Button Image
In this tutorial will learn how to Create iPhone Buttons image and also how to set the image on button click on the view, this will be done using code. We are not going to using Interface Builder to add Button, whole thing is done by coding.
 
iPhone Compare String
In this tutorial will learn how to compare two string in iPhone using Compare, when button is clicked. This application is window Based Application, will set action for the button and whenever button is clicked will show result. my project name is compareString.
 
Iphone Current Time Example
After going through this iphone SDK example, you will be able to show the current time on UILable. In this example we have used a UILable to show the output(current time) of the application and an UIButton(for button action).
 
iPhone CustomPickerView
In the given tutorial you will see how to shake the pictures using custom picker view in iphone...that's why we have named the application iphone shake to shuffle.
 
iPhone Date Picker
In this tutorial will learn how to use iPhone Date Picker to show current date and display using alert view. To show this we have to take button and on that will write the action and in that will write the method to show the date which you select on iPhone the date picker with time.
 
Iphone Show Current Date & Time
In the previous examples, we have printed current date and time separately in iphone simulator. But in this example we are going to show you how to print both current date and current time in iphone.
 
Delete and add row from Table View iPhone
In this tutorial will learn how to delete and also how to add row into the table view, with the help of edit button on navigation bar.
 
iPhone Do loop in Objective c
As you know, the concept of iphone do loop function is almost same in objective c programming. So, here in this tutorial of "Do loop in Objective c" i would explain only the necessary part with example.
 
iPhone Double Component In Picker
In this tutorial will learn how to use iPhone Picker View and also how to insert two different objects in different components by using two different array variables.
 
iphone Image Move
In this iPhone tutorial we will learn how to use Image View into view with background image set and that image can be moved any where on the view or screen.
 
iphone Flip Image
In this iphone tutorial we will learn how to flip the image, so to do this will use two Image View and a button i.e. bar button for the flip action, whenever we press flip button image should change. For that had to write the action and then method for that action.
 
iPhone for each loop in Objective c
In general, for each loop is used to access each objects from the collection of objects. We can also say that it iterates over an array or collection of objects. In iPhone application we also use this for each loop in objective c.
 
Hello World iphone Example
In the given tutorial you will be creating a small iphone application called "hello world app" using interface builder, that will run in the iphone simulator. Before going into deep of this tutorial let's first understand what is interface builder.
 
iPhone Hello World in Objective C
This is a very simple objective c program of hello world example, in which you will learn how to create your first hello world program application in objective c using xcode.
 
iphone button change view
In this tutorial will learn button change view i.e. when button is clicked will move to next view.
 
iPhone Text Field Validation
iPhone Text Field Validation - In any user based application "validations" plays a very important role in order to get unique and correct data from user.
 
iphone button example
In this tutorial we will tell you how to change the type of button through Interface Builder. There are six types of iPhone button, each has used for different purpose. 
 
iphone Curl Image
In this tutorial will learn how to change the image on button click in curl format, this is done by coding. This application will be developed on View Based Application and the coding will be done only in View Controller file.
 
Iphone hello world example
In this tutorial an iphone based hello world example is demonstrated. Also some relevant information under based is provided which we will find useful while dealing with large and complex iphone or mac os applications. So lets start building your iphone first hello world example.
 
iphone Touch Image
In this tutorial, will learn how to use Image View in the application and also how to set the image on the Image View and then will see how the image moves when we click the cursor on the screen.
 
iPhone Input Field, iPhone Input Field Tutorial
Generally, input fields are used to take input from the users. In iPhone application we can use Text Field to take the input.
 
iphone Table View
In this tutorial will learn how to use Table View and also how to add object to table view, will add or insert the object into the Table View.
 
iphone TextField
In this tutorial will create table view and in table view cell will add different Text Field and in that you can enter the text.
 
iphone TextView
In this iPhone tutorial learn how to use iPhone text view and also when to use text view, here will do every thing with coding i.e. not through the interface builder. Application will be View Based Application, will do our coding in view controller file i.e. .h and .m files.
 
Iphone keypad app
The given sample "Iphone keypad app" is going to show you how to hide keyboard or number pad and return to the actual screen.
 
iPhone Loops in objective c
If you have started learning Objective c, this small tutorial on "Loops in Objective c" would be helpful. In this series of loop examples, i have discussed about...
 
NSString lowercasestring
This is the another example of change case, defined into NSString. Basically NSString provides three type of methods to change the case
 
iPhone Multiple View
In this tutorial we will show you multiple view in iPhone Application, when you press button will take you to another view and also the button type will be changed according to the view, so that you can know that the view is changing.
 
iPhone NavigationBar With ToolBar
In this tutorial we will learn how to use two Bar i.e. Navigation Bar & Tool Bar and will add buttons to Bar and also the action to it.
 
NSString in objective c
In this series of Iphone application development tutorials, we are going to introduce you with some of the iphone basic classes and objects...that are used in objective C. The NSString is one of them.
 
NSString CapitalizedString - Iphone example
In this example, we are going to show you how to change the first character of the given string into uppercase.
 
Objective c date: NSString Date
In the given iPhone objective c date functions example, we are going to show you how to print the current date using NSDate of NSString class. To print the current date on iphone we required, a label(to print the date) and button(for action), connect them with file owner.
 
iPhone Picker Object On Toolbar Button
In this tutorial will learn how to use Picker view, also the Toolbar and on that will place Toolbar button and the selected object in Picker view can be seen on Tool bar button.
 
iPhone Screenshot in Mac
Screenshot in Mac, In the article you'll learn how to take screenshot in mac os.
 
iPhone SDK Comparing Strings
Learn how to comparing strings in the iPhone sdk project code.
 
Search bar application
In this iPhone tutorial, we will be creating a Search screen, which have a table view with a search bar. Table should display all the data if search field is empty other wise it should show all the data which matches.
 
Segment application
Create a new project by select View-Based Application.Open the Interface Builder by double clicking the SegmentViewController.xib file and add a segment from the Tools-> Library.
 
iPhone Segments Changes ToolBar And ToolBar Button
In this tutorial will learn how to use the Segmented Controller to change the ToolBar Style and also by another Segmented Controller will change the ToolBar Button Style, this is View Based Application.
 
Segment application
In this application we are going to create Segment Application by using View based application. In this we are using Segmented Controller and will allot different view to different segment.
 
iPhone SelectButton
In this tutorial we will learn how to set two image button i.e. when the button is selected the image of the button changes and deselect the button image also change so that you can know when button selected.
 
iPhone Simple Table View
In this tutorial will learn how to use Table View and also how to add object to table view, to insert the object into the table view we have to take an array and through that will add or insert the object into the Table View.
 
Simple Table View With Next View
In this tutorial will learn how to use Table View iphone and also how to add object to table view, to insert the object into the table view we have to take an array and through that will add or insert the object into the Table View.
 
iPhone Splash Screen
In this example, I'm going to show you how to create splash screen in iphone apps. The motto behind showing splash screen is to show something until and unless the application loads properly.
 
Subtitle in Table View  iPhone
In this tutorial will learn how to write subtitle to the title or how to write the Capital of the State into the same cell of the Table view and index to Table view.
 
Switch application
In this application we are going to create it by using Window based application.
 
iPhone Switch Changes Toolbar Color
In this tutorial we will use Switch button to change the Color of ToolBar. The Switch is added through the Interface Builder and the Toolbar is created by coding, the project is based on View Based Application.
 
Tab Bar Controller
In this application we are going to create it by using Window based application.
 
Table View Application
Table views are commonly found in iPhone applications, especially productivity applications. They are versatile user-interface objects that you can adapt for different needs.
 
Table view with multiple view and sections
In this tutorial we are going to add another view to the cell(Rows of Table View) and will have two section in Table View and will have Back button on next view so that we can come back to the previous view.For this you have to creat a Navigation Based Application and in that add view.
 
iPhone Tab Bar with Segmented Controller
In this tutorial will learn how to use the two controller at the same time, Tab bar is used to show the different view on click but in segmented controller you cannot recognize that its changing the view.
 
iPhone Text Field Border 
In this tutorial will learn about the text field Border, we can set the border of text field by selecting the text field and then Tools -> attributes Inspector and then select the different boarder for the text field.
 
iPhone UIAlertView 
In this tutorial will learn how to show Alert Box when text field is empty, Alert box will contain one button i.e. ok button. The application we are going to do is based on View Based Application.
 
Alert View with two Buttons
In this tutorial we are going to show alert view, this is shown only when the text field on the view is not entered.
 
NSString uppercaseString
In the previous example we have seen that how to change first character of string into upper case. But in this "NSString uppercaseString" example, we are going to show you how to convert all the string into upper case. 
 
iPhone Segmented Controller Through Coding
In this Tutorial will learn how to create Segmented Controller through coding and also how to set on to the view with different color and different size, this application is View Based Application .
 
ViewBasedApplication iPhone
In this tutorial will learn how to use iPhone View Based Application and on that view will display text on label which is typed on text field of the view with the round react button. In View Based Application there is view which is already loaded on window so whatever you do on view will be your output or will be displayed.
 
iphone Window Based Application
In this tutorial will learn how to create a view without using interface Builder, will create our own view with coding and also add some label on it with background color.To do this will start our project with Window Based Application and in that will add UIViewController subclass without Xib file in Classes file.
 
What is Objective c iPhone?
Objective c is a standard objected oriented programming language or we can also say that it is an enhanced version of traditional c programming that including number of new features in it.
 
iPhone Current Date, iPhone Current Date Application
In this application we are going to display current date on label by using Window based application.
 
iPhone Slider Example
In this application we are going to create slider by using Window based application. There is .h and .m file. We are going to add Slider to Window.
 
NSLog examples
In this section we will discuss the usage of NSLog function. NSLog function is used to print the value of variables on the debug console.
 
NSLog array example
In this tutorial we will show you how to print the values of array using the NSLog function. Printing array values on the console is important debugging technique in iPhone application debugging.
 
Printing Boolean values with NSLog function
In this section we will show you how you can print the values of Boolean using NSLog.
 
NSLog Date example code
In this example code I will show you how you can print the current date using the NSLog function.
 
NSLog double example code
In this example we are discussing about NSLog function that actually prints the value of double.
 
NSLog float example code
In this section we will see the correct example of NSLog function that prints the float value.
 
Formatting the out put in NSLog function
You will learn how to display formatted output into the log message using the NSLog function.
 
NSLog Integer Example
In this code example you will see how to print the value of int variable.
 
NSLog long example code
In this example I will show you the usage of NSLog function to print the long value on the console.
 
NSLog NSDictionary Example code
In this example code we will learn how to print the value of NSDictionary
 
NSLog NSInteger example code
This example shows you how to print the value of NSInteger object with the help of NSLog function.
 
NSLog print NSString example code
In this example we will show you the code to print the NSString using NSLog function.
 
Printing the String value using NSLog function
In this section you will learn how you can print the value of NSString using the NSLog function.
 
UIPickerView Example
In this tutorial I will discuss about the UIPickerView component of iPhone SDK. 
 
iPhone SDK Tutorials and Examples
The best collection of iPhone development tutorials and examples specially developed to learn iPhone SDK programming easily. These iPhone SDK tutorials are useful for both novice and experienced developers.
 
iPhone String Match
iPhone String Match - In this "String match" example we are going to use "rangeofstring" method, which is used to search for a string within the given set of string.
 
Selector in Objective C
In this iPhone selector example, you will learn how to use selector in your iphone app. Though we'll explain it with the help of selector syntax ..But lets first understand what is a selector.
 
HIDE BUTTON iPHONE
Basically, buttons are used to give an action to the program to proceed further.. but sometimes there could be some conditions when we wanted to restrict the user from clicking the button.
 
iPhone landscape mode
iPhone landscape mode - In this series of iPhone application development tutorial, you'll learn launching your iPhone app in landscape mode. Believe me it's very simple to change your iphone app in landscape mode. Just follow the given steps.
 
Advertisement

Related Tags for iPhone SDK Examples:


Follow us on Twitter, or add us on Facebook or Google Plus to keep you updated with the recent trends of Java and other open source platforms.

Posted on: July 27, 2009

Recommend the tutorial

Advertisements Advertisements
 

 

 

DMCA.com