<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>iPhone Tutorial &#124; iPhone iOS4 iPad SDK Development &#38; Programming Blog &#187; iPad tutorials</title>
	<atom:link href="http://www.edumobile.org/iphone/tag/ipad-tutorials/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.edumobile.org/iphone</link>
	<description></description>
	<lastBuildDate>Wed, 25 Jan 2012 09:42:29 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.1</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Double Component Picker in iPad</title>
		<link>http://www.edumobile.org/iphone/ipad-development/double-component-picker-in-ipad/</link>
		<comments>http://www.edumobile.org/iphone/ipad-development/double-component-picker-in-ipad/#comments</comments>
		<pubDate>Mon, 16 Aug 2010 07:12:23 +0000</pubDate>
		<dc:creator>Sushant</dc:creator>
				<category><![CDATA[iPad Development]]></category>
		<category><![CDATA[Double Component Picker]]></category>
		<category><![CDATA[Double Component picker in iPad]]></category>
		<category><![CDATA[iPad tutorials]]></category>

		<guid isPermaLink="false">http://www.edumobile.org/iphone/?p=2560</guid>
		<description><![CDATA[This is the Double Component Picker example. In this example we will see how to worked it in the iPad.]]></description>
			<content:encoded><![CDATA[<p>This is the Double Component Picker example. In this example we will see how to worked it in the iPad.</p>
<p><strong>Step 1:</strong> Create a View base application using template. Give the application name  ”DoubleComponentPicker_ipad”.</p>
<p><strong>Step 2:</strong> 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.</p>
<p><strong>Step 3 : </strong>Expand classes and notice Interface Builder created the DoubleComponentPicker_ipad class for you. Expand Resources and notice the template generated a separate nib, DoubleComponentPicker_ipadViewController.xib, for the “DoubleComponentPicker_ipad”.</p>
<p><strong>Step 4 :</strong> In the DoubleComponentPicker_ipadViewController.h file , we have added DataSource and delegate protocol. Create an instance of UIPickerView class and add one IBAction method. So make the following changes.</p>
<div class="codesnip-container" >
<div class="objc codesnip" style="font-family:monospace;"><span class="co1">#import &lt;UIKit/UIKit.h&gt;</span><br />
<span class="co1">#define kFillingComponent &nbsp;0</span><br />
<span class="co1">#define kBreadComponent &nbsp;1</span></p>
<p><span class="kw1">@interface</span> DoubleComponentPicker_ipadViewController <span class="sy0">:</span> UIViewController &lt;UIPickerViewDelegate, UIPickerViewDataSource&gt;<br />
<span class="br0">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; IBOutlet UIPickerView <span class="sy0">*</span>doublePicker;<br />
&nbsp; &nbsp; &nbsp; &nbsp; <a href="http://developer.apple.com/documentation/Cocoa/Reference/Foundation/Classes/NSArray_Class/"><span class="kw5">NSArray</span></a> <span class="sy0">*</span>fillingTypes;<br />
&nbsp; &nbsp; &nbsp; &nbsp; <a href="http://developer.apple.com/documentation/Cocoa/Reference/Foundation/Classes/NSArray_Class/"><span class="kw5">NSArray</span></a> <span class="sy0">*</span>breadTypes;<br />
<span class="br0">&#125;</span></p>
<p><span class="kw1">@property</span> <span class="br0">&#40;</span>nonatomic,retain<span class="br0">&#41;</span> &nbsp;UIPickerView <span class="sy0">*</span>doublePicker;<br />
<span class="kw1">@property</span> <span class="br0">&#40;</span>nonatomic,retain<span class="br0">&#41;</span> &nbsp;<a href="http://developer.apple.com/documentation/Cocoa/Reference/Foundation/Classes/NSArray_Class/"><span class="kw5">NSArray</span></a> <span class="sy0">*</span>fillingTypes;<br />
<span class="kw1">@property</span> <span class="br0">&#40;</span>nonatomic,retain<span class="br0">&#41;</span> &nbsp;<a href="http://developer.apple.com/documentation/Cocoa/Reference/Foundation/Classes/NSArray_Class/"><span class="kw5">NSArray</span></a> <span class="sy0">*</span>breadTypes;</p>
<p><span class="sy0">-</span><span class="br0">&#40;</span>IBAction<span class="br0">&#41;</span>buttonPressed;</div>
</div>
<p><strong>Step 5: </strong>Double click the DoubleComponentPicker_ipadViewController.xib file and open it to the Interface Builder. First drag the Picker view from the library and place it to the view window and drag round rect button from the library and place it to the view window. Select the picker from the view window and bring up connection inspector and drag from the datasource to the file’s owner icon, do the same thing for delegate protocol. Select the round rect button and bring up Connection Inspector and drag from the Touch Up Inside to the File’s Owner icon and select buttonPressed: action. Now save the DoubleComponentPicker_ipadViewController.xib file, close it and go back to the Xcode.</p>
<p><strong>Step 6: </strong>Open the DoubleComponentPicker_ipadViewController.m file and make the following changes in the file.</p>
<div class="codesnip-container" >
<div class="objc codesnip" style="font-family:monospace;"><span class="sy0">-</span><span class="br0">&#40;</span>IBAction<span class="br0">&#41;</span>buttonPressed<br />
<span class="br0">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; NSInteger breadRow <span class="sy0">=</span> <span class="br0">&#91;</span>doublePicker selectedRowInComponent<span class="sy0">:</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; kBreadComponent<span class="br0">&#93;</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; NSInteger fillingRow <span class="sy0">=</span> <span class="br0">&#91;</span>doublePicker selectedRowInComponent<span class="sy0">:</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; kFillingComponent<span class="br0">&#93;</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; <a href="http://developer.apple.com/documentation/Cocoa/Reference/Foundation/Classes/NSString_Class/"><span class="kw5">NSString</span></a> <span class="sy0">*</span>bread <span class="sy0">=</span> <span class="br0">&#91;</span>breadTypes objectAtIndex<span class="sy0">:</span>breadRow<span class="br0">&#93;</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; <a href="http://developer.apple.com/documentation/Cocoa/Reference/Foundation/Classes/NSString_Class/"><span class="kw5">NSString</span></a> <span class="sy0">*</span>filling <span class="sy0">=</span> <span class="br0">&#91;</span>fillingTypes objectAtIndex<span class="sy0">:</span>fillingRow<span class="br0">&#93;</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; <a href="http://developer.apple.com/documentation/Cocoa/Reference/Foundation/Classes/NSString_Class/"><span class="kw5">NSString</span></a> <span class="sy0">*</span>message <span class="sy0">=</span> <span class="br0">&#91;</span><span class="br0">&#91;</span><a href="http://developer.apple.com/documentation/Cocoa/Reference/Foundation/Classes/NSString_Class/"><span class="kw5">NSString</span></a> alloc<span class="br0">&#93;</span> initWithFormat<span class="sy0">:</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span class="co3">@</span><span class="st0">&quot;Your %@ on %@ bread will be right up.&quot;</span>,filling, bread<span class="br0">&#93;</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; UIAlertView <span class="sy0">*</span>alert <span class="sy0">=</span><span class="br0">&#91;</span><span class="br0">&#91;</span>UIAlertView alloc<span class="br0">&#93;</span> initWithTitle<span class="sy0">:</span><span class="co3">@</span><span class="st0">&quot;Thank you for your order&quot;</span> message<span class="sy0">:</span>message delegate<span class="sy0">:</span><span class="kw2">nil</span> cancelButtonTitle<span class="sy0">:</span><span class="co3">@</span><span class="st0">&quot;Great!&quot;</span> otherButtonTitles<span class="sy0">:</span><span class="kw2">nil</span><span class="br0">&#93;</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="br0">&#91;</span>alert show<span class="br0">&#93;</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="br0">&#91;</span>alert release<span class="br0">&#93;</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="br0">&#91;</span>message release<span class="br0">&#93;</span>;<br />
<span class="br0">&#125;</span></p>
<p>
<span class="co2">// Implement viewDidLoad to do additional setup after loading the view, typically from a nib.</span><br />
<span class="sy0">-</span> <span class="br0">&#40;</span><span class="kw4">void</span><span class="br0">&#41;</span>viewDidLoad <span class="br0">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <a href="http://developer.apple.com/documentation/Cocoa/Reference/Foundation/Classes/NSArray_Class/"><span class="kw5">NSArray</span></a> <span class="sy0">*</span>breadArray <span class="sy0">=</span> <span class="br0">&#91;</span><span class="br0">&#91;</span><a href="http://developer.apple.com/documentation/Cocoa/Reference/Foundation/Classes/NSArray_Class/"><span class="kw5">NSArray</span></a> alloc<span class="br0">&#93;</span> initWithObjects<span class="sy0">:</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span class="co3">@</span><span class="st0">&quot;White&quot;</span>,<span class="co3">@</span><span class="st0">&quot;Whole Wheat&quot;</span>,<span class="co3">@</span><span class="st0">&quot;Rye&quot;</span>,<span class="co3">@</span><span class="st0">&quot;Sourdough&quot;</span>,<span class="co3">@</span><span class="st0">&quot;Seven Grain&quot;</span>, <span class="kw2">nil</span><span class="br0">&#93;</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; self.breadTypes <span class="sy0">=</span> breadArray;<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="br0">&#91;</span>breadArray release<span class="br0">&#93;</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; <a href="http://developer.apple.com/documentation/Cocoa/Reference/Foundation/Classes/NSArray_Class/"><span class="kw5">NSArray</span></a> <span class="sy0">*</span>fillingArray <span class="sy0">=</span> <span class="br0">&#91;</span><span class="br0">&#91;</span><a href="http://developer.apple.com/documentation/Cocoa/Reference/Foundation/Classes/NSArray_Class/"><span class="kw5">NSArray</span></a> alloc<span class="br0">&#93;</span> initWithObjects<span class="sy0">:</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span class="co3">@</span><span class="st0">&quot;Turkey&quot;</span>,<span class="co3">@</span><span class="st0">&quot;Peanut Butter&quot;</span>,<span class="co3">@</span><span class="st0">&quot;Tuna Salad&quot;</span>,<span class="co3">@</span><span class="st0">&quot;Chicken Salad&quot;</span>,<span class="co3">@</span><span class="st0">&quot;Roast Beef&quot;</span>,<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span class="co3">@</span><span class="st0">&quot;Vegemite&quot;</span>,<span class="kw2">nil</span><span class="br0">&#93;</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; self.fillingTypes <span class="sy0">=</span> fillingArray;<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="br0">&#91;</span>fillingArray release<span class="br0">&#93;</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="br0">&#91;</span>super viewDidLoad<span class="br0">&#93;</span>;<br />
<span class="br0">&#125;</span></p>
<p><span class="sy0">-</span><span class="br0">&#40;</span>NSInteger<span class="br0">&#41;</span>numberOfComponentsInPickerView<span class="sy0">:</span><span class="br0">&#40;</span>UIPickerView <span class="sy0">*</span><span class="br0">&#41;</span>pickerView<br />
<span class="br0">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="kw1">return</span> <span class="nu0">2</span>;<br />
<span class="br0">&#125;</span></p>
<p><span class="sy0">-</span><span class="br0">&#40;</span>NSInteger<span class="br0">&#41;</span>pickerView<span class="sy0">:</span><span class="br0">&#40;</span>UIPickerView <span class="sy0">*</span><span class="br0">&#41;</span>pickerView<br />
numberOfRowsInComponent<span class="sy0">:</span><span class="br0">&#40;</span>NSInteger<span class="br0">&#41;</span>component<br />
<span class="br0">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="kw1">if</span> <span class="br0">&#40;</span>component <span class="sy0">==</span> kBreadComponent<span class="br0">&#41;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="kw1">return</span><span class="br0">&#91;</span>self.breadTypes count<span class="br0">&#93;</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="kw1">return</span><span class="br0">&#91;</span>self.fillingTypes count<span class="br0">&#93;</span>;<br />
<span class="br0">&#125;</span></p>
<p><span class="sy0">-</span><span class="br0">&#40;</span><a href="http://developer.apple.com/documentation/Cocoa/Reference/Foundation/Classes/NSString_Class/"><span class="kw5">NSString</span></a> <span class="sy0">*</span><span class="br0">&#41;</span>pickerView<span class="sy0">:</span><span class="br0">&#40;</span>UIPickerView <span class="sy0">*</span><span class="br0">&#41;</span>pickerView<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; titleForRow<span class="sy0">:</span><span class="br0">&#40;</span>NSInteger<span class="br0">&#41;</span>row<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;forComponent<span class="sy0">:</span><span class="br0">&#40;</span>NSInteger<span class="br0">&#41;</span>component <br />
<span class="br0">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="kw1">if</span> <span class="br0">&#40;</span>component <span class="sy0">==</span> kBreadComponent<span class="br0">&#41;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="kw1">return</span> <span class="br0">&#91;</span>self. breadTypes objectAtIndex<span class="sy0">:</span>row<span class="br0">&#93;</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="kw1">return</span> <span class="br0">&#91;</span>self.fillingTypes objectAtIndex<span class="sy0">:</span>row<span class="br0">&#93;</span>;<br />
<span class="br0">&#125;</span></div>
</div>
<p><strong>Step 7</strong>: Its all done, now compile and run the application in the Simulator.</p>
<p><a href="http://www.edumobile.org/iphone/wp-content/uploads/2010/08/1-11.jpg"><img src="http://www.edumobile.org/iphone/wp-content/uploads/2010/08/1-11-238x300.jpg" alt="" title="1-(1)" width="238" height="300" class="alignnone size-medium wp-image-2561" /></a></p>
<p>You can <strong>Download SourceCode</strong> from here <a href='http://www.edumobile.org/iphone/wp-content/uploads/2010/08/DoubleComponentPicker_ipad.zip'>DoubleComponentPicker_ipad</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.edumobile.org/iphone/ipad-development/double-component-picker-in-ipad/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>SingleComponent Picker in iPad</title>
		<link>http://www.edumobile.org/iphone/ipad-development/singlecomponent-picker-in-ipad/</link>
		<comments>http://www.edumobile.org/iphone/ipad-development/singlecomponent-picker-in-ipad/#comments</comments>
		<pubDate>Thu, 12 Aug 2010 07:16:13 +0000</pubDate>
		<dc:creator>Sushant</dc:creator>
				<category><![CDATA[iPad Development]]></category>
		<category><![CDATA[iPad tutorials]]></category>
		<category><![CDATA[Single Component Picker]]></category>
		<category><![CDATA[SingleComponent Picker in iPad]]></category>

		<guid isPermaLink="false">http://www.edumobile.org/iphone/?p=2550</guid>
		<description><![CDATA[This is the Single Component Picker application. In this application we will see how to add Single Component in iPad.]]></description>
			<content:encoded><![CDATA[<p>This is the Single Component Picker application. In this application we will see how to add Single Component in iPad.</p>
<p><strong>Step 1:</strong> Create a View base application using template. Give the application name  &#8221;SingleComponent_iPad&#8221;.</p>
<p><strong>Step 2: </strong>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.</p>
<p><strong>Step 3:</strong> Expand classes and notice Interface Builder created the SingleComponent_iPadViewController class for you. Expand Resources and notice the template generated a separate nib, SingleComponent_iPadViewController.xib, for the “SingleComponent_iPad”.</p>
<p><strong>Step 4:</strong> In the SingleComponent_iPadViewController.h file , we have added DataSource and delegate protocol. Create an instance of UIPickerView class and add one IBAction method. So make the following changes.</p>
<div class="codesnip-container" >
<div class="objc codesnip" style="font-family:monospace;"><span class="co1">#import &lt;UIKit/UIKit.h&gt;</span></p>
<p><span class="kw1">@interface</span> SingleComponent_iPadViewController <span class="sy0">:</span> UIViewController<br />
&lt;UIPickerViewDataSource , UIPickerViewDelegate&gt;<br />
<span class="br0">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; IBOutlet UIPickerView <span class="sy0">*</span>singlePickerComponent;<br />
&nbsp; &nbsp; &nbsp; &nbsp; <a href="http://developer.apple.com/documentation/Cocoa/Reference/Foundation/Classes/NSArray_Class/"><span class="kw5">NSArray</span></a> <span class="sy0">*</span>pickerData;<br />
<span class="br0">&#125;</span></p>
<p><span class="kw1">@property</span><span class="br0">&#40;</span>nonatomic , retain<span class="br0">&#41;</span> UIPickerView <span class="sy0">*</span>singlePickerComponent;<br />
<span class="kw1">@property</span><span class="br0">&#40;</span>nonatomic , retain<span class="br0">&#41;</span> <a href="http://developer.apple.com/documentation/Cocoa/Reference/Foundation/Classes/NSArray_Class/"><span class="kw5">NSArray</span></a> <span class="sy0">*</span>pickerData;</p>
<p><span class="sy0">-</span><span class="br0">&#40;</span>IBAction<span class="br0">&#41;</span>buttonPressed;</div>
</div>
<p><strong>Step 5:</strong> Double click the SingleComponent_iPadViewController.xib file, open it to the Interface Builder. First drag the Picker view from the library and place it to the view window and drag round rect button from the library and place it to the view window. Select the picker from the view window and bring up connection inspector and drag from the datasource to the file&#8217;s owner icon, do the same thing for delegate protocol. Select the round rect button and bring up Connection Inspector and drag from the Touch Up Inside to the File&#8217;s Owner icon and select buttonPressed: action. Now save the SingleComponent_iPadViewController.xib file, close it and go back to the Xcode.</p>
<p><strong>Step 6: </strong>Open the SingleComponent_iPadViewController.m file and make the following changes in the file.</p>
<div class="codesnip-container" >
<div class="objc codesnip" style="font-family:monospace;"><span class="sy0">-</span><span class="br0">&#40;</span>IBAction<span class="br0">&#41;</span>buttonPressed<br />
<span class="br0">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; NSInteger row <span class="sy0">=</span> <span class="br0">&#91;</span>singlePickerComponent selectedRowInComponent<span class="sy0">:</span>0<span class="br0">&#93;</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; <a href="http://developer.apple.com/documentation/Cocoa/Reference/Foundation/Classes/NSString_Class/"><span class="kw5">NSString</span></a> <span class="sy0">*</span>selected <span class="sy0">=</span> <span class="br0">&#91;</span>pickerData objectAtIndex<span class="sy0">:</span>row<span class="br0">&#93;</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; <a href="http://developer.apple.com/documentation/Cocoa/Reference/Foundation/Classes/NSString_Class/"><span class="kw5">NSString</span></a> <span class="sy0">*</span>title <span class="sy0">=</span> <span class="br0">&#91;</span><span class="br0">&#91;</span><a href="http://developer.apple.com/documentation/Cocoa/Reference/Foundation/Classes/NSString_Class/"><span class="kw5">NSString</span></a> alloc<span class="br0">&#93;</span> initWithFormat<span class="sy0">:</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span class="co3">@</span><span class="st0">&quot;you selected %@!&quot;</span>, selected<span class="br0">&#93;</span>;<br />
&nbsp; &nbsp; UIAlertView <span class="sy0">*</span>alert <span class="sy0">=</span> <span class="br0">&#91;</span><span class="br0">&#91;</span>UIAlertView alloc<span class="br0">&#93;</span> initWithTitle<span class="sy0">:</span>title<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;message <span class="sy0">:</span> <span class="co3">@</span><span class="st0">&quot;Thank you for choosing.&quot;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;delegate<span class="sy0">:</span><span class="kw2">nil</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;cancelButtonTitle <span class="sy0">:</span><span class="co3">@</span><span class="st0">&quot;You are Welcome&quot;</span> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;otherButtonTitles <span class="sy0">:</span><span class="kw2">nil</span><span class="br0">&#93;</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="br0">&#91;</span>alert show<span class="br0">&#93;</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="br0">&#91;</span>alert release<span class="br0">&#93;</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="br0">&#91;</span>title release<span class="br0">&#93;</span>;<br />
<span class="br0">&#125;</span></p>
<p><span class="co2">// Implement viewDidLoad to do additional setup after loading the view, typically from a nib.</span><br />
<span class="sy0">-</span> <span class="br0">&#40;</span><span class="kw4">void</span><span class="br0">&#41;</span>viewDidLoad <span class="br0">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <a href="http://developer.apple.com/documentation/Cocoa/Reference/Foundation/Classes/NSArray_Class/"><span class="kw5">NSArray</span></a> <span class="sy0">*</span>array <span class="sy0">=</span> <span class="br0">&#91;</span><span class="br0">&#91;</span><a href="http://developer.apple.com/documentation/Cocoa/Reference/Foundation/Classes/NSArray_Class/"><span class="kw5">NSArray</span></a> alloc<span class="br0">&#93;</span> initWithObjects<span class="sy0">:</span><span class="co3">@</span><span class="st0">&quot;SunDay&quot;</span>,<span class="co3">@</span><span class="st0">&quot;MonDay&quot;</span>,<span class="co3">@</span><span class="st0">&quot;TuesDay&quot;</span>,<span class="co3">@</span><span class="st0">&quot;WednesDay&quot;</span>,<span class="co3">@</span><span class="st0">&quot;ThusDay&quot;</span>,<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="co3">@</span><span class="st0">&quot;FriDay&quot;</span>,<span class="co3">@</span><span class="st0">&quot;SaturDay&quot;</span>,<span class="kw2">nil</span><span class="br0">&#93;</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; self.pickerData <span class="sy0">=</span> array;<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="br0">&#91;</span>array release<span class="br0">&#93;</span>;<br />
&nbsp; &nbsp; <span class="br0">&#91;</span>super viewDidLoad<span class="br0">&#93;</span>;<br />
<span class="br0">&#125;</span></p>
<p><span class="sy0">-</span><span class="br0">&#40;</span>NSInteger<span class="br0">&#41;</span>numberOfComponentsInPickerView<span class="sy0">:</span><span class="br0">&#40;</span>UIPickerView <span class="sy0">*</span><span class="br0">&#41;</span>pickerView<br />
<span class="br0">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="kw1">return</span> <span class="nu0">1</span>;<br />
<span class="br0">&#125;</span></p>
<p><span class="sy0">-</span><span class="br0">&#40;</span>NSInteger<span class="br0">&#41;</span>pickerView<span class="sy0">:</span><span class="br0">&#40;</span>UIPickerView <span class="sy0">*</span><span class="br0">&#41;</span>pickerView<br />
numberOfRowsInComponent<span class="sy0">:</span><span class="br0">&#40;</span>NSInteger<span class="br0">&#41;</span>component<br />
<span class="br0">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="kw1">return</span> <span class="br0">&#91;</span>pickerData count<span class="br0">&#93;</span>;<br />
<span class="br0">&#125;</span></p>
<p><span class="sy0">-</span><span class="br0">&#40;</span><a href="http://developer.apple.com/documentation/Cocoa/Reference/Foundation/Classes/NSString_Class/"><span class="kw5">NSString</span></a> <span class="sy0">*</span><span class="br0">&#41;</span>pickerView<span class="sy0">:</span><span class="br0">&#40;</span>UIPickerView <span class="sy0">*</span><span class="br0">&#41;</span>pickerView<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; titleForRow<span class="sy0">:</span><span class="br0">&#40;</span>NSInteger<span class="br0">&#41;</span>row<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;forComponent<span class="sy0">:</span><span class="br0">&#40;</span>NSInteger<span class="br0">&#41;</span>component <br />
<span class="br0">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="kw1">return</span><span class="br0">&#91;</span>pickerData objectAtIndex<span class="sy0">:</span>row<span class="br0">&#93;</span>;<br />
<span class="br0">&#125;</span></div>
</div>
<p><strong>Step 7: </strong>Now Compile and run the application in the Simulator.</p>
<p><a href="http://www.edumobile.org/iphone/wp-content/uploads/2010/08/1-1.jpg"><img class="alignnone size-medium wp-image-2551" title="1-(1)" src="http://www.edumobile.org/iphone/wp-content/uploads/2010/08/1-1-238x300.jpg" alt="" width="238" height="300" /></a></p>
<p>You can <strong>Download SourceCode</strong> from here <a href="http://www.edumobile.org/iphone/wp-content/uploads/2010/08/SingleComponent_iPad.zip">SingleComponent_iPad</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.edumobile.org/iphone/ipad-development/singlecomponent-picker-in-ipad/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Display Splash Screen in iPad</title>
		<link>http://www.edumobile.org/iphone/ipad-development/display-splash-screen-in-ipad/</link>
		<comments>http://www.edumobile.org/iphone/ipad-development/display-splash-screen-in-ipad/#comments</comments>
		<pubDate>Wed, 11 Aug 2010 07:33:44 +0000</pubDate>
		<dc:creator>Sushant</dc:creator>
				<category><![CDATA[iPad Development]]></category>
		<category><![CDATA[Display Splash Screen]]></category>
		<category><![CDATA[Display Splash Screen in iPad]]></category>
		<category><![CDATA[iPad tutorials]]></category>

		<guid isPermaLink="false">http://www.edumobile.org/iphone/?p=2543</guid>
		<description><![CDATA[In this application we will see how to display Splash Screen in iPad.]]></description>
			<content:encoded><![CDATA[<p>In this application we will see how to display Splash Screen in iPad.</p>
<p><strong>Step 1: </strong>Create a View base application using template. Give the application name “DisplaySplash_iPad”.</p>
<p><strong>Step 2:</strong> 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.</p>
<p><strong>Step 3:</strong> Expand classes and notice Interface Builder created the DisplaySplash_iPadViewController class for you. Expand Resources and notice the template generated a separate nib, DisplaySplash_iPadViewController.xib, for the “DisplaySplash_iPad”.</p>
<p><strong>Step 4: </strong>We need to add one resource in the resource folder for display splash.</p>
<p><strong>Step 5: </strong>In the DisplaySplash_iPad.h file, we have created instance of UIView class and two methods. So make the following changes in the file.</p>
<div class="codesnip-container" >
<div class="objc codesnip" style="font-family:monospace;"><span class="co1">#import &lt;UIKit/UIKit.h&gt;</span></p>
<p><span class="kw1">@interface</span> DisplaySplash_iPadViewController <span class="sy0">:</span> UIViewController <span class="br0">&#123;</span></p>
<p>&nbsp; &nbsp; &nbsp; &nbsp; IBOutlet UIView <span class="sy0">*</span>displaySplashScreen;<br />
&nbsp; &nbsp; &nbsp; &nbsp; <br />
<span class="br0">&#125;</span></p>
<p><span class="sy0">-</span><span class="br0">&#40;</span><span class="kw4">void</span><span class="br0">&#41;</span>displayScreen;<br />
<span class="sy0">-</span><span class="br0">&#40;</span><span class="kw4">void</span><span class="br0">&#41;</span>removeScreen;</div>
</div>
<p><strong>Step 6: </strong>Double click the DisplaySplash_iPadViewController.xib file and open it to the Interface Builder. Drag the view from the library and place it to the Main Window. Open the second view icon from the MainWindow,drag the image view from the library and place it to the view window,select the view and bring up Attribute Inspector select the image “themes.png”. Select the File’s Owner icon from the MainWindow and bring up Connection Inspector, drag from the displayScreen to the last view icon and connect File’s Owner icon to the view. Now save it , close it and go back to the Xcode.</p>
<p><strong>Step 7: </strong>Open the DisplaySplash_iPad.m file and make the following changes in the file.</p>
<div class="codesnip-container" >
<div class="objc codesnip" style="font-family:monospace;"><span class="sy0">-</span><span class="br0">&#40;</span><span class="kw4">void</span><span class="br0">&#41;</span>displayScreen<br />
<span class="br0">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; UIViewController <span class="sy0">*</span>displayViewController<span class="sy0">=</span><span class="br0">&#91;</span><span class="br0">&#91;</span>UIViewController alloc<span class="br0">&#93;</span> init<span class="br0">&#93;</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; displayViewController.view <span class="sy0">=</span> displaySplashScreen;<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="br0">&#91;</span>self presentModalViewController<span class="sy0">:</span>displayViewController animated<span class="sy0">:</span><span class="kw2">NO</span><span class="br0">&#93;</span>;<br />
&nbsp; &nbsp; <span class="br0">&#91;</span>self performSelector<span class="sy0">:</span><span class="kw1">@selector</span><span class="br0">&#40;</span>removeScreen<span class="br0">&#41;</span> withObject<span class="sy0">:</span><span class="kw2">nil</span> afterDelay<span class="sy0">:</span>6.0<span class="br0">&#93;</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; <br />
<span class="br0">&#125;</span></p>
<p><span class="sy0">-</span><span class="br0">&#40;</span><span class="kw4">void</span><span class="br0">&#41;</span>removeScreen<br />
<span class="br0">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="br0">&#91;</span><span class="br0">&#91;</span>self modalViewController<span class="br0">&#93;</span> dismissModalViewControllerAnimated<span class="sy0">:</span><span class="kw2">YES</span><span class="br0">&#93;</span>;<br />
<span class="br0">&#125;</span></div>
</div>
<p><strong>Step 8 :</strong> Now compile and run the application in the Simulator.</p>
<p><a href="http://www.edumobile.org/iphone/wp-content/uploads/2010/08/1-71.jpg"><img src="http://www.edumobile.org/iphone/wp-content/uploads/2010/08/1-71-232x300.jpg" alt="" title="1-7" width="232" height="300" class="alignnone size-medium wp-image-2547" /></a></p>
<p>You can <strong>Download SourceCode</strong> from here <a href='http://www.edumobile.org/iphone/wp-content/uploads/2010/08/DisplaySplash_iPad.zip'>DisplaySplash_iPad</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.edumobile.org/iphone/ipad-development/display-splash-screen-in-ipad/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Change View in iPad</title>
		<link>http://www.edumobile.org/iphone/ipad-development/change-view-in-ipad/</link>
		<comments>http://www.edumobile.org/iphone/ipad-development/change-view-in-ipad/#comments</comments>
		<pubDate>Tue, 03 Aug 2010 06:39:41 +0000</pubDate>
		<dc:creator>Sushant</dc:creator>
				<category><![CDATA[iPad Development]]></category>
		<category><![CDATA[Change View]]></category>
		<category><![CDATA[Change View in iPad]]></category>
		<category><![CDATA[iPad tutorials]]></category>

		<guid isPermaLink="false">http://www.edumobile.org/iphone/?p=2530</guid>
		<description><![CDATA[In this application we will see how to change view in iPad.]]></description>
			<content:encoded><![CDATA[<p>In this application we will see how to change view in iPad.</p>
<p><strong>Step 1:</strong> Create a Window base application using template. Give the application name “Windowbase_iPad”.</p>
<p><strong>Step 2:</strong> 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.</p>
<p><strong>Step 3: </strong>xpand classes and notice Interface Builder created the Windowbase_iPadAppDelegate class for you. Expand Resources and notice the template generated a separate nib, MainWindow.xib, for the “Windowbase_iPad”.</p>
<p><strong>Step 4:</strong> We need to add two images in the resource folder. Give the name of the resources &#8220;1-1.png&#8221;,&#8221;2-1.png&#8221;.</p>
<p><strong>Step 5:</strong> We have added QuartzCore.framework, select Frameworks -&gt; add -&gt; Existing frameworks -&gt; selectQuartzCore.framework.</p>
<p><strong>Step 6: </strong>In the Windowbase_iPadAppDelegate.h file, we have added instances of UIView and UIImageView class, and create one IBAction method. So make the following changes in the file.</p>
<div class="codesnip-container" >
<div class="objc codesnip" style="font-family:monospace;"><span class="co1">#import &lt;UIKit/UIKit.h&gt;</span></p>
<p><span class="kw1">@interface</span> Windowbase_iPadAppDelegate <span class="sy0">:</span> <a href="http://developer.apple.com/documentation/Cocoa/Reference/Foundation/Classes/NSObject_Class/"><span class="kw5">NSObject</span></a> &lt;UIApplicationDelegate&gt; <span class="br0">&#123;</span><br />
&nbsp; &nbsp;<br />
&nbsp; &nbsp; &nbsp; &nbsp; UIWindow <span class="sy0">*</span>window;<br />
&nbsp; &nbsp; &nbsp; &nbsp; UIView &nbsp;<span class="sy0">*</span>subView;<br />
&nbsp; &nbsp; &nbsp; &nbsp; UIImageView <span class="sy0">*</span>view1;<br />
&nbsp; &nbsp; &nbsp; &nbsp; UIImageView <span class="sy0">*</span>view2;<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="kw4">BOOL</span> change;<br />
<span class="br0">&#125;</span></p>
<p><span class="kw1">@property</span> <span class="br0">&#40;</span>nonatomic, retain<span class="br0">&#41;</span> IBOutlet UIWindow <span class="sy0">*</span>window;<br />
<span class="kw1">@property</span> <span class="br0">&#40;</span>nonatomic, retain<span class="br0">&#41;</span> IBOutlet UIView &nbsp;<span class="sy0">*</span>subView;</p>
<p><span class="sy0">-</span><span class="br0">&#40;</span>IBAction<span class="br0">&#41;</span>ChangeView<span class="sy0">:</span><span class="br0">&#40;</span><span class="kw4">id</span><span class="br0">&#41;</span>sender;</div>
</div>
<p><strong>Step 7:</strong> Double click your MainWindow.xib file open it to the Interface Builder. Open the the window and drag view from the library and place it to the window. Next drag Toolbar from the library and place it buttom of the view window. Now select WindowbaseiPadAppDelegate from the mainwindow (See figure 1), and bring up connection inspector. Select from subView to the view, and ChangeView to the BarButtonItem. Now save your .xib file and go back to the Xcode.</p>
<p><a href="http://www.edumobile.org/iphone/wp-content/uploads/2010/08/1-72.jpg"><img src="http://www.edumobile.org/iphone/wp-content/uploads/2010/08/1-72-300x241.jpg" alt="" title="1-7" width="300" height="241" class="alignnone size-medium wp-image-2615" /></a></p>
<p><strong>Figure 1:</strong> MainWindow.xib </p>
<p><strong>Step 8: </strong>Open the Windowbase_iPadAppDelegate.m file and make the following changes in the file.</p>
<div class="codesnip-container" >
<div class="objc codesnip" style="font-family:monospace;"><span class="sy0">-</span> <span class="br0">&#40;</span><span class="kw4">BOOL</span><span class="br0">&#41;</span>application<span class="sy0">:</span><span class="br0">&#40;</span>UIApplication <span class="sy0">*</span><span class="br0">&#41;</span>application didFinishLaunchingWithOptions<span class="sy0">:</span><span class="br0">&#40;</span><a href="http://developer.apple.com/documentation/Cocoa/Reference/Foundation/Classes/NSDictionary_Class/"><span class="kw5">NSDictionary</span></a> <span class="sy0">*</span><span class="br0">&#41;</span>launchOptions <span class="br0">&#123;</span> &nbsp; &nbsp;<br />
&nbsp; &nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; UIImage <span class="sy0">*</span>image1 <span class="sy0">=</span> <span class="br0">&#91;</span>UIImage imageWithContentsOfFile<span class="sy0">:</span><span class="br0">&#91;</span><span class="br0">&#91;</span><a href="http://developer.apple.com/documentation/Cocoa/Reference/Foundation/Classes/NSBundle_Class/"><span class="kw5">NSBundle</span></a> mainBundle<span class="br0">&#93;</span> pathForResource<span class="sy0">:</span><span class="co3">@</span><span class="st0">&quot;1-1.png&quot;</span> ofType<span class="sy0">:</span><span class="kw2">nil</span><span class="br0">&#93;</span><span class="br0">&#93;</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; view1 <span class="sy0">=</span> <span class="br0">&#91;</span><span class="br0">&#91;</span>UIImageView alloc<span class="br0">&#93;</span> initWithImage<span class="sy0">:</span>image1<span class="br0">&#93;</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; UIImage <span class="sy0">*</span>image2 <span class="sy0">=</span> <span class="br0">&#91;</span>UIImage imageWithContentsOfFile<span class="sy0">:</span><span class="br0">&#91;</span><span class="br0">&#91;</span><a href="http://developer.apple.com/documentation/Cocoa/Reference/Foundation/Classes/NSBundle_Class/"><span class="kw5">NSBundle</span></a> mainBundle<span class="br0">&#93;</span> pathForResource<span class="sy0">:</span><span class="co3">@</span><span class="st0">&quot;2-1.png&quot;</span> ofType<span class="sy0">:</span><span class="kw2">nil</span><span class="br0">&#93;</span><span class="br0">&#93;</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; view2 <span class="sy0">=</span> <span class="br0">&#91;</span><span class="br0">&#91;</span>UIImageView alloc<span class="br0">&#93;</span> initWithImage<span class="sy0">:</span>image2<span class="br0">&#93;</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; view2.hidden <span class="sy0">=</span> <span class="kw2">YES</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="br0">&#91;</span>subView addSubview<span class="sy0">:</span>view1<span class="br0">&#93;</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="br0">&#91;</span>subView addSubview<span class="sy0">:</span>view2<span class="br0">&#93;</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; change <span class="sy0">=</span> <span class="kw2">NO</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="br0">&#91;</span>window makeKeyAndVisible<span class="br0">&#93;</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="kw1">return</span> <span class="kw2">YES</span>;<br />
<span class="br0">&#125;</span></p>
<p><span class="sy0">-</span><span class="br0">&#40;</span><span class="kw4">void</span><span class="br0">&#41;</span>performTransition<br />
<span class="br0">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; CATransition <span class="sy0">*</span>transition <span class="sy0">=</span> <span class="br0">&#91;</span>CATransition animation<span class="br0">&#93;</span>;</p>
<p>&nbsp; &nbsp; &nbsp; &nbsp; transition.duration <span class="sy0">=</span> <span class="nu0">0.75</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; transition.timingFunction <span class="sy0">=</span> <span class="br0">&#91;</span>CAMediaTimingFunction functionWithName<span class="sy0">:</span>kCAMediaTimingFunctionEaseInEaseOut<span class="br0">&#93;</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; <a href="http://developer.apple.com/documentation/Cocoa/Reference/Foundation/Classes/NSString_Class/"><span class="kw5">NSString</span></a> <span class="sy0">*</span>types<span class="br0">&#91;</span>4<span class="br0">&#93;</span> <span class="sy0">=</span> <span class="br0">&#123;</span>kCATransitionMoveIn, kCATransitionPush, kCATransitionReveal, kCATransitionFade<span class="br0">&#125;</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; <a href="http://developer.apple.com/documentation/Cocoa/Reference/Foundation/Classes/NSString_Class/"><span class="kw5">NSString</span></a> <span class="sy0">*</span>subtypes<span class="br0">&#91;</span>4<span class="br0">&#93;</span> <span class="sy0">=</span> <span class="br0">&#123;</span>kCATransitionFromLeft, kCATransitionFromRight, kCATransitionFromTop, kCATransitionFromBottom<span class="br0">&#125;</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="kw4">int</span> rnd <span class="sy0">=</span> random<span class="br0">&#40;</span><span class="br0">&#41;</span> <span class="sy0">%</span> <span class="nu0">4</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; transition.type <span class="sy0">=</span> types<span class="br0">&#91;</span>rnd<span class="br0">&#93;</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="kw1">if</span><span class="br0">&#40;</span>rnd &lt; 3<span class="br0">&#41;</span> &nbsp; &nbsp; <span class="br0">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; transition.subtype <span class="sy0">=</span> subtypes<span class="br0">&#91;</span>random<span class="br0">&#40;</span><span class="br0">&#41;</span> <span class="sy0">%</span> 4<span class="br0">&#93;</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="br0">&#125;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; change <span class="sy0">=</span> <span class="kw2">YES</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; transition.delegate <span class="sy0">=</span> self;<br />
&nbsp; &nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="br0">&#91;</span>subView.layer addAnimation<span class="sy0">:</span>transition forKey<span class="sy0">:</span><span class="kw2">nil</span><span class="br0">&#93;</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; view1.hidden <span class="sy0">=</span> <span class="kw2">YES</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; view2.hidden <span class="sy0">=</span> <span class="kw2">NO</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; UIImageView <span class="sy0">*</span>tmp <span class="sy0">=</span> view2;<br />
&nbsp; &nbsp; &nbsp; &nbsp; view2 <span class="sy0">=</span> view1;<br />
&nbsp; &nbsp; &nbsp; &nbsp; view1 <span class="sy0">=</span> tmp;<br />
<span class="br0">&#125;</span></p>
<p><span class="sy0">-</span><span class="br0">&#40;</span><span class="kw4">void</span><span class="br0">&#41;</span>animationDidStop<span class="sy0">:</span><span class="br0">&#40;</span>CAAnimation <span class="sy0">*</span><span class="br0">&#41;</span>theAnimation finished<span class="sy0">:</span><span class="br0">&#40;</span><span class="kw4">BOOL</span><span class="br0">&#41;</span>flag<br />
<span class="br0">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; change <span class="sy0">=</span> <span class="kw2">NO</span>;<br />
<span class="br0">&#125;</span></p>
<p><span class="sy0">-</span><span class="br0">&#40;</span>IBAction<span class="br0">&#41;</span>ChangeView<span class="sy0">:</span><span class="br0">&#40;</span><span class="kw4">id</span><span class="br0">&#41;</span>sender<br />
<span class="br0">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="kw1">if</span><span class="br0">&#40;</span><span class="sy0">!</span>change<span class="br0">&#41;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="br0">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="br0">&#91;</span>self performTransition<span class="br0">&#93;</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="br0">&#125;</span><br />
<span class="br0">&#125;</span></div>
</div>
<p><strong>Step 9:</strong> Now compile and run the application in the Simulator.</p>
<p><a href="http://www.edumobile.org/iphone/wp-content/uploads/2010/08/1-7.jpg"><img src="http://www.edumobile.org/iphone/wp-content/uploads/2010/08/1-7-230x300.jpg" alt="" title="1-7" width="230" height="300" class="alignnone size-medium wp-image-2535" /></a></p>
<p>You can <strong>Download SourceCode</strong> from here <a href='http://www.edumobile.org/iphone/wp-content/uploads/2010/08/Windowbase_iPad.zip'>Windowbase_iPad</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.edumobile.org/iphone/ipad-development/change-view-in-ipad/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Mail Send from iPad</title>
		<link>http://www.edumobile.org/iphone/ipad-development/mail-send-from-ipad/</link>
		<comments>http://www.edumobile.org/iphone/ipad-development/mail-send-from-ipad/#comments</comments>
		<pubDate>Mon, 26 Jul 2010 07:07:45 +0000</pubDate>
		<dc:creator>Sushant</dc:creator>
				<category><![CDATA[iPad Development]]></category>
		<category><![CDATA[iPad tutorials]]></category>
		<category><![CDATA[Mail Send]]></category>
		<category><![CDATA[Mail Send from iPad]]></category>

		<guid isPermaLink="false">http://www.edumobile.org/iphone/?p=2504</guid>
		<description><![CDATA[This is the very simple application. In this application we will see how to mail send from the iPad.]]></description>
			<content:encoded><![CDATA[<p>This is the very simple application. In this application we will see how to mail send from the iPad.</p>
<p><strong>Step 1:</strong> Create a View base application using template. Give the application name “MailComposer”.</p>
<p><strong>Step 2:</strong> 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.</p>
<p><strong>Step 3:</strong> Expand classes and notice Interface Builder created the MailComposerViewController class for you. Expand Resources and notice the template generated a separate nib, MailComposerViewController.xib, for the “MailComposer”.</p>
<p><strong>Step 4:</strong> We need to add MessageUI Framework. Select Frameworks folder -&gt;Add -&gt; Existing Framework -&gt; Add MessageUI Framework.</p>
<p><strong>Step 5: </strong>In the MailComposerViewController.h file , we have import MessageUI framework. Create an instance of UIButton class and add one buttonPressed method. So make the following changes in the file.</p>
<div class="codesnip-container" >
<div class="objc codesnip" style="font-family:monospace;"><span class="co1">#import &lt;UIKit/UIKit.h&gt;</span><br />
<span class="co1">#import &lt;MessageUI/MessageUI.h&gt;</span></p>
<p><span class="kw1">@interface</span> MailComposerViewController <span class="sy0">:</span> UIViewController <br />
&lt;MFMailComposeViewControllerDelegate&gt;<br />
<span class="br0">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; IBOutlet UIButton <span class="sy0">*</span>button;<br />
<span class="br0">&#125;</span></p>
<p><span class="sy0">-</span> <span class="br0">&#40;</span>IBAction<span class="br0">&#41;</span>buttonPressed;</div>
</div>
<p><strong>Step 6:</strong> Double click MailComposerViewController.xib file and open it to the Interface Builder. First drag the Round Rect button from the library and place it to the view window. Connect File&#8217;s Owner icon to the View icon and select view. Drag File&#8217;s Owner icon to the round Rect button and select button and select the Round Rect button and bring up Connection Inspector next drag Touch Up Inside to the File&#8217;s Owner icon and select buttonPressed: action. Now save the MailComposerViewController.xib file, close it and go back to the Xcode.</p>
<p><strong>Step 7:</strong> Open the MailComposerViewController.m file and make the following changes in the file.</p>
<div class="codesnip-container" >
<div class="objc codesnip" style="font-family:monospace;"><span class="sy0">-</span> <span class="br0">&#40;</span><span class="kw4">void</span><span class="br0">&#41;</span>viewDidLoad <span class="br0">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="kw1">if</span> <span class="br0">&#40;</span><span class="br0">&#91;</span>MFMailComposeViewController canSendMail<span class="br0">&#93;</span><span class="br0">&#41;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; button.enabled <span class="sy0">=</span> <span class="kw2">YES</span>;<br />
<span class="br0">&#125;</span></p>
<p>
<span class="sy0">-</span> <span class="br0">&#40;</span>IBAction<span class="br0">&#41;</span>buttonPressed <span class="br0">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; MFMailComposeViewController <span class="sy0">*</span>mailController <span class="sy0">=</span> <span class="br0">&#91;</span><span class="br0">&#91;</span>MFMailComposeViewController alloc<span class="br0">&#93;</span> init<span class="br0">&#93;</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; mailController.mailComposeDelegate <span class="sy0">=</span> self;<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="br0">&#91;</span>mailController setSubject<span class="sy0">:</span><span class="co3">@</span><span class="st0">&quot;Hello World&quot;</span><span class="br0">&#93;</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="br0">&#91;</span>mailController setMessageBody<span class="sy0">:</span><span class="co3">@</span><span class="st0">&quot;This is the MailSend Application&#8230;.&quot;</span> isHTML<span class="sy0">:</span><span class="kw2">NO</span><span class="br0">&#93;</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="br0">&#91;</span>self presentModalViewController<span class="sy0">:</span>mailController animated<span class="sy0">:</span><span class="kw2">YES</span><span class="br0">&#93;</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="br0">&#91;</span>mailController release<span class="br0">&#93;</span>;<br />
<span class="br0">&#125;</span></p>
<p><span class="sy0">-</span> <span class="br0">&#40;</span><span class="kw4">void</span><span class="br0">&#41;</span>mailComposeController<span class="sy0">:</span><span class="br0">&#40;</span>MFMailComposeViewController<span class="sy0">*</span><span class="br0">&#41;</span>mailController didFinishWithResult<span class="sy0">:</span><span class="br0">&#40;</span>MFMailComposeResult<span class="br0">&#41;</span>result error<span class="sy0">:</span><span class="br0">&#40;</span><a href="http://developer.apple.com/documentation/Cocoa/Reference/Foundation/Classes/NSError_Class/"><span class="kw5">NSError</span></a><span class="sy0">*</span><span class="br0">&#41;</span>error <span class="br0">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="br0">&#91;</span>self becomeFirstResponder<span class="br0">&#93;</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="br0">&#91;</span>self dismissModalViewControllerAnimated<span class="sy0">:</span><span class="kw2">YES</span><span class="br0">&#93;</span>;<br />
<span class="br0">&#125;</span></div>
</div>
<p><strong>Step 8:</strong> Now Compile and run the application in the Simulator.</p>
<p><a href="http://www.edumobile.org/iphone/wp-content/uploads/2010/07/1-75.jpg"><img src="http://www.edumobile.org/iphone/wp-content/uploads/2010/07/1-75-232x300.jpg" alt="" title="1-7" width="232" height="300" class="alignnone size-medium wp-image-2509" /></a></p>
<p>You can <strong>Download SourceCode</strong> from here <a href="http://www.edumobile.org/iphone/wp-content/uploads/2010/07/MailComposer.zip">MailComposer</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.edumobile.org/iphone/ipad-development/mail-send-from-ipad/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>ViewBase application in iPad</title>
		<link>http://www.edumobile.org/iphone/ipad-development/viewbase-application-in-ipad/</link>
		<comments>http://www.edumobile.org/iphone/ipad-development/viewbase-application-in-ipad/#comments</comments>
		<pubDate>Thu, 15 Jul 2010 07:43:21 +0000</pubDate>
		<dc:creator>Sushant</dc:creator>
				<category><![CDATA[iPad Development]]></category>
		<category><![CDATA[iPad tutorials]]></category>
		<category><![CDATA[ViewBase application]]></category>
		<category><![CDATA[ViewBase application in iPad]]></category>

		<guid isPermaLink="false">http://www.edumobile.org/iphone/?p=2443</guid>
		<description><![CDATA[This is the simple View Base application. In this application we will display image,  button and label.]]></description>
			<content:encoded><![CDATA[<p>This is the simple View Base application. In this application we will display image,  button and label.</p>
<p><strong>Step 1: </strong>Create a View base application using template. Give the application name &#8220;ViewBase_iPad&#8221;.</p>
<p><strong>Step 2:</strong> 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.</p>
<p><strong>Step 3:</strong> Xpand classes and notice Interface Builder created the ViewBase_iPadViewController class for you. Expand Resources and notice the template generated a separate nib,ViewBase_iPadViewController.xib, for the “ViewBase_iPad”.</p>
<p><strong>Step 4:</strong> In the ViewBase_iPadViewController.h file, we have created instance of UILabel and UIImage class. Define one IBAction method. So make the following changes.</p>
<div class="codesnip-container" >
<div class="objc codesnip" style="font-family:monospace;"><span class="co1">#import &lt;UIKit/UIKit.h&gt;</span></p>
<p><span class="kw1">@interface</span> ViewBase_iPadViewController <span class="sy0">:</span> UIViewController <span class="br0">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <br />
&nbsp;IBOutlet UILabel <span class="sy0">*</span>myLabel;<br />
&nbsp;IBOutlet UIImage <span class="sy0">*</span>myImage;</p>
<p><span class="br0">&#125;</span></p>
<p><span class="kw1">@property</span><span class="br0">&#40;</span>nonatomic,retain<span class="br0">&#41;</span> IBOutlet UILabel <span class="sy0">*</span>myLabel;<br />
<span class="kw1">@property</span><span class="br0">&#40;</span>nonatomic,retain<span class="br0">&#41;</span> IBOutlet UIImage <span class="sy0">*</span>myImage;</p>
<p><span class="sy0">-</span><span class="br0">&#40;</span>IBAction<span class="br0">&#41;</span>ButtonPressed<span class="sy0">:</span><span class="br0">&#40;</span><span class="kw4">id</span><span class="br0">&#41;</span>sender;</div>
</div>
<p><strong>Step 5:</strong> Double click the ViewBase_iPadViewController.xib file and open it to the Interface Builder.First drag the Image View from the library and place it to the View window. Next drag label and Round Rect from the library and place it to the view window. Select the Round Rect from the view window and bring up Connection iNspector. Drag from the Touch Up Inside to the File&#8217;s Owner icon and select ButtonPressed: method. Connect File&#8217;s Owner icon to the View icon and select view and connect File&#8217;s Owner icon to the label select myLabel. Now save the ViewBase_iPadViewController.xib file, close it and go back to the Xcode.</p>
<p><strong>Step 6:</strong> Open the ViewBase_iPadViewController.m file and make the following changes in the file.</p>
<div class="codesnip-container" >
<div class="objc codesnip" style="font-family:monospace;"><span class="sy0">-</span><span class="br0">&#40;</span>IBAction<span class="br0">&#41;</span>ButtonPressed<span class="sy0">:</span><span class="br0">&#40;</span><span class="kw4">id</span><span class="br0">&#41;</span>sender<span class="br0">&#123;</span></p>
<p>myLabel.text <span class="sy0">=</span> <span class="co3">@</span><span class="st0">&quot;Welocome to the Real World!!!&quot;</span>;<br />
<span class="br0">&#125;</span></div>
</div>
<p><strong>Step 7:</strong> Now compile and run the application in the Simulator.</p>
<p><a href="http://www.edumobile.org/iphone/wp-content/uploads/2010/07/1-73.jpg"><img src="http://www.edumobile.org/iphone/wp-content/uploads/2010/07/1-73-232x300.jpg" alt="" title="1-7" width="232" height="300" class="alignnone size-medium wp-image-2444" /></a></p>
<p>You can <strong>Download SourceCode</strong> from here <a href='http://www.edumobile.org/iphone/wp-content/uploads/2010/07/ViewBase_iPad.zip'>ViewBase_iPad</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.edumobile.org/iphone/ipad-development/viewbase-application-in-ipad/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to play Video in iPad</title>
		<link>http://www.edumobile.org/iphone/ipad-development/how-to-play-video-in-ipad/</link>
		<comments>http://www.edumobile.org/iphone/ipad-development/how-to-play-video-in-ipad/#comments</comments>
		<pubDate>Wed, 14 Jul 2010 08:28:19 +0000</pubDate>
		<dc:creator>Sushant</dc:creator>
				<category><![CDATA[iPad Development]]></category>
		<category><![CDATA[How to play Video in iPad]]></category>
		<category><![CDATA[iPad tutorials]]></category>
		<category><![CDATA[Play Video]]></category>

		<guid isPermaLink="false">http://www.edumobile.org/iphone/?p=2427</guid>
		<description><![CDATA[This is the very simple application . In this application we will see how to play video in the iPad.]]></description>
			<content:encoded><![CDATA[<p>This is the very simple application . In this application we will see how to play video in the iPad.</p>
<p><strong>Step 1:</strong> Create a View base application using template. Give the application name “VideoPlay_iPad”.</p>
<p><strong>Step 2:</strong> 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.</p>
<p><strong>Step 3:</strong> Xpand classes and notice Interface Builder created the VideoPlay_iPadViewController class for you. Expand Resources and notice the template generated a separate nib,VideoPlay_iPadViewController.xib, for the “VideoPlay_iPad”.</p>
<p><strong>Step 4:</strong> We need to add MediaPlayer.framework in the Frameworks folder. Select-&gt; Frameworks folder -&gt; Add -&gt;Existing Frameworks -&gt; then select MediaPlayer.framework.</p>
<p><strong>Step 5:</strong> In the VideoPlay_iPadViewController.h file, we have created instance of MPMoviePlayerController class, that manage the playback of a movie from a file or from the network, and create a instance of NSURL class . So make the following changes in the file.</p>
<div class="codesnip-container" >
<div class="objc codesnip" style="font-family:monospace;"><span class="co1">#import &lt;UIKit/UIKit.h&gt;</span><br />
<span class="co1">#import &lt;MediaPlayer/MediaPlayer.h&gt;</span></p>
<p><span class="kw1">@interface</span> VideoPlay_iPadViewController <span class="sy0">:</span> UIViewController <span class="br0">&#123;</span></p>
<p>&nbsp; &nbsp; &nbsp; &nbsp; MPMoviePlayerController <span class="sy0">*</span>videoPlayer;<br />
&nbsp; &nbsp; &nbsp; &nbsp; <a href="http://developer.apple.com/documentation/Cocoa/Reference/Foundation/Classes/NSURL_Class/"><span class="kw5">NSURL</span></a> <span class="sy0">*</span>videoURL;<br />
&nbsp; &nbsp; &nbsp; &nbsp; <br />
<span class="br0">&#125;</span></div>
</div>
<p><strong>Step 6:</strong> Open the VideoPlay_iPadViewController.m file and make the following changes in the file.</p>
<div class="codesnip-container" >
<div class="objc codesnip" style="font-family:monospace;"><span class="sy0">-</span><span class="br0">&#40;</span><span class="kw4">void</span><span class="br0">&#41;</span>viewWillAppear<span class="sy0">:</span><span class="br0">&#40;</span><span class="kw4">BOOL</span><span class="br0">&#41;</span>animated<br />
<span class="br0">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <a href="http://developer.apple.com/documentation/Cocoa/Reference/Foundation/Classes/NSString_Class/"><span class="kw5">NSString</span></a> <span class="sy0">*</span>urlStr <span class="sy0">=</span> <span class="br0">&#91;</span><span class="br0">&#91;</span><a href="http://developer.apple.com/documentation/Cocoa/Reference/Foundation/Classes/NSBundle_Class/"><span class="kw5">NSBundle</span></a> mainBundle<span class="br0">&#93;</span> pathForResource<span class="sy0">:</span><span class="co3">@</span><span class="st0">&quot;3idiots.mov&quot;</span> ofType<span class="sy0">:</span><span class="kw2">nil</span><span class="br0">&#93;</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; <a href="http://developer.apple.com/documentation/Cocoa/Reference/Foundation/Classes/NSURL_Class/"><span class="kw5">NSURL</span></a> <span class="sy0">*</span>url <span class="sy0">=</span> <span class="br0">&#91;</span><a href="http://developer.apple.com/documentation/Cocoa/Reference/Foundation/Classes/NSURL_Class/"><span class="kw5">NSURL</span></a> fileURLWithPath<span class="sy0">:</span>urlStr<span class="br0">&#93;</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; videoPlayer <span class="sy0">=</span> <span class="br0">&#91;</span><span class="br0">&#91;</span>MPMoviePlayerController alloc<span class="br0">&#93;</span> initWithContentURL<span class="sy0">:</span>url<span class="br0">&#93;</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="br0">&#91;</span>self.view addSubview<span class="sy0">:</span>videoPlayer.view<span class="br0">&#93;</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; videoPlayer.view.frame <span class="sy0">=</span> CGRectMake<span class="br0">&#40;</span>0, 0,768, 1000<span class="br0">&#41;</span>; &nbsp;<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="br0">&#91;</span>videoPlayer play<span class="br0">&#93;</span>;<br />
<span class="br0">&#125;</span></div>
</div>
<p><strong>Step 7:</strong> Now compile and run the application in the Simulator.</p>
<p><a href="http://www.edumobile.org/iphone/wp-content/uploads/2010/07/1-71.jpg"><img src="http://www.edumobile.org/iphone/wp-content/uploads/2010/07/1-71-232x300.jpg" alt="" title="1-7" width="232" height="300" class="alignnone size-medium wp-image-2428" /></a></p>
<p>You can <strong>Download SourceCode</strong> from here  <a href='http://www.edumobile.org/iphone/wp-content/uploads/2010/07/VideoPlay_iPad.zip'>VideoPlay_iPad</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.edumobile.org/iphone/ipad-development/how-to-play-video-in-ipad/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>How to image moved using Touch function in iPad</title>
		<link>http://www.edumobile.org/iphone/ipad-development/how-to-image-moved-using-touch-function-in-ipad/</link>
		<comments>http://www.edumobile.org/iphone/ipad-development/how-to-image-moved-using-touch-function-in-ipad/#comments</comments>
		<pubDate>Thu, 08 Jul 2010 07:02:20 +0000</pubDate>
		<dc:creator>Sushant</dc:creator>
				<category><![CDATA[iPad Development]]></category>
		<category><![CDATA[How to image moved using Touch function in iPad]]></category>
		<category><![CDATA[image moved using touch function]]></category>
		<category><![CDATA[iPad tutorials]]></category>

		<guid isPermaLink="false">http://www.edumobile.org/iphone/?p=2403</guid>
		<description><![CDATA[In this application we will see how to image moved ,using touch function we will shift images any where of the screen.]]></description>
			<content:encoded><![CDATA[<p>In this application we will see how to image moved ,using touch function we will shift images any where of the screen.</p>
<p><strong>Step 1:</strong> Create a View base application using template. Give the application name “RotateImage”.</p>
<p><strong>Step 2:</strong> 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.</p>
<p><strong>Step 3: </strong>Xpand classes and notice Interface Builder created the RotateImageViewController class for you. Expand Resources and notice the template generated a separate nib,RotateImageViewController.xib, for the “RotateImage”.</p>
<p><strong>Step 4:</strong> We need to add UIView class in the project. Select Classes -&gt; Add -&gt; New File -&gt; Cocoa Touch Class -&gt; Objective C class -&gt; select UIView from the Subclass of. Give the file name &#8220;ImageView&#8221;.</p>
<p><strong>Step 5:</strong> We have added one resource in the Resources folder. Give the name of the resource &#8220;1.png&#8221;.</p>
<p><strong>Step 6:</strong> In the ImageView.h file, we specified the superclass as a UIImageView. So make the following changes in the file:</p>
<div class="codesnip-container" >
<div class="objc codesnip" style="font-family:monospace;"><span class="co1">#import &lt;UIKit/UIKit.h&gt;</span><br />
&nbsp;<span class="kw1">@interface</span> ImageView <span class="sy0">:</span> UIImageView <span class="br0">&#123;</span><br />
<span class="br0">&#125;</span></div>
</div>
<p><strong>Step 7:</strong> Open the ImageView.m file , make the following changes in the file.</p>
<div class="codesnip-container" >
<div class="objc codesnip" style="font-family:monospace;"><span class="sy0">-</span> <span class="br0">&#40;</span><span class="kw4">id</span><span class="br0">&#41;</span> initWithImage<span class="sy0">:</span><span class="br0">&#40;</span>UIImage <span class="sy0">*</span><span class="br0">&#41;</span>image <span class="br0">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="kw1">if</span> <span class="br0">&#40;</span>self <span class="sy0">=</span> <span class="br0">&#91;</span>super initWithImage<span class="sy0">:</span>image<span class="br0">&#93;</span><span class="br0">&#41;</span> <span class="br0">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="br0">&#91;</span>self setUserInteractionEnabled<span class="sy0">:</span><span class="kw2">YES</span><span class="br0">&#93;</span>; <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="br0">&#91;</span>self setMultipleTouchEnabled<span class="sy0">:</span><span class="kw2">YES</span><span class="br0">&#93;</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="br0">&#125;</span> <span class="kw1">return</span> self;<br />
<span class="br0">&#125;</span></p>
<p><span class="sy0">-</span> <span class="br0">&#40;</span><span class="kw4">void</span><span class="br0">&#41;</span> touchesMoved<span class="sy0">:</span><span class="br0">&#40;</span><a href="http://developer.apple.com/documentation/Cocoa/Reference/Foundation/Classes/NSSet_Class/"><span class="kw5">NSSet</span></a> <span class="sy0">*</span><span class="br0">&#41;</span>touches withEvent<span class="sy0">:</span><span class="br0">&#40;</span>UIEvent <span class="sy0">*</span><span class="br0">&#41;</span>event<br />
<span class="br0">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="kw1">if</span> <span class="br0">&#40;</span><span class="br0">&#91;</span>touches count<span class="br0">&#93;</span> <span class="sy0">==</span> 1<span class="br0">&#41;</span> <span class="br0">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; CGPoint newTouch <span class="sy0">=</span> <span class="br0">&#91;</span><span class="br0">&#91;</span>touches anyObject<span class="br0">&#93;</span> locationInView<span class="sy0">:</span><span class="br0">&#91;</span>self superview<span class="br0">&#93;</span><span class="br0">&#93;</span>; <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; CGPoint lastTouch <span class="sy0">=</span> <span class="br0">&#91;</span><span class="br0">&#91;</span>touches anyObject<span class="br0">&#93;</span> previousLocationInView<span class="sy0">:</span> <span class="br0">&#91;</span>self superview<span class="br0">&#93;</span><span class="br0">&#93;</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="kw4">float</span> xDif <span class="sy0">=</span> newTouch.x <span class="sy0">-</span> lastTouch.x; <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="kw4">float</span> yDif <span class="sy0">=</span> newTouch.y <span class="sy0">-</span> lastTouch.y;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; CGAffineTransform translate <span class="sy0">=</span> CGAffineTransformMakeTranslation<span class="br0">&#40;</span>xDif, yDif<span class="br0">&#41;</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="br0">&#91;</span>self setTransform<span class="sy0">:</span> CGAffineTransformConcat<span class="br0">&#40;</span><span class="br0">&#91;</span>self transform<span class="br0">&#93;</span>, translate<span class="br0">&#41;</span><span class="br0">&#93;</span>; <br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="br0">&#125;</span> <br />
&nbsp; &nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; <br />
<span class="br0">&#125;</span></div>
</div>
<p><strong>Step 8:</strong> In the the RotateImageViewController.h file we have import &#8220;ImageView.h&#8221; file.</p>
<p><strong>Step 9:</strong> Open the RotateImageViewController.m file, we create ImageView and make it visible. So make the following changes in the file.</p>
<div class="codesnip-container" >
<div class="objc codesnip" style="font-family:monospace;"><span class="sy0">-</span> <span class="br0">&#40;</span><span class="kw4">void</span><span class="br0">&#41;</span>viewDidLoad <span class="br0">&#123;</span><br />
&nbsp; &nbsp; <span class="br0">&#91;</span>super viewDidLoad<span class="br0">&#93;</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; ImageView<span class="sy0">*</span> imageView <span class="sy0">=</span> <span class="br0">&#91;</span><span class="br0">&#91;</span>ImageView alloc<span class="br0">&#93;</span> initWithImage<span class="sy0">:</span><span class="br0">&#91;</span>UIImage imageNamed<span class="sy0">:</span><span class="co3">@</span><span class="st0">&quot;1.png&quot;</span><span class="br0">&#93;</span><span class="br0">&#93;</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="br0">&#91;</span>imageView setFrame<span class="sy0">:</span>CGRectMake<span class="br0">&#40;</span>110, 180, <span class="br0">&#91;</span>imageView frame<span class="br0">&#93;</span>.size.width,<span class="br0">&#91;</span>imageView frame<span class="br0">&#93;</span>.size.height<span class="br0">&#41;</span><span class="br0">&#93;</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="br0">&#91;</span><span class="br0">&#91;</span>self view<span class="br0">&#93;</span> addSubview<span class="sy0">:</span>imageView<span class="br0">&#93;</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="br0">&#91;</span>imageView release<span class="br0">&#93;</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; <br />
<span class="br0">&#125;</span></div>
</div>
<p><strong>Step 10: </strong>Now compile and run the application in the Simulator.</p>
<p><a href="http://www.edumobile.org/iphone/wp-content/uploads/2010/07/1.tiff"><img src="http://www.edumobile.org/iphone/wp-content/uploads/2010/07/1.tiff" alt="" title="1" class="alignnone size-full wp-image-2407" /></a></p>
<p>You can <strong>Download SourceCode</strong> from here <a href='http://www.edumobile.org/iphone/wp-content/uploads/2010/07/RotateImage.zip'>RotateImage</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.edumobile.org/iphone/ipad-development/how-to-image-moved-using-touch-function-in-ipad/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Display images in TabBar Application in iPad</title>
		<link>http://www.edumobile.org/iphone/ipad-development/display-images-in-tabbar-application-in-ipad/</link>
		<comments>http://www.edumobile.org/iphone/ipad-development/display-images-in-tabbar-application-in-ipad/#comments</comments>
		<pubDate>Tue, 06 Jul 2010 12:52:25 +0000</pubDate>
		<dc:creator>Sushant</dc:creator>
				<category><![CDATA[iPad Development]]></category>
		<category><![CDATA[Display images]]></category>
		<category><![CDATA[Display images in TabBar Application in iPad]]></category>
		<category><![CDATA[iPad tutorials]]></category>

		<guid isPermaLink="false">http://www.edumobile.org/iphone/?p=2392</guid>
		<description><![CDATA[This is the very easy example . We will see how to  image display in the different tab in the TabBarApplication using only Interface Builder.]]></description>
			<content:encoded><![CDATA[<p>This is the very easy example . We will see how to  image display in the different tab in the TabBarApplication using only Interface Builder.</p>
<p><strong>Step 1:</strong> Create a TabBar Application using template. Give the application name “TabBarApplication_iPad”.</p>
<p><strong>Step 2:</strong> 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.</p>
<p><strong>Step 3:</strong> Xpand classes and notice Interface Builder created the TabBarApplication_iPadViewController class for you. Expand Resources and notice the template generated a separate nib,TabBarApplication_iPadViewController.xib, for the “TabBarApplication_iPad”.</p>
<p><strong>Step 4:</strong> We need to add two images in the Resource folder. Give the images name &#8220;1.png&#8221;, &#8220;2.png&#8221;.</p>
<p><strong>Step 5: </strong>Double click the FirstView.xib file and open it to the Interface Builder. First drag the UIImageView from the library and place it to the View window. Select the UIImageView from the view and bring up Attribute Inspector and select the &#8220;1.png&#8221;. Connect File&#8217;s Owner icon to the View icon and select the view. Save the .xib file and go back to the Xcode.</p>
<p><strong>Step 6:</strong> Double click the SecondView.xib file and open it to the Interface Builder. First drag the UIImageView from the library and place it to the View window. Select the UIImageView from the view and bring up Attribute Inspector and select the &#8220;2.png&#8221;. Connect File&#8217;s Owner icon to the View icon and select the view. Save the .xib file and go back to the Xcode.</p>
<p><strong>Step 7: </strong>Now compile and run the application in the Simulator.</p>
<p><a href="http://www.edumobile.org/iphone/wp-content/uploads/2010/07/1.jpg"><img class="alignnone size-medium wp-image-2393" title="1" src="http://www.edumobile.org/iphone/wp-content/uploads/2010/07/1-234x300.jpg" alt="" width="234" height="300" /></a></p>
<p>You can <strong>Download SourceCode</strong> from here <a href="http://www.edumobile.org/iphone/wp-content/uploads/2010/07/TabBarApplication_iPad.zip">TabBarApplication_iPad</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.edumobile.org/iphone/ipad-development/display-images-in-tabbar-application-in-ipad/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Draw Circle Triangle and Rectangle in iPad</title>
		<link>http://www.edumobile.org/iphone/ipad-development/draw-circle-triangle-and-rectangle-in-iphone/</link>
		<comments>http://www.edumobile.org/iphone/ipad-development/draw-circle-triangle-and-rectangle-in-iphone/#comments</comments>
		<pubDate>Mon, 21 Jun 2010 10:19:45 +0000</pubDate>
		<dc:creator>Sushant</dc:creator>
				<category><![CDATA[iPad Development]]></category>
		<category><![CDATA[Draw circle Triangle and Rectangle]]></category>
		<category><![CDATA[Draw Circle Triangle and Rectangle in iPad]]></category>
		<category><![CDATA[iPad tutorials]]></category>

		<guid isPermaLink="false">http://edumobile.org/iphone/?p=2178</guid>
		<description><![CDATA[This is the very simple tutorial. In this tutorial we will see how to draw Circle, Triangle and  Rectangle in the iPad.]]></description>
			<content:encoded><![CDATA[<p>This is the very simple tutorial. In this tutorial we will see how to draw Circle, Triangle and  Rectangle in the iPad.</p>
<p><strong>Step 1:</strong> Create a Window base application using template. Give the application name “ThreeViews”.</p>
<p><strong>Step 2:</strong> 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.</p>
<p><strong>Step 3:</strong> We need to add  one UIView file in the project. Select classes-&gt; New File -&gt; Add -&gt;Cocoa Touch Class -&gt; Select Objective C class -&gt; Subclass of -&gt; UIView. Give the class name &#8220;CircleView&#8221;.</p>
<p><strong>Step 4:</strong> Open the ThreeViewsAppDelegate.m file and make the following changes in the file:</p>
<div class="codesnip-container" >
<div class="objc codesnip" style="font-family:monospace;"><span class="sy0">-</span><span class="br0">&#40;</span><span class="kw4">void</span><span class="br0">&#41;</span>applicationDidFinishLaunching<span class="sy0">:</span><span class="br0">&#40;</span>UIApplication <span class="sy0">*</span><span class="br0">&#41;</span>application <span class="br0">&#123;</span></p>
<p>CircleView <span class="sy0">*</span>view <span class="sy0">=</span> <span class="br0">&#91;</span><span class="br0">&#91;</span>CircleView alloc<span class="br0">&#93;</span> initWithFrame<span class="sy0">:</span><span class="br0">&#91;</span>window frame<span class="br0">&#93;</span><span class="br0">&#93;</span>;<br />
<span class="br0">&#91;</span>window addSubview<span class="sy0">:</span>view<span class="br0">&#93;</span>;<br />
<span class="br0">&#91;</span>view release<span class="br0">&#93;</span>;</p>
<p><span class="br0">&#91;</span>window makeKeyAndVisible<span class="br0">&#93;</span>;</p>
<p><span class="br0">&#125;</span></div>
</div>
<p><strong>Step 5:</strong> Open the CicleView.m file and make the following changes in the drawRect: method.</p>
<div class="codesnip-container" >
<div class="objc codesnip" style="font-family:monospace;"><span class="sy0">-</span> <span class="br0">&#40;</span><span class="kw4">void</span><span class="br0">&#41;</span>drawRect<span class="sy0">:</span><span class="br0">&#40;</span>CGRect<span class="br0">&#41;</span>rect <span class="br0">&#123;</span><br />
CGContextRef contextRef <span class="sy0">=</span> UIGraphicsGetCurrentContext<span class="br0">&#40;</span><span class="br0">&#41;</span>;</p>
<p>CGContextSetRGBFillColor<span class="br0">&#40;</span>contextRef, 0, 0, 255, 0.1<span class="br0">&#41;</span>;<br />
CGContextSetRGBStrokeColor<span class="br0">&#40;</span>contextRef, 0, 0, 255, 0.5<span class="br0">&#41;</span>;</p>
<p><span class="co2">// Draw a circle (filled)</span><br />
CGContextFillEllipseInRect<span class="br0">&#40;</span>contextRef, CGRectMake<span class="br0">&#40;</span>100, 100, 25, 25<span class="br0">&#41;</span><span class="br0">&#41;</span>;</p>
<p><span class="co2">// Draw a circle (border only)</span><br />
CGContextStrokeEllipseInRect<span class="br0">&#40;</span>contextRef, CGRectMake<span class="br0">&#40;</span>100, 100, 25, 25<span class="br0">&#41;</span><span class="br0">&#41;</span>;</p>
<p><span class="co2">// Get the graphics context and clear it</span><br />
CGContextRef ctx <span class="sy0">=</span> UIGraphicsGetCurrentContext<span class="br0">&#40;</span><span class="br0">&#41;</span>;<br />
CGContextClearRect<span class="br0">&#40;</span>ctx, rect<span class="br0">&#41;</span>;</p>
<p><span class="co2">// Draw a green solid circle</span><br />
CGContextSetRGBFillColor<span class="br0">&#40;</span>ctx, 0, 255, 0, 1<span class="br0">&#41;</span>;<br />
CGContextFillEllipseInRect<span class="br0">&#40;</span>ctx, CGRectMake<span class="br0">&#40;</span>100, 100, 25, 25<span class="br0">&#41;</span><span class="br0">&#41;</span>;</p>
<p><span class="co2">// Draw a yellow hollow rectangle</span><br />
CGContextSetRGBStrokeColor<span class="br0">&#40;</span>ctx, 255, 255, 0, 1<span class="br0">&#41;</span>;<br />
CGContextStrokeRect<span class="br0">&#40;</span>ctx, CGRectMake<span class="br0">&#40;</span>195, 195, 60, 60<span class="br0">&#41;</span><span class="br0">&#41;</span>;</p>
<p><span class="co2">// Draw a purple triangle with using lines</span><br />
CGContextSetRGBStrokeColor<span class="br0">&#40;</span>ctx, 255, 0, 255, 1<span class="br0">&#41;</span>;<br />
CGPoint points<span class="br0">&#91;</span>6<span class="br0">&#93;</span> <span class="sy0">=</span> <span class="br0">&#123;</span> CGPointMake<span class="br0">&#40;</span>100, 200<span class="br0">&#41;</span>, CGPointMake<span class="br0">&#40;</span>150, 250<span class="br0">&#41;</span>,<br />
CGPointMake<span class="br0">&#40;</span>150, 250<span class="br0">&#41;</span>, CGPointMake<span class="br0">&#40;</span>50, 250<span class="br0">&#41;</span>,<br />
CGPointMake<span class="br0">&#40;</span>50, 250<span class="br0">&#41;</span>, CGPointMake<span class="br0">&#40;</span>100, 200<span class="br0">&#41;</span> <span class="br0">&#125;</span>;<br />
CGContextStrokeLineSegments<span class="br0">&#40;</span>ctx, points, 6<span class="br0">&#41;</span>;</p>
<p><span class="br0">&#125;</span></div>
</div>
<p><strong>Step 6:</strong> Now compile and run the application in the Simulator.</p>
<p><a href="http://edumobile.org/iphone/wp-content/uploads/2010/06/23.jpg"><img class="alignnone size-medium wp-image-2179" title="23" src="http://edumobile.org/iphone/wp-content/uploads/2010/06/23-162x300.jpg" alt="" width="162" height="300" /></a></p>
<p>You can <strong>Download SourceCode</strong> from here <a href="http://edumobile.org/iphone/wp-content/uploads/2010/06/ThreeViews1.zip">ThreeViews</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.edumobile.org/iphone/ipad-development/draw-circle-triangle-and-rectangle-in-iphone/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
	</channel>
</rss>

