<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:georss='http://www.georss.org/georss' xmlns:gd='http://schemas.google.com/g/2005' xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-7660917028131688558</id><updated>2012-01-19T14:24:54.054+05:30</updated><category term='SQLite3'/><category term='IPHONE'/><category term='APNS'/><category term='NSMutableArray'/><category term='Reverse'/><category term='UTC'/><category term='Fonts'/><category term='Memory Management'/><category term='iOS4.0'/><category term='UINavigationBar'/><category term='NSString'/><category term='XCode'/><category term='DataBase'/><category term='SDK'/><category term='c'/><category term='UIKeyBoard'/><category term='c#'/><category term='Terminate App'/><category term='UISearchBar'/><category term='Backward Compatibility'/><category term='DateTime'/><category term='UISlider'/><category term='Objective-C'/><category term='Links'/><category term='List'/><category term='UIPickerView'/><category term='Debugging'/><category term='Push Notification'/><category term='UITableView'/><category term='TimeZone'/><category term='UIColor'/><category term='iPad'/><category term='CoreAnimation'/><category term='NSArray'/><category term='TintColor'/><category term='Animation'/><category term='c++'/><category term='UITextField'/><title type='text'>Learn Programming</title><subtitle type='html'>Learn Tips &amp;amp; Tricks Of Programming,Learn iPhone/iPod Programming,Learn Objective-c,Get Usefull MAC Applications</subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://jainmarket.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7660917028131688558/posts/default?max-results=100'/><link rel='alternate' type='text/html' href='http://jainmarket.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>Rahul Vyas</name><uri>http://www.blogger.com/profile/08326955903115378266</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://bp1.blogger.com/_6C_XpG63jYw/SAgrxtkt56I/AAAAAAAAACc/pr7-vuTQS5w/S220/P1170634+(Small).JPG'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>65</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>100</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-7660917028131688558.post-8985809447010949980</id><published>2011-10-14T12:39:00.000+05:30</published><updated>2011-10-14T12:39:35.748+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='iOS4.0'/><category scheme='http://www.blogger.com/atom/ns#' term='IPHONE'/><title type='text'>Moving to a new domain</title><content type='html'>&lt;div dir="ltr" style="text-align: left;" trbidi="on"&gt;Hello All&amp;nbsp;Readers&amp;nbsp;and iOS Developers,&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;I am having pleasure to announce that very soon I'll start a new domain named&lt;br /&gt;&lt;br /&gt;&lt;a href="http://iosdevtips.net/"&gt;iosdevtips.net&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Thanks,&lt;br /&gt;&lt;br /&gt;Rahul Vyas&lt;br /&gt;iOS Developer&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7660917028131688558-8985809447010949980?l=jainmarket.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='related' href='http://iosdevtips.net' title='Moving to a new domain'/><link rel='replies' type='application/atom+xml' href='http://jainmarket.blogspot.com/feeds/8985809447010949980/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7660917028131688558&amp;postID=8985809447010949980' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7660917028131688558/posts/default/8985809447010949980'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7660917028131688558/posts/default/8985809447010949980'/><link rel='alternate' type='text/html' href='http://jainmarket.blogspot.com/2011/10/moving-to-new-domain.html' title='Moving to a new domain'/><author><name>Rahul Vyas</name><uri>http://www.blogger.com/profile/08326955903115378266</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://bp1.blogger.com/_6C_XpG63jYw/SAgrxtkt56I/AAAAAAAAACc/pr7-vuTQS5w/S220/P1170634+(Small).JPG'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7660917028131688558.post-5885516888654434992</id><published>2010-10-08T16:21:00.002+05:30</published><updated>2011-05-10T08:35:13.271+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='iPad'/><category scheme='http://www.blogger.com/atom/ns#' term='UITableView'/><category scheme='http://www.blogger.com/atom/ns#' term='IPHONE'/><title type='text'>UITableView backgroundColor always gray on iPad (fix)</title><content type='html'>&lt;div dir="ltr" style="text-align: left;" trbidi="on"&gt;Here is a quick fix to get rid of gray background color on grouped style UITableView.&lt;br /&gt;&lt;br /&gt;if ([tableView respondsToSelector:@selector(backgroundView)]){&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; tableView.backgroundView = nil;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; [tableView setBackgroundColor:[UIColor clearColor]]; &lt;br /&gt;}&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7660917028131688558-5885516888654434992?l=jainmarket.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://jainmarket.blogspot.com/feeds/5885516888654434992/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7660917028131688558&amp;postID=5885516888654434992' title='4 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7660917028131688558/posts/default/5885516888654434992'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7660917028131688558/posts/default/5885516888654434992'/><link rel='alternate' type='text/html' href='http://jainmarket.blogspot.com/2010/10/uitableview-backgroundcolor-always-gray.html' title='UITableView backgroundColor always gray on iPad (fix)'/><author><name>Rahul Vyas</name><uri>http://www.blogger.com/profile/08326955903115378266</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://bp1.blogger.com/_6C_XpG63jYw/SAgrxtkt56I/AAAAAAAAACc/pr7-vuTQS5w/S220/P1170634+(Small).JPG'/></author><thr:total>4</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7660917028131688558.post-7638310834226775019</id><published>2010-09-24T18:22:00.001+05:30</published><updated>2010-10-05T10:42:52.538+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='NSMutableArray'/><category scheme='http://www.blogger.com/atom/ns#' term='Objective-C'/><category scheme='http://www.blogger.com/atom/ns#' term='NSArray'/><category scheme='http://www.blogger.com/atom/ns#' term='Reverse'/><title type='text'>Reverse objects of an NSArray/NSMutableArray easily</title><content type='html'>Here is an example of reversing a NSArray/NSMutableArray&lt;br /&gt;&lt;br /&gt;&lt;b&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; NSString *string = @"a,b,c,d,e,f,g,h,i,j,k";&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; NSArray *array = [string componentsSeparatedByString:@","];&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; NSLog(@"array = %@",array);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; NSArray* reversedArray = [[array reverseObjectEnumerator] allObjects];&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; NSLog(@"Reverse array = %@",reversedArray);&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Happy coding all iPhone coderz&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7660917028131688558-7638310834226775019?l=jainmarket.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://jainmarket.blogspot.com/feeds/7638310834226775019/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7660917028131688558&amp;postID=7638310834226775019' title='3 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7660917028131688558/posts/default/7638310834226775019'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7660917028131688558/posts/default/7638310834226775019'/><link rel='alternate' type='text/html' href='http://jainmarket.blogspot.com/2010/09/reverse-objects-of-nsarraynsmutablearra.html' title='Reverse objects of an NSArray/NSMutableArray easily'/><author><name>Rahul Vyas</name><uri>http://www.blogger.com/profile/08326955903115378266</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://bp1.blogger.com/_6C_XpG63jYw/SAgrxtkt56I/AAAAAAAAACc/pr7-vuTQS5w/S220/P1170634+(Small).JPG'/></author><thr:total>3</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7660917028131688558.post-6285397262784792116</id><published>2010-07-29T11:41:00.000+05:30</published><updated>2010-07-29T11:41:12.749+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='Objective-C'/><category scheme='http://www.blogger.com/atom/ns#' term='IPHONE'/><category scheme='http://www.blogger.com/atom/ns#' term='NSString'/><title type='text'>Put double quotes in NSString</title><content type='html'>Here is a simple way to put&amp;nbsp; double quotes in your NSString&lt;br /&gt;&lt;br /&gt;NSString *myString = @"I say \"Hello!\""; &lt;br /&gt;The output will be&lt;br /&gt;&lt;span style="color: red;"&gt;I say "Hello!"&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7660917028131688558-6285397262784792116?l=jainmarket.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://jainmarket.blogspot.com/feeds/6285397262784792116/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7660917028131688558&amp;postID=6285397262784792116' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7660917028131688558/posts/default/6285397262784792116'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7660917028131688558/posts/default/6285397262784792116'/><link rel='alternate' type='text/html' href='http://jainmarket.blogspot.com/2010/07/put-double-quotes-in-nsstring.html' title='Put double quotes in NSString'/><author><name>Rahul Vyas</name><uri>http://www.blogger.com/profile/08326955903115378266</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://bp1.blogger.com/_6C_XpG63jYw/SAgrxtkt56I/AAAAAAAAACc/pr7-vuTQS5w/S220/P1170634+(Small).JPG'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7660917028131688558.post-491918896191717050</id><published>2010-07-08T18:20:00.000+05:30</published><updated>2010-07-08T18:20:14.109+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='XCode'/><category scheme='http://www.blogger.com/atom/ns#' term='UIColor'/><category scheme='http://www.blogger.com/atom/ns#' term='Objective-C'/><category scheme='http://www.blogger.com/atom/ns#' term='IPHONE'/><title type='text'>Generate Random Color</title><content type='html'>Here is a simple method to generate a random color :-&lt;br /&gt;just put this method in any class you want and put the definition in the header file&lt;br /&gt;&lt;br /&gt;in &lt;span style="color: red;"&gt;.h&lt;/span&gt; file&lt;br /&gt;+ (UIColor *) randomColor;&lt;br /&gt;&lt;br /&gt;in &lt;span style="color: red;"&gt;.m&lt;/span&gt; file &lt;br /&gt;+ (UIColor *) randomColor {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; CGFloat red =&amp;nbsp; (CGFloat)random()/(CGFloat)RAND_MAX;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; CGFloat blue = (CGFloat)random()/(CGFloat)RAND_MAX;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; CGFloat green = (CGFloat)random()/(CGFloat)RAND_MAX;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; return [UIColor colorWithRed:red green:green blue:blue alpha:1.0];&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;get random color by calling this method like this....&lt;br /&gt;&lt;br /&gt;//Class Name is the class where you have put the method&lt;br /&gt;UIColor *randColor = [ClassName randomColor];&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7660917028131688558-491918896191717050?l=jainmarket.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://jainmarket.blogspot.com/feeds/491918896191717050/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7660917028131688558&amp;postID=491918896191717050' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7660917028131688558/posts/default/491918896191717050'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7660917028131688558/posts/default/491918896191717050'/><link rel='alternate' type='text/html' href='http://jainmarket.blogspot.com/2010/07/generate-random-color.html' title='Generate Random Color'/><author><name>Rahul Vyas</name><uri>http://www.blogger.com/profile/08326955903115378266</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://bp1.blogger.com/_6C_XpG63jYw/SAgrxtkt56I/AAAAAAAAACc/pr7-vuTQS5w/S220/P1170634+(Small).JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7660917028131688558.post-5668390896224501243</id><published>2010-07-08T11:11:00.000+05:30</published><updated>2010-07-08T11:11:26.661+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='UIKeyBoard'/><category scheme='http://www.blogger.com/atom/ns#' term='iOS4.0'/><category scheme='http://www.blogger.com/atom/ns#' term='IPHONE'/><title type='text'>UIKeyboardBoundsUserInfoKey is deprecated, what to use instead?</title><content type='html'>&lt;span id="ctl00_ContentPlaceHolder1_Question1_lblAnswer"&gt;From the &lt;a href="http://developer.apple.com/iphone/library/documentation/UIKit/Reference/UIWindow_Class/UIWindowClassReference/UIWindowClassReference.html#//apple_ref/doc/uid/TP40006817-CH3-SW27" rel="nofollow"&gt;documentation&lt;/a&gt; for &lt;code&gt;UIKeyboardBoundsUserInfoKey&lt;/code&gt;:&lt;br /&gt;&lt;blockquote&gt;   &lt;em&gt;The key for an NSValue object containing a CGRect that  identifies the bounds rectangle of the keyboard in window coordinates.  This value is sufficient for obtaining the size of the keyboard. If you  want to get the origin of the keyboard on the screen (before or after  animation) use the values obtained from the user info dictionary through  the UIKeyboardCenterBeginUserInfoKey or UIKeyboardCenterEndUserInfoKey  constants. &lt;strong&gt;Use the UIKeyboardFrameBeginUserInfoKey or  UIKeyboardFrameEndUserInfoKey key instead.&lt;/strong&gt;&lt;/em&gt;&lt;strong&gt;&lt;/strong&gt;&lt;br /&gt;&lt;/blockquote&gt;Apple recommends implementing a convenience routine such as this  (which could be implemented as a category addition to &lt;code&gt;UIScreen&lt;/code&gt;):&lt;br /&gt;&lt;pre class="prettyprint"&gt;&lt;code&gt;&lt;span class="pun"&gt;+&lt;/span&gt;&lt;span class="pln"&gt; &lt;/span&gt;&lt;span class="pun"&gt;(&lt;/span&gt;&lt;span class="typ"&gt;CGRect&lt;/span&gt;&lt;span class="pun"&gt;)&lt;/span&gt;&lt;span class="pln"&gt; convertRect&lt;/span&gt;&lt;span class="pun"&gt;:(&lt;/span&gt;&lt;span class="typ"&gt;CGRect&lt;/span&gt;&lt;span class="pun"&gt;)&lt;/span&gt;&lt;span class="pln"&gt;rect toView&lt;/span&gt;&lt;span class="pun"&gt;:(&lt;/span&gt;&lt;span class="typ"&gt;UIView&lt;/span&gt;&lt;span class="pln"&gt; &lt;/span&gt;&lt;span class="pun"&gt;*)&lt;/span&gt;&lt;span class="pln"&gt;view &lt;/span&gt;&lt;span class="pun"&gt;{&lt;/span&gt;&lt;span class="pln"&gt;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span class="typ"&gt;UIWindow&lt;/span&gt;&lt;span class="pln"&gt; &lt;/span&gt;&lt;span class="pun"&gt;*&lt;/span&gt;&lt;span class="pln"&gt;window &lt;/span&gt;&lt;span class="pun"&gt;=&lt;/span&gt;&lt;span class="pln"&gt; &lt;/span&gt;&lt;span class="pun"&gt;[&lt;/span&gt;&lt;span class="pln"&gt;view isKindOfClass&lt;/span&gt;&lt;span class="pun"&gt;:[&lt;/span&gt;&lt;span class="typ"&gt;UIWindow&lt;/span&gt;&lt;span class="pln"&gt; &lt;/span&gt;&lt;span class="kwd"&gt;class&lt;/span&gt;&lt;span class="pun"&gt;]]&lt;/span&gt;&lt;span class="pln"&gt; &lt;/span&gt;&lt;span class="pun"&gt;?&lt;/span&gt;&lt;span class="pln"&gt; &lt;/span&gt;&lt;span class="pun"&gt;(&lt;/span&gt;&lt;span class="typ"&gt;UIWindow&lt;/span&gt;&lt;span class="pln"&gt; &lt;/span&gt;&lt;span class="pun"&gt;*)&lt;/span&gt;&lt;span class="pln"&gt; view &lt;/span&gt;&lt;span class="pun"&gt;:&lt;/span&gt;&lt;span class="pln"&gt; &lt;/span&gt;&lt;span class="pun"&gt;[&lt;/span&gt;&lt;span class="pln"&gt;view window&lt;/span&gt;&lt;span class="pun"&gt;];&lt;/span&gt;&lt;span class="pln"&gt;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span class="kwd"&gt;return&lt;/span&gt;&lt;span class="pln"&gt; &lt;/span&gt;&lt;span class="pun"&gt;[&lt;/span&gt;&lt;span class="pln"&gt;view convertRect&lt;/span&gt;&lt;span class="pun"&gt;:[&lt;/span&gt;&lt;span class="pln"&gt;window convertRect&lt;/span&gt;&lt;span class="pun"&gt;:&lt;/span&gt;&lt;span class="pln"&gt;rect fromWindow&lt;/span&gt;&lt;span class="pun"&gt;:&lt;/span&gt;&lt;span class="kwd"&gt;nil&lt;/span&gt;&lt;span class="pun"&gt;]&lt;/span&gt;&lt;span class="pln"&gt; fromView&lt;/span&gt;&lt;span class="pun"&gt;:&lt;/span&gt;&lt;span class="kwd"&gt;nil&lt;/span&gt;&lt;span class="pun"&gt;];&lt;/span&gt;&lt;span class="pln"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span class="pun"&gt;}&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;pre class="prettyprint"&gt;&lt;code&gt;&lt;span class="pun"&gt;&amp;nbsp;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;pre class="prettyprint"&gt;&lt;span id="ctl00_ContentPlaceHolder1_Question1_lblAnswer"&gt;to recover &lt;br /&gt;window-adjusted keyboard frame size properties.I took a different approach, which involves checking the device &lt;br /&gt;orientation:&lt;code&gt;&lt;span class="pun"&gt; &lt;/span&gt;&lt;/code&gt;&lt;br /&gt;&lt;pre class="prettyprint"&gt;&lt;code&gt;&lt;span class="typ"&gt;CGRect&lt;/span&gt;&lt;span class="pln"&gt; _keyboardEndFrame&lt;/span&gt;&lt;span class="pun"&gt;;&lt;/span&gt;&lt;span class="pln"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span class="pun"&gt;[[&lt;/span&gt;&lt;span class="pln"&gt;notification&lt;/span&gt;&lt;span class="pun"&gt;.&lt;/span&gt;&lt;span class="pln"&gt;userInfo valueForKey&lt;/span&gt;&lt;span class="pun"&gt;:&lt;/span&gt;&lt;span class="typ"&gt;UIKeyboardFrameEndUserInfoKey&lt;/span&gt;&lt;span class="pun"&gt;]&lt;/span&gt;&lt;span class="pln"&gt; getValue&lt;/span&gt;&lt;span class="pun"&gt;:&amp;amp;&lt;/span&gt;&lt;span class="pln"&gt;_keyboardEndFrame&lt;/span&gt;&lt;span class="pun"&gt;];&lt;/span&gt;&lt;span class="pln"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span class="typ"&gt;CGFloat&lt;/span&gt;&lt;span class="pln"&gt; _keyboardHeight&lt;/span&gt;&lt;span class="pun"&gt;;&lt;/span&gt;&lt;span class="pln"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span class="kwd"&gt;if&lt;/span&gt;&lt;span class="pln"&gt; &lt;/span&gt;&lt;span class="pun"&gt;([[&lt;/span&gt;&lt;span class="typ"&gt;UIDevice&lt;/span&gt;&lt;span class="pln"&gt; currentDevice&lt;/span&gt;&lt;span class="pun"&gt;]&lt;/span&gt;&lt;span class="pln"&gt; orientation&lt;/span&gt;&lt;span class="pun"&gt;]&lt;/span&gt;&lt;span class="pln"&gt; &lt;/span&gt;&lt;span class="pun"&gt;==&lt;/span&gt;&lt;span class="pln"&gt; &lt;/span&gt;&lt;span class="typ"&gt;UIDeviceOrientationPortrait&lt;/span&gt;&lt;span class="pln"&gt; &lt;/span&gt;&lt;span class="pun"&gt;||&lt;/span&gt;&lt;span class="pln"&gt; &lt;/span&gt;&lt;span class="pun"&gt;[[&lt;/span&gt;&lt;span class="typ"&gt;UIDevice&lt;/span&gt;&lt;span class="pln"&gt; currentDevice&lt;/span&gt;&lt;span class="pun"&gt;]&lt;/span&gt;&lt;span class="pln"&gt; orientation&lt;/span&gt;&lt;span class="pun"&gt;]&lt;/span&gt;&lt;span class="pln"&gt; &lt;/span&gt;&lt;span class="pun"&gt;==&lt;/span&gt;&lt;span class="pln"&gt; &lt;/span&gt;&lt;span class="typ"&gt;UIDeviceOrientationPortraitUpsideDown&lt;/span&gt;&lt;span class="pun"&gt;)&lt;/span&gt;&lt;span class="pln"&gt; &lt;/span&gt;&lt;span class="pun"&gt;{&lt;/span&gt;&lt;span class="pln"&gt;&lt;br /&gt;&amp;nbsp; &amp;nbsp; _keyboardHeight &lt;/span&gt;&lt;span class="pun"&gt;=&lt;/span&gt;&lt;span class="pln"&gt; _keyboardEndFrame&lt;/span&gt;&lt;span class="pun"&gt;.&lt;/span&gt;&lt;span class="pln"&gt;size&lt;/span&gt;&lt;span class="pun"&gt;.&lt;/span&gt;&lt;span class="pln"&gt;height&lt;/span&gt;&lt;span class="pun"&gt;;&lt;/span&gt;&lt;span class="pln"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span class="pun"&gt;}&lt;/span&gt;&lt;span class="pln"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span class="kwd"&gt;else&lt;/span&gt;&lt;span class="pln"&gt; &lt;/span&gt;&lt;span class="pun"&gt;{&lt;/span&gt;&lt;span class="pln"&gt;&lt;br /&gt;&amp;nbsp; &amp;nbsp; _keyboardHeight &lt;/span&gt;&lt;span class="pun"&gt;=&lt;/span&gt;&lt;span class="pln"&gt; _keyboardEndFrame&lt;/span&gt;&lt;span class="pun"&gt;.&lt;/span&gt;&lt;span class="pln"&gt;size&lt;/span&gt;&lt;span class="pun"&gt;.&lt;/span&gt;&lt;span class="pln"&gt;width&lt;/span&gt;&lt;span class="pun"&gt;;&lt;/span&gt;&lt;span class="pln"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span class="pun"&gt;}&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;pre class="prettyprint"&gt;&lt;code&gt;&lt;span class="pun"&gt;&amp;nbsp;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;pre class="prettyprint"&gt;&lt;code&gt;&lt;span class="pun"&gt;Thanks to &lt;/span&gt;&lt;/code&gt;&lt;a href="http://www.stackoverflow.com/users/19410" id="ctl00_ContentPlaceHolder1_Question1_hypAnswerAuthor" rel="nofollow" target="_blank"&gt;Alex Reynolds&lt;/a&gt; for the answer&lt;br /&gt;&lt;code&gt;&lt;span class="pun"&gt; &lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/span&gt;&lt;/pre&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7660917028131688558-5668390896224501243?l=jainmarket.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://jainmarket.blogspot.com/feeds/5668390896224501243/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7660917028131688558&amp;postID=5668390896224501243' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7660917028131688558/posts/default/5668390896224501243'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7660917028131688558/posts/default/5668390896224501243'/><link rel='alternate' type='text/html' href='http://jainmarket.blogspot.com/2010/07/uikeyboardboundsuserinfokey-is.html' title='UIKeyboardBoundsUserInfoKey is deprecated, what to use instead?'/><author><name>Rahul Vyas</name><uri>http://www.blogger.com/profile/08326955903115378266</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://bp1.blogger.com/_6C_XpG63jYw/SAgrxtkt56I/AAAAAAAAACc/pr7-vuTQS5w/S220/P1170634+(Small).JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7660917028131688558.post-6002836420157093474</id><published>2010-07-06T11:37:00.000+05:30</published><updated>2010-07-06T11:37:41.041+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='Terminate App'/><category scheme='http://www.blogger.com/atom/ns#' term='iOS4.0'/><category scheme='http://www.blogger.com/atom/ns#' term='IPHONE'/><title type='text'>Opting Out of Background Execution in iPhone OS 4.0</title><content type='html'>If you do not want your application to remain in the background when  it is quit, you can explicitly opt out of the background execution model  by adding the &lt;code&gt;UIApplicationExitsOnSuspend&lt;/code&gt; key to your  application’s &lt;code&gt;Info.plist&lt;/code&gt; file and setting its value to &lt;code&gt;YES&lt;/code&gt;.  When an application opts out, it cycles between the not running,  inactive, and active states and never enters the background or suspended  states. When the user taps the Home button to quit the application, the  &lt;code&gt;&lt;a href="http://developer.apple.com/iphone/library/documentation/UIKit/Reference/UIApplicationDelegate_Protocol/Reference/Reference.html#//apple_ref/occ/intfm/UIApplicationDelegate/applicationWillTerminate:" target="_top"&gt;applicationWillTerminate:&lt;/a&gt;&lt;/code&gt; method of the  application delegate is called and the application has approximately  five seconds to clean up and exit before it is terminated and moved back  to the not running state.&lt;br /&gt;Opting out of background execution may  be preferable for certain types of applications. Specifically, if coding  for the background may require adding significant complexity to your  application, terminating the application may be a simpler solution.  Also, if your application consumes a large amount of memory, the system  might need to terminate your application quickly anyway to make room for  other applications. Thus, opting to terminate, instead of switch to the  background, might yield the same results and save you development time  and effort. &lt;br /&gt;&lt;a href="" name="//apple_ref/doc/uid/TP40007072-CH3-SW25" title="Note"&gt;&lt;/a&gt;&lt;strong&gt;&lt;/strong&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7660917028131688558-6002836420157093474?l=jainmarket.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://jainmarket.blogspot.com/feeds/6002836420157093474/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7660917028131688558&amp;postID=6002836420157093474' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7660917028131688558/posts/default/6002836420157093474'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7660917028131688558/posts/default/6002836420157093474'/><link rel='alternate' type='text/html' href='http://jainmarket.blogspot.com/2010/07/opting-out-of-background-execution-in.html' title='Opting Out of Background Execution in iPhone OS 4.0'/><author><name>Rahul Vyas</name><uri>http://www.blogger.com/profile/08326955903115378266</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://bp1.blogger.com/_6C_XpG63jYw/SAgrxtkt56I/AAAAAAAAACc/pr7-vuTQS5w/S220/P1170634+(Small).JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7660917028131688558.post-5284259245595543293</id><published>2010-06-22T11:04:00.000+05:30</published><updated>2010-06-22T11:04:34.375+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='UISlider'/><category scheme='http://www.blogger.com/atom/ns#' term='IPHONE'/><title type='text'>Customize the default UISlider in iPhone</title><content type='html'>&lt;div style="text-align: center;"&gt;&lt;b&gt;here is a simple way to customize the UISlider images&lt;/b&gt;&lt;/div&gt;&lt;br /&gt;UIImage *stetchLeftTrack = [[UIImage imageNamed:@"left-slide.png"]&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; stretchableImageWithLeftCapWidth:10.0 topCapHeight:0.0];&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; UIImage *stetchRightTrack = [[UIImage imageNamed:@"right-slide.png"]&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;stretchableImageWithLeftCapWidth:10.0 topCapHeight:0.0];&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; [sldDistanceFilter setThumbImage: [UIImage imageNamed:@"slider_ball.png"] forState:UIControlStateNormal];&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; [sldDistanceFilter setMinimumTrackImage:stetchLeftTrack forState:UIControlStateNormal];&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; [sldDistanceFilter setMaximumTrackImage:stetchRightTrack forState:UIControlStateNormal];&lt;br /&gt;&lt;br /&gt;You just need to replace the image names according to your suite.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7660917028131688558-5284259245595543293?l=jainmarket.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://jainmarket.blogspot.com/feeds/5284259245595543293/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7660917028131688558&amp;postID=5284259245595543293' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7660917028131688558/posts/default/5284259245595543293'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7660917028131688558/posts/default/5284259245595543293'/><link rel='alternate' type='text/html' href='http://jainmarket.blogspot.com/2010/06/customize-default-uislider-in-iphone.html' title='Customize the default UISlider in iPhone'/><author><name>Rahul Vyas</name><uri>http://www.blogger.com/profile/08326955903115378266</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://bp1.blogger.com/_6C_XpG63jYw/SAgrxtkt56I/AAAAAAAAACc/pr7-vuTQS5w/S220/P1170634+(Small).JPG'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7660917028131688558.post-7185528333496481295</id><published>2010-05-12T11:15:00.000+05:30</published><updated>2010-05-12T11:15:42.410+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='UITextField'/><category scheme='http://www.blogger.com/atom/ns#' term='IPHONE'/><title type='text'>Limit Characters in UITextField</title><content type='html'>Here is a simple delegate method to limit the characters in UITextfield :-&lt;br /&gt;&lt;br /&gt;- (BOOL)textField:(UITextField *)textField shouldChangeCharactersInRange:(NSRange)range replacementString:(NSString *)string&lt;br /&gt;{&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; NSUInteger newLength = [textField.text length] + [string length] - range.length;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; return (newLength &amp;gt; 8) ? NO : YES;&lt;br /&gt;}&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7660917028131688558-7185528333496481295?l=jainmarket.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://jainmarket.blogspot.com/feeds/7185528333496481295/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7660917028131688558&amp;postID=7185528333496481295' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7660917028131688558/posts/default/7185528333496481295'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7660917028131688558/posts/default/7185528333496481295'/><link rel='alternate' type='text/html' href='http://jainmarket.blogspot.com/2010/05/limit-characters-in-uitextfield.html' title='Limit Characters in UITextField'/><author><name>Rahul Vyas</name><uri>http://www.blogger.com/profile/08326955903115378266</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://bp1.blogger.com/_6C_XpG63jYw/SAgrxtkt56I/AAAAAAAAACc/pr7-vuTQS5w/S220/P1170634+(Small).JPG'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7660917028131688558.post-2090927352673666589</id><published>2010-04-17T16:56:00.001+05:30</published><updated>2010-04-17T16:56:54.884+05:30</updated><title type='text'>Difference b/w NSArray and NSMutableArray</title><content type='html'>&lt;div xmlns='http://www.w3.org/1999/xhtml'&gt;&lt;big&gt;&lt;big&gt;&lt;big&gt;&lt;b&gt;&lt;code&gt;NSMutableArray&lt;/code&gt;&lt;/b&gt;&lt;/big&gt;&lt;/big&gt;&lt;/big&gt; (and all other classes with &lt;b&gt;&lt;code&gt;Mutable&lt;/code&gt;&lt;/b&gt;&lt;br /&gt; in the name) can be modified. So, if you create a plain &lt;big&gt;&lt;big&gt;&lt;big&gt;&lt;b&gt;&lt;code&gt;NSArray&lt;/code&gt;&lt;/b&gt;&lt;/big&gt;&lt;/big&gt;&lt;/big&gt;,&lt;br /&gt; you cannot change its contents later (without recreating it). But if &lt;br /&gt;you create an &lt;b&gt;&lt;big&gt;&lt;big&gt;&lt;big&gt;&lt;code&gt;NSMutableArray&lt;/code&gt;&lt;/big&gt;&lt;/big&gt;&lt;/big&gt;&lt;/b&gt;, you can change it.&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7660917028131688558-2090927352673666589?l=jainmarket.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://jainmarket.blogspot.com/feeds/2090927352673666589/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7660917028131688558&amp;postID=2090927352673666589' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7660917028131688558/posts/default/2090927352673666589'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7660917028131688558/posts/default/2090927352673666589'/><link rel='alternate' type='text/html' href='http://jainmarket.blogspot.com/2010/04/difference-bw-nsarray-and.html' title='Difference b/w NSArray and NSMutableArray'/><author><name>Rahul Vyas</name><uri>http://www.blogger.com/profile/08326955903115378266</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://bp1.blogger.com/_6C_XpG63jYw/SAgrxtkt56I/AAAAAAAAACc/pr7-vuTQS5w/S220/P1170634+(Small).JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7660917028131688558.post-6284661207889281325</id><published>2010-04-16T11:05:00.000+05:30</published><updated>2010-04-16T11:05:36.930+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='IPHONE'/><title type='text'>Difference between signed and unsigend data types</title><content type='html'>&lt;b style="color: red;"&gt;Signed Data Type&lt;/b&gt; - a signed data type is one that can hold both positive or negative  values, i.e. -1 or +456. A 32 bit signed integer can hold the range  -2147483648 to 2147483647&lt;br /&gt;&lt;br /&gt;&lt;b&gt;&lt;span style="color: red;"&gt;Unsigned Data Type&lt;/span&gt;&lt;/b&gt; - Unsigned data types can only hold positive values.&lt;br /&gt;An unsigned 32 bit integer for instance can hold the range 0 to  4294967296&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7660917028131688558-6284661207889281325?l=jainmarket.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://jainmarket.blogspot.com/feeds/6284661207889281325/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7660917028131688558&amp;postID=6284661207889281325' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7660917028131688558/posts/default/6284661207889281325'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7660917028131688558/posts/default/6284661207889281325'/><link rel='alternate' type='text/html' href='http://jainmarket.blogspot.com/2010/04/difference-between-signed-and-unsigend.html' title='Difference between signed and unsigend data types'/><author><name>Rahul Vyas</name><uri>http://www.blogger.com/profile/08326955903115378266</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://bp1.blogger.com/_6C_XpG63jYw/SAgrxtkt56I/AAAAAAAAACc/pr7-vuTQS5w/S220/P1170634+(Small).JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7660917028131688558.post-2994400729560399515</id><published>2010-04-13T16:53:00.001+05:30</published><updated>2010-04-13T16:53:45.009+05:30</updated><title type='text'>The most annoying Xcode error ever: The Info.plist for application at (null) specifies a CFBundleExecutable of (null), which does not exist.</title><content type='html'>&lt;div xmlns='http://www.w3.org/1999/xhtml'&gt;If you're developing an iPhone application in XCode and getting the &lt;br /&gt;error:&lt;br/&gt;&lt;blockquote&gt;“The Info.plist for application at (null) &lt;br /&gt;specifies a CFBundleExecutable of (null), which does not exist.”&lt;/blockquote&gt;here's&lt;br /&gt; how to fix it:&lt;br/&gt;&lt;br/&gt;In Xcode, choose "Executables" from the project &lt;br /&gt;hierarchy. Click your project executable then press Command-I. Choose &lt;br /&gt;the General tab and set the working directory to "Build Products &lt;br /&gt;directory".&lt;br/&gt;&lt;br/&gt;This fixed the problem. The advisory from Apple did &lt;br /&gt;not help much, but did mention the Build Products directory. Under &lt;a href='http://developer.apple.com/iphone/library/releasenotes/General/RN-iPhoneSDK-3/index.html'&gt;SDK&lt;br /&gt; release notes for iPhone OS 3.1, XCode/Developer Tools&lt;/a&gt;:&lt;br/&gt;&lt;br/&gt;&lt;blockquote&gt;"Changing&lt;br /&gt; an iPhone Executable's working directory from “Build Products &lt;br /&gt;directory” may cause the application not to install properly with the &lt;br /&gt;error message “The Info.plist for application at (null) specifies a &lt;br /&gt;CFBundleExecutable of (null), which does not exist.”"&lt;/blockquote&gt;Hope &lt;br /&gt;this saves you a little time. It frustrated me for a while.&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7660917028131688558-2994400729560399515?l=jainmarket.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://jainmarket.blogspot.com/feeds/2994400729560399515/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7660917028131688558&amp;postID=2994400729560399515' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7660917028131688558/posts/default/2994400729560399515'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7660917028131688558/posts/default/2994400729560399515'/><link rel='alternate' type='text/html' href='http://jainmarket.blogspot.com/2010/04/most-annoying-xcode-error-ever.html' title='The most annoying Xcode error ever: The Info.plist for application at (null) specifies a CFBundleExecutable of (null), which does not exist.'/><author><name>Rahul Vyas</name><uri>http://www.blogger.com/profile/08326955903115378266</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://bp1.blogger.com/_6C_XpG63jYw/SAgrxtkt56I/AAAAAAAAACc/pr7-vuTQS5w/S220/P1170634+(Small).JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7660917028131688558.post-8262844870772421016</id><published>2010-04-08T11:41:00.000+05:30</published><updated>2010-04-08T11:41:49.589+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='List'/><category scheme='http://www.blogger.com/atom/ns#' term='Fonts'/><category scheme='http://www.blogger.com/atom/ns#' term='IPHONE'/><title type='text'>Get list of all available fonts with family names in iPhone</title><content type='html'>Here is the piece of code to get list of all available fonts in your iPhone. This will print the list in gdb &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;NSArray *familyNames = [[NSArray alloc] initWithArray:[UIFont familyNames]];&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; NSArray *fontNames;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; NSInteger indFamily, indFont;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; for (indFamily=0; indFamily&amp;lt;[familyNames count]; ++indFamily){&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; NSLog(@"Family name: %@", [familyNames objectAtIndex:indFamily]);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; fontNames = [[NSArray alloc] initWithArray:&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;[UIFont fontNamesForFamilyName:&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp; [familyNames objectAtIndex:indFamily]]];&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; for (indFont=0; indFont&amp;lt;[fontNames count]; ++indFont){&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; NSLog(@"Font name: %@", [fontNames objectAtIndex:indFont]);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; [fontNames release];&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; [familyNames release];&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7660917028131688558-8262844870772421016?l=jainmarket.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://jainmarket.blogspot.com/feeds/8262844870772421016/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7660917028131688558&amp;postID=8262844870772421016' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7660917028131688558/posts/default/8262844870772421016'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7660917028131688558/posts/default/8262844870772421016'/><link rel='alternate' type='text/html' href='http://jainmarket.blogspot.com/2010/04/get-list-of-all-available-fonts-with.html' title='Get list of all available fonts with family names in iPhone'/><author><name>Rahul Vyas</name><uri>http://www.blogger.com/profile/08326955903115378266</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://bp1.blogger.com/_6C_XpG63jYw/SAgrxtkt56I/AAAAAAAAACc/pr7-vuTQS5w/S220/P1170634+(Small).JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7660917028131688558.post-4925122427680614880</id><published>2009-11-26T19:46:00.000+05:30</published><updated>2009-11-26T19:46:38.605+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='Animation'/><category scheme='http://www.blogger.com/atom/ns#' term='IPHONE'/><category scheme='http://www.blogger.com/atom/ns#' term='UIPickerView'/><title type='text'>Funny UIPickerView Animation</title><content type='html'>//Take a NSTimer object and a integer variable in your header file like this&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&lt;span style="color: red;"&gt; NSTimer *timer;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: red;"&gt;&amp;nbsp;&amp;nbsp; int ComponentNumber;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;//Put this line into your viewDidLoad &lt;br /&gt;&lt;br /&gt;&lt;div style="color: red;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; ComponentNumber=0;&lt;br /&gt;&lt;/div&gt;&lt;span style="color: red;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; timer = [NSTimer scheduledTimerWithTimeInterval:3.0 target:self selector:@selector(ChangeComponentNumber) userInfo:nil repeats:YES]; &lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;-(void)ChangeComponentNumber&lt;br /&gt;{&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; if(ComponentNumber&amp;gt;8)&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; [timer invalidate];&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; return;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; else if(ComponentNumber==4)&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; ComponentNumber=ComponentNumber+1;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; [self performSelector:@selector(HidePickerComponents) withObject:nil afterDelay:0.0];&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; else&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; [self performSelector:@selector(HidePickerComponents) withObject:nil afterDelay:0.0];&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;}&lt;br /&gt;-(void)HidePickerComponents&lt;br /&gt;{&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; [UIView beginAnimations:nil context:NULL];&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; [UIView setAnimationDuration:1.0];&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; [UIView setAnimationTransition:UIViewAnimationTransitionCurlUp forView:AlarmSoundPicker cache:YES];&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; [(UIView*)[[AlarmSoundPicker subviews] objectAtIndex:ComponentNumber] setHidden:YES];&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; [UIView commitAnimations];&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; ComponentNumber=ComponentNumber+1;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;br /&gt;}&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7660917028131688558-4925122427680614880?l=jainmarket.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://jainmarket.blogspot.com/feeds/4925122427680614880/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7660917028131688558&amp;postID=4925122427680614880' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7660917028131688558/posts/default/4925122427680614880'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7660917028131688558/posts/default/4925122427680614880'/><link rel='alternate' type='text/html' href='http://jainmarket.blogspot.com/2009/11/funny-uipickerview-animation.html' title='Funny UIPickerView Animation'/><author><name>Rahul Vyas</name><uri>http://www.blogger.com/profile/08326955903115378266</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://bp1.blogger.com/_6C_XpG63jYw/SAgrxtkt56I/AAAAAAAAACc/pr7-vuTQS5w/S220/P1170634+(Small).JPG'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7660917028131688558.post-1351351122025877807</id><published>2009-11-11T18:34:00.000+05:30</published><updated>2009-11-11T18:34:06.271+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='DateTime'/><category scheme='http://www.blogger.com/atom/ns#' term='IPHONE'/><category scheme='http://www.blogger.com/atom/ns#' term='TimeZone'/><category scheme='http://www.blogger.com/atom/ns#' term='UTC'/><title type='text'>Convert All TimeZones To UTC TimeZone format</title><content type='html'>//*******Convert Any TimeZone To UTC*******// &lt;br /&gt;&lt;br /&gt;-(NSString *)getUTCFormateDate:(NSDate *)localDate&lt;br /&gt;{&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; NSDateFormatter *dateFormatter = [[NSDateFormatter alloc] init];&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; NSTimeZone *timeZone = [NSTimeZone timeZoneWithName:@"UTC"];&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; [dateFormatter setTimeZone:timeZone];&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; [dateFormatter setDateFormat:@"yyyy-MM-dd HH:mm:ss"];&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; NSString *dateString = [dateFormatter stringFromDate:localDate];&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; return dateString;&lt;br /&gt;}&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7660917028131688558-1351351122025877807?l=jainmarket.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://jainmarket.blogspot.com/feeds/1351351122025877807/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7660917028131688558&amp;postID=1351351122025877807' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7660917028131688558/posts/default/1351351122025877807'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7660917028131688558/posts/default/1351351122025877807'/><link rel='alternate' type='text/html' href='http://jainmarket.blogspot.com/2009/11/convert-all-timezones-to-utc-timezone.html' title='Convert All TimeZones To UTC TimeZone format'/><author><name>Rahul Vyas</name><uri>http://www.blogger.com/profile/08326955903115378266</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://bp1.blogger.com/_6C_XpG63jYw/SAgrxtkt56I/AAAAAAAAACc/pr7-vuTQS5w/S220/P1170634+(Small).JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7660917028131688558.post-5200344540524931591</id><published>2009-11-07T19:18:00.000+05:30</published><updated>2009-11-07T19:18:50.380+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='TintColor'/><category scheme='http://www.blogger.com/atom/ns#' term='UINavigationBar'/><category scheme='http://www.blogger.com/atom/ns#' term='IPHONE'/><category scheme='http://www.blogger.com/atom/ns#' term='SDK'/><title type='text'>Change navigation bar color in iphone sdk</title><content type='html'>here is how ou change your navigation bar color.&lt;br /&gt;&lt;br /&gt;navigationController.navigationBar.tintColor=[UIColor colorWithRed:42/256.0 green:60/256.0 blue:80/256.0 alpha:1.0];&lt;br /&gt;&lt;br /&gt;just replace the (42,60,80) to your desired RGB Value.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7660917028131688558-5200344540524931591?l=jainmarket.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://jainmarket.blogspot.com/feeds/5200344540524931591/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7660917028131688558&amp;postID=5200344540524931591' title='3 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7660917028131688558/posts/default/5200344540524931591'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7660917028131688558/posts/default/5200344540524931591'/><link rel='alternate' type='text/html' href='http://jainmarket.blogspot.com/2009/11/change-navigation-bar-color-in-iphone.html' title='Change navigation bar color in iphone sdk'/><author><name>Rahul Vyas</name><uri>http://www.blogger.com/profile/08326955903115378266</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://bp1.blogger.com/_6C_XpG63jYw/SAgrxtkt56I/AAAAAAAAACc/pr7-vuTQS5w/S220/P1170634+(Small).JPG'/></author><thr:total>3</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7660917028131688558.post-2426692723345540812</id><published>2009-11-07T19:09:00.000+05:30</published><updated>2009-11-07T19:09:11.365+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='Push Notification'/><category scheme='http://www.blogger.com/atom/ns#' term='APNS'/><title type='text'>Generate Apple Push Notification Certificate</title><content type='html'>&lt;div class="expandcontent"&gt;     &lt;h5 class="expandlabel closed"&gt;&lt;span style="font-size: small;"&gt;Generating a Certificate Signing Request&lt;/span&gt;&lt;/h5&gt;&lt;br /&gt;To request an iPhone Development Certificate, you first need to generate a Certificate Signing Request (CSR) utilizing the Keychain Access application in Mac OS X Leopard. The creation of a CSR will prompt Keychain Access to simultaneously generate your public and private key pair establishing your iPhone Developer identity. Your private key is stored in the login Keychain by default and can be viewed in the Keychain Access application under the ‘Keys’ category. To generate a CSR:&lt;br /&gt;&lt;ol&gt;&lt;li&gt;In your Applications folder, open the Utilities folder and launch Keychain Access.&lt;/li&gt;&lt;li&gt;In the Preferences menu, set Online Certificate  Status Protocol (OSCP) and Certificate Revocation List (CRL) to “Off”.&lt;br /&gt;&lt;img align="top" alt="Keychain Access Preferences" border="0" height="300" src="http://devimages.apple.com/iphone/images/portal/overview/CertHowToTab_img1a.jpg" width="500" /&gt;&lt;br /&gt;&lt;/li&gt;&lt;li&gt;Choose Keychain Access -&amp;gt; Certificate Assistant -&amp;gt; Request a Certificate from a Certificate Authority. Note: If you have a noncompliant private key highlighted in the Keychain during this process, the resulting Certificate Request will not be accepted by the Program Portal. Confirm that you are selecting “Request a Certificate From a Certificate Authority...” and not selecting “Request a Certificate From a Certificate Authority with &lt;private key=""&gt;…”&lt;br /&gt;&lt;br /&gt;&lt;img align="top" alt="Request a Certificate" border="0" height="224" src="http://devimages.apple.com/iphone/images/portal/overview/RequestCertificate.jpg" width="635" /&gt;&lt;br /&gt;&lt;br /&gt;&lt;/private&gt;&lt;/li&gt;&lt;li&gt;In the User Email Address field, enter your email address. Please ensure that the email address entered matches the information that was submitted when you registered as an iPhone Developer.&lt;/li&gt;&lt;li&gt;In the Common Name field enter your name. Please ensure that the name entered matches the information that was submitted when you registered as an iPhone Developer.&lt;/li&gt;&lt;li&gt;No CA (Certificate Authority) Email Address is required. The ‘Required’ message will be removed after completing the following step.&lt;/li&gt;&lt;li&gt;Select the ‘Saved to Disk’ radio button and if prompted, select ‘Let me specify key pair information’ and click ‘Continue’.&lt;br /&gt;&lt;img align="top" alt="Certificate Information" border="0" height="445" src="http://devimages.apple.com/iphone/images/portal/overview/CertificateInformation.jpg" width="600" /&gt;&lt;br /&gt;&lt;br /&gt;&lt;/li&gt;&lt;li&gt;If ‘Let me specify key pair’ was selected, specify a file name and click ‘Save’. In the following screen select ‘2048 bits’ for the Key Size and ‘RSA’ for the Algorithm. Click ‘Continue’.&lt;br /&gt;&lt;img align="top" alt="Key Pair Information" border="0" height="445" src="http://devimages.apple.com/iphone/images/portal/overview/KeyPairInformation.jpg" width="600" /&gt;&lt;br /&gt;&lt;br /&gt;&lt;/li&gt;&lt;li&gt;The Certificate Assistant will create a CSR file on your desktop.&lt;/li&gt;&lt;/ol&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;h5 class="expandlabel closed"&gt;&lt;span style="font-size: small;"&gt;Submitting a Certificate Signing Request for Approval&lt;/span&gt;&lt;/h5&gt;&lt;br /&gt;&lt;br /&gt;&lt;ol&gt;&lt;li&gt;After creating a CSR, log in to the iPhone Developer Program Portal and navigate to ‘Certificates’ &amp;gt; ‘Development’ and click ‘Add Certificate’.&lt;/li&gt;&lt;li&gt;Click the ‘Choose file’ button, select your CSR and click ‘Submit’. If the Key Size was not set to 2048 bits during the CSR creation process, the Portal will reject the CSR.&lt;/li&gt;&lt;li&gt;Upon submission, Team Admins will be notified via email of the certificate request.&lt;/li&gt;&lt;li&gt;Once your CSR is approved or rejected by a Team Admin, you will be notified via email of the change in your certificate status.&lt;br /&gt;&lt;img align="top" alt="Submit Certificate Signing Request" border="0" height="639" src="http://devimages.apple.com/iphone/images/portal/overview/SubmitCSR.jpg" width="640" /&gt;&lt;br /&gt;&lt;/li&gt;&lt;/ol&gt;&lt;br /&gt;&lt;h5 class="expandlabel"&gt;&lt;span style="font-size: small;"&gt;Approving Certificate Signing Requests&lt;/span&gt;&lt;/h5&gt;&lt;br /&gt;&lt;br /&gt;&lt;ol&gt;&lt;li&gt;After submitting a CSR for approval, Team Admins will be directed to the ‘Development’ tab of the ‘Certificates’ section. Here, CSRs can be approved or rejected by clicking the corresponding action next to each request.&lt;/li&gt;&lt;li&gt;Once a CSR is approved or rejected, the requesting Team Member is notified via email of the change in their certificate status. Each iPhone Development Certificate is available to both the Team Member who submitted the CSR for approval and to the Team Admin(s).&lt;br /&gt;&lt;img align="top" alt="Downloading and Installing Development Certificates" border="0" height="536" src="http://devimages.apple.com/iphone/images/portal/overview/CurrentCertificates.jpg" width="640" /&gt;&lt;br /&gt;&lt;/li&gt;&lt;/ol&gt;&lt;br /&gt;&lt;h5 class="expandlabel"&gt;&lt;span style="font-size: small;"&gt;Downloading and Installing Development Certificates&lt;/span&gt;&lt;/h5&gt;&lt;br /&gt;&lt;br /&gt;&lt;div class="expandcontent"&gt;     &lt;ol&gt;&lt;li&gt;In the ‘Certificates’ &amp;gt; ’Distribution’ section of the Portal, control-click the WWDR Intermediate Certificate link and select “Saved Linked File to Downloads” to initiate download of the certificate.&lt;/li&gt;&lt;li&gt;On your local machine, double-click the WWDR Intermediate certificate to launch Keychain Access and install.&lt;/li&gt;&lt;li&gt;Upon CSR approval, Team Members and Team Admins can download their certificates via the ‘Certificates’ section of the Program Portal. Click ‘Download’ next to the certificate name to download your iPhone Development Certificate to your local machine.&lt;/li&gt;&lt;li&gt;On your local machine, double-click the downloaded .cer file to launch Keychain Access and install your certificate.&lt;/li&gt;&lt;li&gt;Team Members can only download their own iPhone Development Certificates. Team Admins have the authority to download the public certificates of all of their Team Members. Apple never receives the private key for a CSR. The private keys are not available to anyone except the original key pair creator and are stored in the system keychain of that Team Member.&lt;br /&gt;&lt;img align="top" alt="Keychain Access - Add Certificate" border="0" height="368" src="http://devimages.apple.com/iphone/images/portal/overview/AddCertificate.jpg" width="640" /&gt;&lt;br /&gt;&lt;img align="top" alt="Keychain Access - Certificate Issued" border="0" height="369" src="http://devimages.apple.com/iphone/images/portal/overview/CertificateIssued.jpg" width="640" /&gt;&lt;/li&gt;&lt;/ol&gt;&lt;/div&gt;&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;h5 class="expandlabel closed"&gt;&lt;span style="font-size: small;"&gt;Generating an App ID&lt;/span&gt;&lt;/h5&gt;&lt;br /&gt;&lt;br /&gt;&lt;div class="expandcontent"&gt;     &lt;ol&gt;&lt;li&gt;Team Agents or Team Admins should navigate to the ‘App ID’ section of the Program Portal.&lt;/li&gt;&lt;li&gt;Click ‘Add ID’.&lt;/li&gt;&lt;li&gt;Enter a common name for your App ID. This is a name for easy reference and identification within the Program Portal.&lt;/li&gt;&lt;li&gt;Enter a Bundle Identifier in the free-form text field. The recommended usage is a reverse-domain name style string, e.g., com.domainname.applicationname. For a suite of applications sharing the same Keychain access, you should use a wild-card character in the Bundle Identifier (e.g. com.domainname.* or *). This Bundle Identifier will need to match whatever CF Bundle Identifier you use for your application in Xcode.&lt;/li&gt;&lt;li&gt;You need to create an App ID without .* in the iPhone developer Portal. An App ID without .* means its unique and works only for a single application(for Push-Notification).&lt;br /&gt;&lt;/li&gt;&lt;li&gt;Click ‘Submit’. At this time, the 10 character Bundle Seed ID is generated and concatenated with the Bundle Identifier you entered. This resulting string is your App ID. Note: The Bundle Seed ID does not need to be entered into Xcode.&lt;br /&gt;&lt;img align="top" alt="Create App ID" border="0" height="541" src="http://devimages.apple.com/iphone/images/portal/overview/CreateAppID.jpg" width="640" /&gt;&lt;br /&gt;&lt;br /&gt;&lt;/li&gt;&lt;li&gt;Generate a new App ID for each set of applications with shared Keychain Access needs. If you are creating a suite of applications that will share the same Keychain access (e.g. sharing passwords between applications) or have a set of applications with no Keychain Access requirements, create a single App ID for all applications utilizing a trailing asterisk as a wild-card character.&lt;/li&gt;&lt;/ol&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;div class="expandcontent"&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;&lt;h5 class="expandlabel"&gt;&lt;span style="font-size: small;"&gt;Registering an App ID for Apple Push Notification service&lt;/span&gt;&lt;/h5&gt;&lt;br /&gt;&lt;br /&gt;&lt;ol&gt;&lt;li&gt;In the App ID section of the Program Portal, locate the App ID you wish to use with the Apple Push Notification service. Only App IDs with a specific bundle ID can be used with the APNs. You cannot use a “wild-card” application ID. You must see “Available” under the Apple Push Notification service column to register this App ID and configure a certificate for this App ID.&lt;/li&gt;&lt;li&gt;Click the 'Details' link next to your desired App ID.&lt;/li&gt;&lt;li&gt;In the Configure App ID page, check the Enable Push Notification Services box and click the Configure button. Clicking this button launches the APNs Assistant, which guides you through the next series of steps that create your App ID specific Client SSL certificate.&lt;br /&gt;&lt;br /&gt;&lt;div id="bjpc" style="text-align: left;"&gt;&lt;img height="343" src="http://docs.google.com/File?id=ddjknsdw_23c9gzjrfh_b" style="height: 347.824px; width: 648px;" width="640" /&gt;&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;&lt;/li&gt;&lt;li&gt;Download the Client SSL certificate file to your download location. Navigate to that location and double-click the certificate file (which has an extension of cer) to install it in your keychain. &lt;/li&gt;&lt;li&gt;When you are finished, click Done in the APNS Assistant.&lt;/li&gt;&lt;li&gt;Double-clicking the file launches Keychain Access. Make sure you install the certificate in your login keychain on the computer you are using for provider development. The APNs SSL certificate should be installed on your notification server.&lt;/li&gt;&lt;li&gt;When you finish these steps you are returned to the Configure App ID page of the iPhone Dev Center portal. The certificate should be badged with a green circle and the label “Enabled”.&lt;/li&gt;&lt;li&gt;To complete the APNs set-up process, you will need to create a new provisioning profile containing your APNs-enabled App ID.&lt;/li&gt;&lt;/ol&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;h5 class="expandlabel closed"&gt;&lt;span style="font-size: small;"&gt;Creating a Development Provisioning Profile&lt;/span&gt;&lt;/h5&gt;&lt;br /&gt;&lt;ol&gt;&lt;li&gt;In the ‘Provisioning’ section of the Portal, Team Admins should click 'Add' on the Development tab.&lt;/li&gt;&lt;li&gt;Enter a name for the provisioning profile.&lt;/li&gt;&lt;li&gt;Specify which devices will be associated with the provisioning profile. You must specify a device in order for that device to utilize the provisioning profile. If a device's UDID is not included in the provisioning profile the profile and your application cannot be installed on that device.&lt;/li&gt;&lt;li&gt;Specify which iPhone Development Certificates will be associated with the provisioning profile. You must specify an iPhone Development Certificate in order for the application code signed with that same certificate to run on the device.&lt;/li&gt;&lt;li&gt;Specify a single App ID for the Development Provisioning Profile. Each Development Provisioning Profile can specify only ONE App ID, therefore, if you have applications requiring different Keychain access, you will need to create a separate Development Provisioning Profile for each of those applications. If you are installing a suite of applications with the same required Keychain access or have a set of applications not requiring access to the Keychain, use an App ID containing the wild-card asterisk character to build all of your applications.&lt;/li&gt;&lt;li&gt;Click ‘Submit’ to generate your Development Provisioning Profile.&lt;br /&gt;&lt;br /&gt;&lt;img align="top" alt="Create Development Provisioning Profile" border="0" height="541" src="http://devimages.apple.com/iphone/images/portal/overview/CreateDevProvProf.jpg" width="640" /&gt;&lt;/li&gt;&lt;/ol&gt;&lt;br /&gt;&lt;h5 class="expandlabel"&gt;&lt;span style="font-size: small;"&gt;Installing a Development Provisioning Profile&lt;/span&gt;&lt;/h5&gt;&lt;br /&gt;All Team Agents, Admins and Members can download a Development Provisioning Profile from the ‘Provisioning’ section of the Portal after it has been created. &lt;i&gt;Only those developers whose Apple device IDs and iPhone Development Certificates are included in the provisioning profile will be able to install and test their application on their device&lt;/i&gt;.&lt;br /&gt;&lt;ol&gt;&lt;li&gt;In the ‘Provisioning’ section of the Program Portal, click the download button next to the desired provisioning profile.&lt;/li&gt;&lt;li&gt;Drag the downloaded file onto the Xcode application icon in the dock or into the ‘Organizer’ window within Xcode. This will automatically copy the .mobileprovision file to the proper directory. Alternatively, you can drag the .mobileprovision file onto the iTunes icon in the dock or copy the file to ‘~/Library/MobileDevice/Provisioning Profiles’. If the directory does not exist you will need to create it. Click on the ‘+’ button in the Provisioning section of the Organizer window to install your .mobileprovision file.&lt;br /&gt;&lt;img align="top" alt="Provisioning Profile in Xcode" border="0" height="525" src="http://devimages.apple.com/iphone/images/portal/overview/InstallProvProf.jpg" width="640" /&gt;&lt;br /&gt;&lt;img align="top" alt="Provisioning Profile in Finder" border="0" height="332" src="http://devimages.apple.com/iphone/images/portal/overview/ProvProfFinder.jpg" width="640" /&gt;&lt;/li&gt;&lt;/ol&gt;&lt;br /&gt;&lt;br /&gt;&lt;h5 class="expandlabel"&gt;&lt;span style="font-size: small;"&gt;Building and Installing your Development Application&lt;/span&gt;&lt;/h5&gt;&lt;br /&gt;Now that you have an approved iPhone Development Certificate, an assigned Apple device and a properly installed Development Provisioning Profile, Xcode can now build your application and install it on your development device. If you have a single iPhone Development Certificate and iPhone Development Provisioning Profile, you don’t need to change any settings in Xcode to start running your applications. To compile and install your code:&lt;br /&gt;&lt;ol&gt;&lt;li&gt;Launch Xcode and open your project.&lt;/li&gt;&lt;li&gt;In the Project Window, select ‘Device - iPhone OS’ from the ‘Device | Debug’ drop down menu in the upper-left hand corner.&lt;br /&gt;&lt;br /&gt;&lt;img align="top" alt="Select Device" border="0" height="518" src="http://devimages.apple.com/iphone/images/portal/overview/SelectDevice012609.jpg" width="640" /&gt;&lt;/li&gt;&lt;li&gt;Highlight the project Target and select the ‘Info’ icon from the top menu bar.&lt;br /&gt;&lt;img align="top" alt="Select Project Info" border="0" height="543" src="http://devimages.apple.com/iphone/images/portal/overview/ProjectInfo012609.jpg" width="640" /&gt;&lt;/li&gt;&lt;li&gt;In the Target Info window, navigate to the ‘Build’ pane. Click the ‘Any iPhone OS Device’ pop-up menu below the ‘Code Signing Identity’ field and select the iPhone Development Certificate/Provisioning Profile pair you wish to sign and install your code with. Your iPhone Development certificate will be in bold with the Provisioning Profile associated with it in grey above. In the example below, ‘iPhone Developer: Team Leader’ is the Development Certificate and ‘My First Development Provisioning Profile’ is the .mobileprovision file paired with it.&lt;br /&gt;&lt;img align="top" alt="Select Development Profile" border="0" height="640" src="http://devimages.apple.com/iphone/images/portal/overview/SelectDevProvProf012609.jpg" width="625" /&gt;&lt;br /&gt;&lt;b&gt;Note:&lt;/b&gt; If the private key for your iPhone Development certificate is missing, or if your iPhone Development certificate is not included in a provisioning profile, you will be unable to select the iPhone Development Certificate/Provisioning Profile pair and you will see the following. Re-installing the private key or downloading a provisioning profile with your iPhone Development certificate included in it will correct this.&lt;br /&gt;&lt;img align="top" alt="Missing Certificate Error" border="0" height="538" src="http://devimages.apple.com/iphone/images/portal/overview/MissingCert.jpg" width="640" /&gt;&lt;br /&gt;&lt;/li&gt;&lt;li&gt;In the Properties Pane of the Target Info window, enter the Bundle Identifier portion of your App ID. If you have used an explicit App ID you must enter the Bundle Identifier portion of the App ID in the Identifier field. For example enter com.domainname.applicationname if your App ID is A1B2C3D4E5.com.domainname.applicationname. If you have used a wildcard asterisk character in your App ID, replace the asterisk with whatever string you choose.&lt;br /&gt;&lt;br /&gt;&lt;img alt="Enter the Bundle Identifier" border="0" height="544" src="http://devimages.apple.com/iphone/images/portal/overview/prepare_dist_v2.4_06a.png" width="640" /&gt;&lt;/li&gt;&lt;/ol&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;h5 class="expandlabel"&gt;&lt;span style="font-size: small;"&gt;Installing the SSL Certificate and Key on the Server&lt;/span&gt;&lt;/h5&gt;&lt;br /&gt;You should install the SSL distribution certificate and private cryptographic key you obtained earlier on the &lt;br /&gt;server computer on which the provider code runs and from which it connects with the sandbox or production &lt;br /&gt;versions of APNs. To do so, complete the following steps: &lt;br /&gt;1. Open Keychain Access utility and click the My Certificates category in the left pane. &lt;br /&gt;2. Find the certificate you want to install and open its disclosure triangle. &lt;br /&gt;When you open the disclosure triangle, you'll see both a certificate and a private key.&lt;br /&gt;3. Select both the certificate and key,select ExportItems from the File menu,and export them as a Personal &lt;br /&gt;Information Exchange(.p12)file. &lt;br /&gt;4. Copy the.p12 file to the new computer. &lt;br /&gt;5. On Mac OSX and Mac OSX Server systems, double-click the.p12 file to install it in the keychain on the &lt;br /&gt;new computer.&lt;br /&gt;6. If you use a windows based server follow below steps.&lt;br /&gt;7. You have imported the aps_developer_identity.cer to the keychain. Then you have to export these new cert and the private key of this cert (not the public key) and saved as .p12 files.&lt;br /&gt;8. Then you use these commands to generate the cert and key in Mac’s Terminal for PEM format (Privacy Enhanced Mail Security Certificate)&lt;br /&gt;&lt;span style="color: maroon;"&gt;openssl pkcs12 -clcerts -nokeys -out cert.pem -in cert.p12&lt;br /&gt;openssl pkcs12 -nocerts -out key.pem -in key.p12&lt;/span&gt;&lt;br /&gt;9. The cert.pem and key.pem files will be used by your own program communicating with APNS.&lt;br /&gt;10. If you want to remove the passphase of private key in key.pem, do this&lt;br /&gt;&lt;span style="color: maroon;"&gt;openssl rsa -in key.pem -out key.unencrypted.pem&lt;/span&gt;&lt;br /&gt;Then combine the certificate and key&lt;br /&gt;&lt;span style="color: maroon;"&gt;cat cert.pem key.unencrypted.pem &amp;gt; ck.pem&lt;/span&gt;&lt;br /&gt;But please set the file permission of this unencrypted key by using chmod 400 and is only readable by root in a sever configuration.&lt;br /&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7660917028131688558-2426692723345540812?l=jainmarket.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://jainmarket.blogspot.com/feeds/2426692723345540812/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7660917028131688558&amp;postID=2426692723345540812' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7660917028131688558/posts/default/2426692723345540812'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7660917028131688558/posts/default/2426692723345540812'/><link rel='alternate' type='text/html' href='http://jainmarket.blogspot.com/2009/11/generate-apple-push-notification.html' title='Generate Apple Push Notification Certificate'/><author><name>Rahul Vyas</name><uri>http://www.blogger.com/profile/08326955903115378266</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://bp1.blogger.com/_6C_XpG63jYw/SAgrxtkt56I/AAAAAAAAACc/pr7-vuTQS5w/S220/P1170634+(Small).JPG'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7660917028131688558.post-423299162320418924</id><published>2009-09-30T21:58:00.002+05:30</published><updated>2009-09-30T21:58:42.974+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='CoreAnimation'/><category scheme='http://www.blogger.com/atom/ns#' term='IPHONE'/><title type='text'>Core Animation for Mac OS X and the iPhone: Creating Compelling Dynamic User Interfaces</title><content type='html'>&lt;img alt="" border="0" src="http://s43.radikal.ru/i099/0907/30/d2072e28f456.jpg" /&gt;&lt;br /&gt;Author:  Bill Dudney&lt;br /&gt;Publisher:  Pragmatic Programmers, LLC, The on October 15, 2008&lt;br /&gt;Pages:  Paperback, 182 pages&lt;br /&gt;Synopsis: Mac OS X Leopard introduces a fantastic new technology that makes writing applications with animated and cinematic user interfaces much easier. We'll explore this new technology by starting with the familiar concepts you already know from the pre-Leopard development kits.&lt;br /&gt;&lt;br /&gt;Then we'll see how they apply to the new frameworks and APIs. We'll build on your existing knowledge of Cocoa and bring you efficiently up to speed on what Core Animation is all about.&lt;br /&gt;&lt;br /&gt;With this book in hand, you can add Core Animation to your Cocoa applications, and make stunning user interfaces that your user's will be showing off to their friends.&lt;br /&gt;&lt;a href="http://www.pragprog.com/titles/bdcora/core-animation-for-mac-os-x-and-the-iphone"&gt;Get the book here&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7660917028131688558-423299162320418924?l=jainmarket.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://jainmarket.blogspot.com/feeds/423299162320418924/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7660917028131688558&amp;postID=423299162320418924' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7660917028131688558/posts/default/423299162320418924'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7660917028131688558/posts/default/423299162320418924'/><link rel='alternate' type='text/html' href='http://jainmarket.blogspot.com/2009/09/core-animation-for-mac-os-x-and-iphone.html' title='Core Animation for Mac OS X and the iPhone: Creating Compelling Dynamic User Interfaces'/><author><name>Rahul Vyas</name><uri>http://www.blogger.com/profile/08326955903115378266</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://bp1.blogger.com/_6C_XpG63jYw/SAgrxtkt56I/AAAAAAAAACc/pr7-vuTQS5w/S220/P1170634+(Small).JPG'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7660917028131688558.post-7666379610291714452</id><published>2009-09-23T19:31:00.000+05:30</published><updated>2009-09-23T19:31:36.749+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='IPHONE'/><category scheme='http://www.blogger.com/atom/ns#' term='Backward Compatibility'/><title type='text'>Run your iPhone application on both iPhone OS 2.0 and iPhone OS 3.0 and above versions</title><content type='html'>first of all in your application delegate create a varaible like this&lt;br /&gt;&lt;br /&gt;your appdelegate header file. &lt;br /&gt;&lt;br /&gt;&lt;div style="color: red;"&gt;float version;&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;then create property for accessing to another classes&lt;br /&gt;&lt;br /&gt;&lt;div style="color: red;"&gt;@property (nonatomic, assign) float version;&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;in appdelegate implementation file&lt;br /&gt;&lt;br /&gt;&lt;div style="color: red;"&gt;@synthesize version;&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;in this method&lt;br /&gt;&lt;div style="color: red;"&gt;- (void)applicationDidFinishLaunching:(UIApplication *)application {&lt;br /&gt;&amp;nbsp;&amp;nbsp; &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; version =[[[UIDevice currentDevice] systemVersion] floatValue];&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; //NSLog(@"Current version no=%f",version);&lt;br /&gt;&amp;nbsp; }&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;now in the class where you are getting warning of method deprecations...&lt;br /&gt;in header file of class&lt;br /&gt;declare this&lt;br /&gt;&lt;br /&gt;&lt;div style="color: red;"&gt;@class yourAppDelegate;&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;now where you declare instance variable declare your appdelegate.&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;b&gt; &lt;/b&gt;&lt;span style="color: red;"&gt;yourAppDelegate *AppDelegate;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;now in implementation file of the class&lt;br /&gt;import header file of your appdelegate&lt;br /&gt;&lt;span style="color: red;"&gt;#import "yourAppDelegate.h"&lt;/span&gt;&lt;b&gt; &lt;/b&gt;&lt;br /&gt;&lt;br /&gt;in the viewDidLoadMethod.&lt;br /&gt;&lt;br /&gt;&lt;span style="color: red;"&gt;- (void)viewDidLoad {&lt;/span&gt;&lt;br style="color: red;" /&gt;&lt;span style="color: red;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; [super viewDidLoad];&lt;/span&gt;&lt;br style="color: red;" /&gt;&lt;span style="color: red;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; AppDelegate=[[UIApplication sharedApplication] delegate];&lt;/span&gt;&lt;br style="color: red;" /&gt;&lt;span style="color: red;"&gt;&amp;nbsp; }&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: red;"&gt;&amp;nbsp;&lt;span style="color: black;"&gt;now where you are getting warning use this code.I am using temporary statements you can put your code.&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: red;"&gt;&lt;span style="color: black;"&gt;if (AppDelegate.version &amp;gt;= 3.0)&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: red;"&gt;&lt;span style="color: black;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; //put your 3.0 code here&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; NSLog(@"Current OS VErsion %f",AppDelegate.version);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; cell.textLabel.text=cellValue;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; [cell.textLabel setFont:[UIFont systemFontOfSize:15.0]];&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; [cell.textLabel setLineBreakMode:UILineBreakModeTailTruncation];// iPhone 3.0 code here&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; else&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: red;"&gt;&lt;span style="color: black;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; //put your 2.0 code here&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; NSLog(@"Current OS VErsion %f",AppDelegate.version);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; cell.text=cellValue;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; [cell setFont:[UIFont systemFontOfSize:15.0]];&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; [cell setLineBreakMode:UILineBreakModeTailTruncation];&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&amp;nbsp;&lt;/span&gt; &lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;use this everywhere to get rid of those warnings..&lt;br /&gt;&lt;br /&gt;now the final part.&lt;br /&gt;&lt;br /&gt;set active target device 3.0 debug.&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;&lt;a href="http://1.bp.blogspot.com/_6C_XpG63jYw/Srop-RQzNnI/AAAAAAAAAGI/FeMIa2ixC1s/s1600-h/Picture+4.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://1.bp.blogspot.com/_6C_XpG63jYw/Srop-RQzNnI/AAAAAAAAAGI/FeMIa2ixC1s/s320/Picture+4.png" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;change base &lt;span style="color: red;"&gt;sdk to 3.0&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;div style="text-align: left;"&gt;&lt;a href="http://1.bp.blogspot.com/_6C_XpG63jYw/SropifHjmFI/AAAAAAAAAF4/eQWFl9BLUMs/s1600-h/Picture+2.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://1.bp.blogspot.com/_6C_XpG63jYw/SropifHjmFI/AAAAAAAAAF4/eQWFl9BLUMs/s400/Picture+2.png" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;br /&gt;&lt;/div&gt;and change deployment target to &lt;span style="color: red;"&gt;iphone os 2.0.&lt;/span&gt;&lt;br /&gt;&lt;div style="text-align: left;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://1.bp.blogspot.com/_6C_XpG63jYw/SropuVTzJXI/AAAAAAAAAGA/cAciqoPtELA/s1600-h/Picture+3.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://1.bp.blogspot.com/_6C_XpG63jYw/SropuVTzJXI/AAAAAAAAAGA/cAciqoPtELA/s400/Picture+3.png" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;span style="color: red;"&gt;note you will get warnings but don't worry it will work fine. &lt;/span&gt;&lt;br /&gt;&lt;br /&gt;to check it's working run your app in any iphone which have 2.0 OS.&lt;br /&gt;&lt;br /&gt;if you don't have iPhone with OS 3.0 check in simulator.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7660917028131688558-7666379610291714452?l=jainmarket.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://jainmarket.blogspot.com/feeds/7666379610291714452/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7660917028131688558&amp;postID=7666379610291714452' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7660917028131688558/posts/default/7666379610291714452'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7660917028131688558/posts/default/7666379610291714452'/><link rel='alternate' type='text/html' href='http://jainmarket.blogspot.com/2009/09/run-your-iphone-application-on-both.html' title='Run your iPhone application on both iPhone OS 2.0 and iPhone OS 3.0 and above versions'/><author><name>Rahul Vyas</name><uri>http://www.blogger.com/profile/08326955903115378266</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://bp1.blogger.com/_6C_XpG63jYw/SAgrxtkt56I/AAAAAAAAACc/pr7-vuTQS5w/S220/P1170634+(Small).JPG'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://1.bp.blogspot.com/_6C_XpG63jYw/Srop-RQzNnI/AAAAAAAAAGI/FeMIa2ixC1s/s72-c/Picture+4.png' height='72' width='72'/><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7660917028131688558.post-5095149061092883261</id><published>2009-09-12T16:39:00.001+05:30</published><updated>2009-09-12T16:53:34.001+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='IPHONE'/><title type='text'>Upgrading your iPhone OS 2.0 Application to 3.0 and Handle Deprecation Warnings</title><content type='html'>&lt;div class="postbody entry clearfix"&gt;The warnings I was getting are as follows:&lt;br /&gt;warning: ’setImage:’ is deprecated (declared at /Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/&lt;br /&gt;iPhoneSimulator3.0.sdk/System/Library/Frameworks/UIKit.framework/&lt;br /&gt;Headers/UITableViewCell.h:199)&lt;br /&gt;warning: ’setText:’ is deprecated (declared at /Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/&lt;br /&gt;iPhoneSimulator3.0.sdk/System/Library/Frameworks/UIKit.framework/&lt;br /&gt;Headers/UITableViewCell.h:199)&lt;br /&gt;Before…&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;table&gt;&lt;tbody&gt;&lt;tr id="p1131"&gt;&lt;td class="code" id="p113code1"&gt;&lt;pre class="objc" style="font-family: monospace;"&gt;&lt;span style="color: #11740a; font-style: italic;"&gt;//This worked perfect in OS 2.0&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #002200;"&gt;-&lt;/span&gt; &lt;span style="color: #002200;"&gt;(&lt;/span&gt;UITableViewCell &lt;span style="color: #002200;"&gt;*&lt;/span&gt;&lt;span style="color: #002200;"&gt;)&lt;/span&gt;tableView&lt;span style="color: #002200;"&gt;:&lt;/span&gt;&lt;span style="color: #002200;"&gt;(&lt;/span&gt;UITableView &lt;span style="color: #002200;"&gt;*&lt;/span&gt;&lt;span style="color: #002200;"&gt;)&lt;/span&gt;tableView cellForRowAtIndexPath&lt;span style="color: #002200;"&gt;:&lt;/span&gt;&lt;span style="color: #002200;"&gt;(&lt;/span&gt;&lt;a href="http://developer.apple.com/documentation/Cocoa/Reference/Foundation/Classes/NSIndexPath_Class/"&gt;&lt;span style="color: #400080;"&gt;NSIndexPath&lt;/span&gt;&lt;/a&gt; &lt;span style="color: #002200;"&gt;*&lt;/span&gt;&lt;span style="color: #002200;"&gt;)&lt;/span&gt;indexPath &lt;span style="color: #002200;"&gt;{&lt;/span&gt;&lt;br /&gt;     &lt;span style="color: #a61390;"&gt;static&lt;/span&gt; &lt;a href="http://developer.apple.com/documentation/Cocoa/Reference/Foundation/Classes/NSString_Class/"&gt;&lt;span style="color: #400080;"&gt;NSString&lt;/span&gt;&lt;/a&gt; &lt;span style="color: #002200;"&gt;*&lt;/span&gt;UserSettingButtonCellIdentifier &lt;span style="color: #002200;"&gt;=&lt;/span&gt; &lt;span style="color: #bf1d1a;"&gt;@&lt;/span&gt;&lt;span style="color: #bf1d1a;"&gt;"Cell"&lt;/span&gt;;&lt;br /&gt; UITableViewCell &lt;span style="color: #002200;"&gt;*&lt;/span&gt;cell &lt;span style="color: #002200;"&gt;=&lt;/span&gt; &lt;span style="color: #002200;"&gt;[&lt;/span&gt;tableView dequeueReusableCellWithIdentifier&lt;span style="color: #002200;"&gt;:&lt;/span&gt;UserSettingButtonCellIdentifier&lt;span style="color: #002200;"&gt;]&lt;/span&gt;;&lt;br /&gt; &lt;span style="color: #a61390;"&gt;if&lt;/span&gt; &lt;span style="color: #002200;"&gt;(&lt;/span&gt;cell &lt;span style="color: #002200;"&gt;==&lt;/span&gt; &lt;span style="color: #a61390;"&gt;nil&lt;/span&gt;&lt;span style="color: #002200;"&gt;)&lt;/span&gt; &lt;span style="color: #002200;"&gt;{&lt;/span&gt;&lt;br /&gt;  cell &lt;span style="color: #002200;"&gt;=&lt;/span&gt; &lt;span style="color: #002200;"&gt;[&lt;/span&gt;&lt;span style="color: #002200;"&gt;[&lt;/span&gt;&lt;span style="color: #002200;"&gt;[&lt;/span&gt;UITableViewCell alloc&lt;span style="color: #002200;"&gt;]&lt;/span&gt; initWithFrame&lt;span style="color: #002200;"&gt;:&lt;/span&gt;CGRectZero reuseIdentifier&lt;span style="color: #002200;"&gt;:&lt;/span&gt; UserSettingButtonCellIdentifier&lt;span style="color: #002200;"&gt;]&lt;/span&gt; autorelease&lt;span style="color: #002200;"&gt;]&lt;/span&gt;;&lt;br /&gt; &lt;span style="color: #002200;"&gt;}&lt;/span&gt;&lt;br /&gt;     NSUInteger row &lt;span style="color: #002200;"&gt;=&lt;/span&gt; &lt;span style="color: #002200;"&gt;[&lt;/span&gt;indexPath row&lt;span style="color: #002200;"&gt;]&lt;/span&gt;;&lt;br /&gt;     UserSetting &lt;span style="color: #002200;"&gt;*&lt;/span&gt;rowData &lt;span style="color: #002200;"&gt;=&lt;/span&gt; &lt;span style="color: #002200;"&gt;[&lt;/span&gt;list objectAtIndex&lt;span style="color: #002200;"&gt;:&lt;/span&gt;row&lt;span style="color: #002200;"&gt;]&lt;/span&gt;;&lt;br /&gt;     UIImage &lt;span style="color: #002200;"&gt;*&lt;/span&gt;image &lt;span style="color: #002200;"&gt;=&lt;/span&gt; &lt;span style="color: #002200;"&gt;[&lt;/span&gt;UIImage imageNamed&lt;span style="color: #002200;"&gt;:&lt;/span&gt;&lt;span style="color: #bf1d1a;"&gt;@&lt;/span&gt;&lt;span style="color: #bf1d1a;"&gt;"MyImage.png"&lt;/span&gt;&lt;span style="color: #002200;"&gt;]&lt;/span&gt;;&lt;br /&gt;     &lt;span style="color: #a61390;"&gt;if&lt;/span&gt; &lt;span style="color: #002200;"&gt;(&lt;/span&gt;row &lt;span style="color: #002200;"&gt;!=&lt;/span&gt; &lt;span style="color: #2400d9;"&gt;0&lt;/span&gt;&lt;span style="color: #002200;"&gt;)&lt;/span&gt;&lt;br /&gt;         cell.image &lt;span style="color: #002200;"&gt;=&lt;/span&gt; image; &lt;span style="color: #11740a; font-style: italic;"&gt;//WARNING here&lt;/span&gt;&lt;br /&gt;     cell.text &lt;span style="color: #002200;"&gt;=&lt;/span&gt; rowData.name; &lt;span style="color: #11740a; font-style: italic;"&gt;//WARNING here&lt;/span&gt;&lt;br /&gt;     &lt;span style="color: #002200;"&gt;[&lt;/span&gt;rowData release&lt;span style="color: #002200;"&gt;]&lt;/span&gt;;&lt;br /&gt;     &lt;span style="color: #a61390;"&gt;return&lt;/span&gt; cell;&lt;br /&gt;&lt;span style="color: #002200;"&gt;}&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #11740a; font-style: italic;"&gt;//the tableView method is completely deprecated.&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #002200;"&gt;-&lt;/span&gt; &lt;span style="color: #002200;"&gt;(&lt;/span&gt;UITableViewCellAccessoryType&lt;span style="color: #002200;"&gt;)&lt;/span&gt;tableView&lt;span style="color: #002200;"&gt;:&lt;/span&gt;&lt;span style="color: #002200;"&gt;(&lt;/span&gt;UITableView &lt;span style="color: #002200;"&gt;*&lt;/span&gt;&lt;span style="color: #002200;"&gt;)&lt;/span&gt;tableView accessoryTypeForRowWithIndexPath&lt;span style="color: #002200;"&gt;:&lt;/span&gt;&lt;span style="color: #002200;"&gt;(&lt;/span&gt;&lt;a href="http://developer.apple.com/documentation/Cocoa/Reference/Foundation/Classes/NSIndexPath_Class/"&gt;&lt;span style="color: #400080;"&gt;NSIndexPath&lt;/span&gt;&lt;/a&gt; &lt;span style="color: #002200;"&gt;*&lt;/span&gt;&lt;span style="color: #002200;"&gt;)&lt;/span&gt;indexPath &lt;span style="color: #002200;"&gt;{&lt;/span&gt;&lt;br /&gt; &lt;span style="color: #a61390;"&gt;return&lt;/span&gt; UITableViewCellAccessoryDisclosureIndicator;&lt;br /&gt;&lt;span style="color: #002200;"&gt;}&lt;/span&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;After, doing the mods to get rid of the deprecated warnings:&lt;br /&gt;&lt;br /&gt;&lt;table&gt;&lt;tbody&gt;&lt;tr id="p1132"&gt;&lt;td class="code" id="p113code2"&gt;&lt;pre class="objc" style="font-family: monospace;"&gt;&lt;span style="color: #002200;"&gt;-&lt;/span&gt; &lt;span style="color: #002200;"&gt;(&lt;/span&gt;UITableViewCell &lt;span style="color: #002200;"&gt;*&lt;/span&gt;&lt;span style="color: #002200;"&gt;)&lt;/span&gt;tableView&lt;span style="color: #002200;"&gt;:&lt;/span&gt;&lt;span style="color: #002200;"&gt;(&lt;/span&gt;UITableView &lt;span style="color: #002200;"&gt;*&lt;/span&gt;&lt;span style="color: #002200;"&gt;)&lt;/span&gt;tableView cellForRowAtIndexPath&lt;span style="color: #002200;"&gt;:&lt;/span&gt;&lt;span style="color: #002200;"&gt;(&lt;/span&gt;&lt;a href="http://developer.apple.com/documentation/Cocoa/Reference/Foundation/Classes/NSIndexPath_Class/"&gt;&lt;span style="color: #400080;"&gt;NSIndexPath&lt;/span&gt;&lt;/a&gt; &lt;span style="color: #002200;"&gt;*&lt;/span&gt;&lt;span style="color: #002200;"&gt;)&lt;/span&gt;indexPath &lt;span style="color: #002200;"&gt;{&lt;/span&gt;&lt;br /&gt; &lt;span style="color: #a61390;"&gt;static&lt;/span&gt; &lt;a href="http://developer.apple.com/documentation/Cocoa/Reference/Foundation/Classes/NSString_Class/"&gt;&lt;span style="color: #400080;"&gt;NSString&lt;/span&gt;&lt;/a&gt; &lt;span style="color: #002200;"&gt;*&lt;/span&gt;UserSettingButtonCellIdentifier &lt;span style="color: #002200;"&gt;=&lt;/span&gt; &lt;span style="color: #bf1d1a;"&gt;@&lt;/span&gt;&lt;span style="color: #bf1d1a;"&gt;"Cell"&lt;/span&gt;;&lt;br /&gt; UITableViewCell &lt;span style="color: #002200;"&gt;*&lt;/span&gt;cell &lt;span style="color: #002200;"&gt;=&lt;/span&gt; &lt;span style="color: #002200;"&gt;[&lt;/span&gt;tableView dequeueReusableCellWithIdentifier&lt;span style="color: #002200;"&gt;:&lt;/span&gt;UserSettingButtonCellIdentifier&lt;span style="color: #002200;"&gt;]&lt;/span&gt;;&lt;br /&gt; &lt;span style="color: #a61390;"&gt;if&lt;/span&gt; &lt;span style="color: #002200;"&gt;(&lt;/span&gt;cell &lt;span style="color: #002200;"&gt;==&lt;/span&gt; &lt;span style="color: #a61390;"&gt;nil&lt;/span&gt;&lt;span style="color: #002200;"&gt;)&lt;/span&gt; &lt;span style="color: #002200;"&gt;{&lt;/span&gt;&lt;br /&gt;  cell &lt;span style="color: #002200;"&gt;=&lt;/span&gt; &lt;span style="color: #002200;"&gt;[&lt;/span&gt;&lt;span style="color: #002200;"&gt;[&lt;/span&gt;&lt;span style="color: #002200;"&gt;[&lt;/span&gt;UITableViewCell alloc&lt;span style="color: #002200;"&gt;]&lt;/span&gt; initWithFrame&lt;span style="color: #002200;"&gt;:&lt;/span&gt;CGRectZero reuseIdentifier&lt;span style="color: #002200;"&gt;:&lt;/span&gt; UserSettingButtonCellIdentifier&lt;span style="color: #002200;"&gt;]&lt;/span&gt; autorelease&lt;span style="color: #002200;"&gt;]&lt;/span&gt;;&lt;br /&gt; &lt;span style="color: #002200;"&gt;}&lt;/span&gt;&lt;br /&gt; NSUInteger row &lt;span style="color: #002200;"&gt;=&lt;/span&gt; &lt;span style="color: #002200;"&gt;[&lt;/span&gt;indexPath row&lt;span style="color: #002200;"&gt;]&lt;/span&gt;;&lt;br /&gt; UserSetting &lt;span style="color: #002200;"&gt;*&lt;/span&gt;rowData &lt;span style="color: #002200;"&gt;=&lt;/span&gt; &lt;span style="color: #002200;"&gt;[&lt;/span&gt;list objectAtIndex&lt;span style="color: #002200;"&gt;:&lt;/span&gt;row&lt;span style="color: #002200;"&gt;]&lt;/span&gt;;&lt;br /&gt; UIImage &lt;span style="color: #002200;"&gt;*&lt;/span&gt;image &lt;span style="color: #002200;"&gt;=&lt;/span&gt; &lt;span style="color: #002200;"&gt;[&lt;/span&gt;UIImage imageNamed&lt;span style="color: #002200;"&gt;:&lt;/span&gt;&lt;span style="color: #bf1d1a;"&gt;@&lt;/span&gt;&lt;span style="color: #bf1d1a;"&gt;"MyImage.png"&lt;/span&gt;&lt;span style="color: #002200;"&gt;]&lt;/span&gt;;&lt;br /&gt; &lt;span style="color: #a61390;"&gt;if&lt;/span&gt; &lt;span style="color: #002200;"&gt;(&lt;/span&gt;row &lt;span style="color: #002200;"&gt;!=&lt;/span&gt; &lt;span style="color: #2400d9;"&gt;0&lt;/span&gt;&lt;span style="color: #002200;"&gt;)&lt;/span&gt;&lt;br /&gt;  cell.imageView.image &lt;span style="color: #002200;"&gt;=&lt;/span&gt; image; &lt;span style="color: #11740a; font-style: italic;"&gt;//FIXED here&lt;/span&gt;&lt;br /&gt; cell.textLabel.text &lt;span style="color: #002200;"&gt;=&lt;/span&gt; rowData.name; &lt;span style="color: #11740a; font-style: italic;"&gt;//FIXED here&lt;/span&gt;&lt;br /&gt;&amp;nbsp;&lt;br /&gt;&lt;span style="color: #6e371a;"&gt;#ifdef __IPHONE_3_0&lt;/span&gt;&lt;br /&gt;        &lt;span style="color: #11740a; font-style: italic;"&gt;//This is a replacement for the tableView method&lt;/span&gt;&lt;br /&gt; cell.accessoryType &lt;span style="color: #002200;"&gt;=&lt;/span&gt;  UITableViewCellAccessoryDisclosureIndicator;&lt;br /&gt;&lt;span style="color: #6e371a;"&gt;#endif&lt;/span&gt;&lt;br /&gt;&amp;nbsp;&lt;br /&gt; &lt;span style="color: #002200;"&gt;[&lt;/span&gt;rowData release&lt;span style="color: #002200;"&gt;]&lt;/span&gt;;&lt;br /&gt; &lt;span style="color: #a61390;"&gt;return&lt;/span&gt; cell;&lt;br /&gt;&lt;span style="color: #002200;"&gt;}&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #6e371a;"&gt;#ifndef __IPHONE_3_0&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #002200;"&gt;-&lt;/span&gt; &lt;span style="color: #002200;"&gt;(&lt;/span&gt;UITableViewCellAccessoryType&lt;span style="color: #002200;"&gt;)&lt;/span&gt;tableView&lt;span style="color: #002200;"&gt;:&lt;/span&gt;&lt;span style="color: #002200;"&gt;(&lt;/span&gt;UITableView &lt;span style="color: #002200;"&gt;*&lt;/span&gt;&lt;span style="color: #002200;"&gt;)&lt;/span&gt;tableView accessoryTypeForRowWithIndexPath&lt;span style="color: #002200;"&gt;:&lt;/span&gt;&lt;span style="color: #002200;"&gt;(&lt;/span&gt;&lt;a href="http://developer.apple.com/documentation/Cocoa/Reference/Foundation/Classes/NSIndexPath_Class/"&gt;&lt;span style="color: #400080;"&gt;NSIndexPath&lt;/span&gt;&lt;/a&gt; &lt;span style="color: #002200;"&gt;*&lt;/span&gt;&lt;span style="color: #002200;"&gt;)&lt;/span&gt;indexPath &lt;span style="color: #002200;"&gt;{&lt;/span&gt;&lt;br /&gt; &lt;span style="color: #a61390;"&gt;return&lt;/span&gt; UITableViewCellAccessoryDisclosureIndicator;&lt;br /&gt;&lt;span style="color: #002200;"&gt;}&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #6e371a;"&gt;#endif&lt;/span&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7660917028131688558-5095149061092883261?l=jainmarket.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://jainmarket.blogspot.com/feeds/5095149061092883261/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7660917028131688558&amp;postID=5095149061092883261' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7660917028131688558/posts/default/5095149061092883261'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7660917028131688558/posts/default/5095149061092883261'/><link rel='alternate' type='text/html' href='http://jainmarket.blogspot.com/2009/09/upgrading-your-iphone-os-20-application.html' title='Upgrading your iPhone OS 2.0 Application to 3.0 and Handle Deprecation Warnings'/><author><name>Rahul Vyas</name><uri>http://www.blogger.com/profile/08326955903115378266</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://bp1.blogger.com/_6C_XpG63jYw/SAgrxtkt56I/AAAAAAAAACc/pr7-vuTQS5w/S220/P1170634+(Small).JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7660917028131688558.post-1810141240468907973</id><published>2009-09-11T12:27:00.000+05:30</published><updated>2009-09-11T12:58:41.277+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='DataBase'/><category scheme='http://www.blogger.com/atom/ns#' term='SQLite3'/><category scheme='http://www.blogger.com/atom/ns#' term='IPHONE'/><title type='text'>find the documents directory on the iPhone in Just One Line Code</title><content type='html'>there are quite a few ways to find the documents directory on the iPhone.  For those of you who don’t know, the documents directory of an application is the location where you should save your application data.  While finding the documents directory is a trivial task, it is very important when coding most applications.  Apple has provided quite a few ways for resolving the path to this directory.&lt;br /&gt;If you read through some of Apple’s sample code, you will see their code to do this is generally 3 or 4 lines long.  This seems like a lot of code to perform such a simple task.  Here is a nice one-line of code for you to use in your applications.&lt;br /&gt;&lt;br /&gt;[NSHomeDirectory()                                    stringByAppendingPathComponent:@"Documents/YourDatabaseFileNameWithExtension"];&lt;br /&gt;&lt;br /&gt;Here is the old method i was using before i found this on icodeblog.com...thanks to Brandon.&lt;br /&gt;&lt;br /&gt;NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask,YES);&lt;br /&gt;    NSString *documentsDirectory = [paths objectAtIndex:0];&lt;br /&gt;    NSString *MyDatabasePath = [documentsDirectory stringByAppendingString:@"/YourDatabaseFileNameWithExtension"];&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7660917028131688558-1810141240468907973?l=jainmarket.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://jainmarket.blogspot.com/feeds/1810141240468907973/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7660917028131688558&amp;postID=1810141240468907973' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7660917028131688558/posts/default/1810141240468907973'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7660917028131688558/posts/default/1810141240468907973'/><link rel='alternate' type='text/html' href='http://jainmarket.blogspot.com/2009/09/find-documents-directory-on-iphone-in.html' title='find the documents directory on the iPhone in Just One Line Code'/><author><name>Rahul Vyas</name><uri>http://www.blogger.com/profile/08326955903115378266</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://bp1.blogger.com/_6C_XpG63jYw/SAgrxtkt56I/AAAAAAAAACc/pr7-vuTQS5w/S220/P1170634+(Small).JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7660917028131688558.post-1736616216551031531</id><published>2009-09-05T15:27:00.001+05:30</published><updated>2009-09-05T15:27:00.640+05:30</updated><title type='text'>Installing The Application on iPhone/iPod</title><content type='html'>&lt;br&gt;&lt;ol class="howto-steps"&gt;&lt;li&gt;Connect your iPhone/iPod touch to your computer.&lt;li&gt;Open iTunes.&lt;br&gt;&lt;li&gt;Extract the included zip file. You will see a .mobileprovision file and another&lt;strong&gt;&lt;/strong&gt; .ipa.&lt;li&gt;Drag-and-drop the .mobileprovision file onto &lt;strong&gt;Library&lt;/strong&gt;, &lt;strong&gt;Applications&lt;/strong&gt; in iTunes. &lt;br&gt;&lt;img alt="Windows Add Mobile Provision File Screenshot" border="1" height="469" src="http://iphone.farook.org/images/faqs/adhoc-3.png" title="Windows Add Mobile Provision File Screenshot" vspace="20" width="450"&gt;&lt;li&gt;Double-click the .ipa(extension) file to install the application in iTunes&lt;li&gt;Verify that the application shows up in &lt;strong&gt;Library&lt;/strong&gt;, &lt;strong&gt;Applications&lt;/strong&gt;. Note that it will have the default Apple icon.&lt;br&gt;&lt;img alt="Windows iTunes Library Applications Screenshot" border="1" height="283" src="http://iphone.farook.org/images/faqs/adhoc-4.png" title="Windows iTunes Library Applications Screenshot" vspace="20" width="450"&gt;&lt;li&gt;In iTunes, select your Device under &lt;strong&gt;Devices&lt;/strong&gt;, choose the &lt;strong&gt;Application&lt;/strong&gt; tab, and make sure that the new application is checked.&lt;br&gt;&lt;img alt="Windows iTunes Devices iPhone Applications Screenshot" border="1" height="338" src="http://iphone.farook.org/images/faqs/adhoc-5.png" title="Windows iTunes Devices iPhone Applications Screenshot" vspace="20" width="450"&gt;&lt;li&gt;Sync your Device and the app should now be installed on your device.&lt;br&gt;&lt;li&gt;Try out the newly-installed app.&amp;nbsp;&lt;/ol&gt;&lt;br&gt;&lt;br&gt;&lt;h2&gt;&lt;a name="TROUBLE"&gt;Troubleshooting&lt;/a&gt;&lt;/h2&gt;&lt;a name="TROUBLE"&gt;&lt;/a&gt;&lt;ol class="howto-steps"&gt;&lt;li&gt;Reboot the device. Then sync.&lt;li&gt;Restart iTunes&lt;li&gt;Send me screen shots of any error messages you get.&lt;/ol&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7660917028131688558-1736616216551031531?l=jainmarket.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://jainmarket.blogspot.com/feeds/1736616216551031531/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7660917028131688558&amp;postID=1736616216551031531' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7660917028131688558/posts/default/1736616216551031531'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7660917028131688558/posts/default/1736616216551031531'/><link rel='alternate' type='text/html' href='http://jainmarket.blogspot.com/2009/09/installing-application-on-iphoneipod.html' title='Installing The Application on iPhone/iPod'/><author><name>Rahul Vyas</name><uri>http://www.blogger.com/profile/08326955903115378266</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://bp1.blogger.com/_6C_XpG63jYw/SAgrxtkt56I/AAAAAAAAACc/pr7-vuTQS5w/S220/P1170634+(Small).JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7660917028131688558.post-4947442907280024507</id><published>2009-09-03T13:02:00.000+05:30</published><updated>2009-09-03T13:06:16.737+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='XCode'/><category scheme='http://www.blogger.com/atom/ns#' term='IPHONE'/><category scheme='http://www.blogger.com/atom/ns#' term='Debugging'/><title type='text'>Debugging From Xcode To Real Device(Jail-Broken)</title><content type='html'>&lt;h1&gt;Some random iPhone stuff&lt;/h1&gt;   &lt;p&gt;   Have fun ...   &lt;/p&gt;    &lt;h2&gt;&lt;a name="gdb"&gt;Using gdb to debug on the iPhone (no need for OSX)&lt;/a&gt;&lt;/h2&gt;   &lt;p&gt;   The goal here is to debug application on real-hardware. To do that you must follow some conditions :   &lt;/p&gt;&lt;p&gt;    &lt;/p&gt;&lt;ul&gt;&lt;li&gt;     &lt;b&gt;Get gdb itself&lt;/b&gt;     &lt;p&gt; Good news, gdb is now available on cydia. So you can install it very easily. It comes all setup with all the needed signature / entitlements to have full functionalities. If you're interested in building it yourself, you'll find the original apple sources and the needed patches / build scripts &lt;a href="http://svn.telesphoreo.org/trunk/data/gdb/"&gt;on the telesphoreo repository&lt;/a&gt;     &lt;/p&gt;     &lt;p&gt;     The other way (previously only way) is to grab it from the SDK. Inside the .dmg you will find a package named &lt;i&gt;iPhoneHostSideTools.pkg&lt;/i&gt;. Inside, there is &lt;i&gt;Platforms/iPhoneOS.platform/Developer/usr/libexec/gdb/gdb-arm-apple-darwin&lt;/i&gt;. Just copy it to the iPhone, it's a universal binary that supports armv6 just fine.&lt;br /&gt;    gdb is under GNU licence so you should be free to redistribute the binary as well I think.     &lt;/p&gt;     &lt;p&gt;     For information, the original Apple source are &lt;a href="http://www.opensource.apple.com/darwinsource/iPhone2.0/"&gt;here&lt;/a&gt;.     &lt;/p&gt;     &lt;p&gt;     To enhance functionality you should add some entitlements to the apple binary. Use theses : &lt;a href="http://www.246tnt.com/iPhone/gdb.xcent"&gt;for codesign&lt;/a&gt;, &lt;a href="http://www.246tnt.com/iPhone/gdb.xml"&gt;for ldid&lt;/a&gt;. To apply them :     &lt;/p&gt;     &lt;pre&gt;codesign -s "iPhone developer" --entitlements gdb.xcent -f gdb-arm-apple-darwin&lt;br /&gt;&lt;br /&gt;or&lt;br /&gt;&lt;br /&gt;ldid -Sgdb.xml gdb-arm-apple-darwin&lt;br /&gt;    &lt;/pre&gt;    &lt;/li&gt;&lt;li&gt;     &lt;b&gt;Taget armv6&lt;/b&gt;     &lt;p&gt; Apple's modified gdb is kinda picky. It will only work properly on ARMv6 arch. ARM isn't sufficient ... You can see the different in cpusubtype in the output of otool : &lt;/p&gt;     &lt;pre&gt;lain:iPhone tnt$ otool -h test.arm&lt;br /&gt;test.arm:&lt;br /&gt;Mach header&lt;br /&gt;     magic cputype cpusubtype  caps    filetype ncmds sizeofcmds      flags&lt;br /&gt;0xfeedface      12          0  0x00          2    12        860 0x00000085&lt;br /&gt;&lt;br /&gt;lain:iPhone tnt$ otool -h test.armv6&lt;br /&gt;test.armv6:&lt;br /&gt;Mach header&lt;br /&gt;     magic cputype cpusubtype  caps    filetype ncmds sizeofcmds      flags&lt;br /&gt;0xfeedface      12          6  0x00          2    12        860 0x00000085&lt;br /&gt;    &lt;/pre&gt;     &lt;p&gt;     To make sure of that you must make sure you have &lt;i&gt;-arch armv6&lt;/i&gt; (or &lt;i&gt;-march=armv6 -mcpu=arm1176jzf-s&lt;/i&gt;, depending on your compiler) in you CFLAGS / LDFLAGS. Like this :     &lt;/p&gt;&lt;pre&gt;/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/gcc-4.0 -arch armv6 -isysroot /Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS2.0.sdk test.c -o test&lt;br /&gt;    &lt;/pre&gt;    &lt;/li&gt;&lt;li&gt;     &lt;b&gt;Sign the binary with entitlements&lt;/b&gt;     &lt;p&gt;&lt;strong&gt;Update:&lt;/strong&gt; Actually if you used the entitlements I provide to sign gdb, or if you used the gdb of cydia, this step is no longer required.     &lt;/p&gt;     &lt;p&gt;     Next, you need to sign the binary you want to debug with &lt;i&gt;entitlements&lt;/i&gt;. For details on that, see the 'Using XCode with Pwned iPhone', it's described there. I do it with codesign on OSX but ldid also support theses. &lt;/p&gt;     &lt;p&gt;     If you're planning on doing it with ldid, the easier it to apt-get install it on your phone and do it there.     &lt;/p&gt;     &lt;pre&gt;ldid -Smyapp.xml myapp&lt;br /&gt;    &lt;/pre&gt;     &lt;p&gt;     The myapp.xml is the XML file describing the entitlements. I generate them using a &lt;a href="http://www.246tnt.com/iPhone/gen_entitlements.py"&gt;simple script&lt;/a&gt; but for this simple purpose you could just always use a static one that would look like this :     &lt;/p&gt;&lt;pre&gt;&lt;?xml version="1.0" encoding="UTF-8"?&gt;&lt;br /&gt;&lt;!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"&gt;&lt;br /&gt;&lt;plist version="1.0"&gt;&lt;br /&gt; &lt;dict&gt;&lt;br /&gt;   &lt;key&gt;application-identifier&lt;/key&gt;&lt;br /&gt;   &lt;string&gt;test&lt;/string&gt;&lt;br /&gt;   &lt;key&gt;get-task-allow&lt;/key&gt;&lt;br /&gt;   &lt;true/&gt;&lt;br /&gt; &lt;/dict&gt;&lt;br /&gt;&lt;/plist&gt;&lt;br /&gt;    &lt;/pre&gt;     &lt;p&gt;     &lt;strong&gt;Update :&lt;/strong&gt; If you applied enhanced entitlements to gdb as described in the first point, you don't need entitlements on your binary.     &lt;/p&gt;    &lt;/li&gt;&lt;/ul&gt;    &lt;h2&gt;&lt;a name="xcode"&gt;Using XCode with Pwned iPhone&lt;/a&gt;&lt;/h2&gt;   &lt;p&gt; The idea here is to use the official SDK to create applications without having to pay for an 'official' certificate and provisioning profile. &lt;/p&gt;   &lt;p&gt;   &lt;strong&gt;Note that the instructions here are experimental. I can't be held responsible for whatever happens if you try them ... &lt;/strong&gt; That being said, I can hardly imagine any issue that couldn't be solved by a DFU restore ...   &lt;/p&gt;    &lt;h3&gt;Make Build &amp;amp; Go" + Debugging works&lt;/h3&gt;   &lt;p&gt; If you're not a fully registred / paying developer, you can use XCode to compile apps but some functions won't work. Like the 'Build &amp;amp; go' button, the automatic signing or the debugger. It's however possible to make them work ! Just follow the steps ... &lt;/p&gt;    &lt;ul&gt;&lt;li&gt;     &lt;b&gt;Create a self-signed signing certificate&lt;/b&gt;     &lt;p&gt;      Apple has a nice &lt;a href="http://developer.apple.com/documentation/Security/Conceptual/CodeSigningGuide/Procedures/chapter_3_section_2.html"&gt;page&lt;/a&gt; explaining how to do that.      Make sure to name your certificate 'iPhone developer'.     &lt;/p&gt;    &lt;/li&gt;&lt;li&gt;     &lt;b&gt;Add a custom build step to sign executables&lt;/b&gt;     &lt;p&gt;      A pwned iPhone doesn't need a &lt;i&gt;valid&lt;/i&gt; signature ... but it still needs one, or at least the hashes ... (for more details see on &lt;a href="http://www.saurik.com/id/8"&gt;www.saurik.com&lt;/a&gt;). Jay Freeman made a small utility called &lt;i&gt;ldid&lt;/i&gt; that add thoses hashes. However here we will use the official &lt;i&gt;codesign&lt;/i&gt; utility, provided by Apple, with our self-signed identity.     &lt;/p&gt;     &lt;p&gt;      To make remote debugging work, we also need to add &lt;i&gt;entitlements&lt;/i&gt; to the Application. This will be handled by &lt;i&gt;codesign&lt;/i&gt; as well. We will however need a small python utility &lt;a href="http://www.246tnt.com/iPhone/gen_entitlements.py"&gt;gen_entitlements.py&lt;/a&gt; to generate the entitlement file. Download it, place it somewhere on your disk and make it executable.     &lt;/p&gt;     &lt;p&gt;      So, to execute &lt;i&gt;codesign&lt;/i&gt; properly during the build, you will need to add a custom build step to each of your XCode projects. Select the menu options "Project &gt; New Build Phase &gt; New Run Script Build Phase", and enter the following script (don't forget to replace /Users/youruser/bin by the correct path to gen_entitlements.py) : &lt;/p&gt;     &lt;pre&gt;export CODESIGN_ALLOCATE=/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/codesign_allocate&lt;br /&gt;if [ "${PLATFORM_NAME}" == "iphoneos" ]; then&lt;br /&gt; /Users/youruser/bin/gen_entitlements.py "my.company.${PROJECT_NAME}" "${BUILT_PRODUCTS_DIR}/${WRAPPER_NAME}/${PROJECT_NAME}.xcent";&lt;br /&gt; codesign -f -s "iPhone developer" --resource-rules "${BUILT_PRODUCTS_DIR}/${WRAPPER_NAME}/ResourceRules.plist" \&lt;br /&gt;   --entitlements "${BUILT_PRODUCTS_DIR}/${WRAPPER_NAME}/${PROJECT_NAME}.xcent"  "${BUILT_PRODUCTS_DIR}/${WRAPPER_NAME}/"&lt;br /&gt;fi&lt;br /&gt;    &lt;/pre&gt;    &lt;/li&gt;&lt;li&gt;     &lt;b&gt;Remove signature checks from MobileInstallation &amp;amp; SpringBoard&lt;/b&gt;     &lt;p&gt;      The final step is to bypass some security checks in some executable. The idea is simple to patch them, using a small &lt;a href="http://www.246tnt.com/iPhone/iphone_binary_patch.c"&gt;software&lt;/a&gt;. Of course, after patching, you need to re-generate a signature for the new binaries to get loaded properly. All-in-all, it's easier to do all that on your Mac. So open a console and cut &amp;amp; paste the instructions (I assume you have ssh on the iPhone and that it's IP is 192.168.0.1) : &lt;/p&gt;     &lt;p&gt;     &lt;strong&gt;The binary patch has been written for 2.0.0 and I didn't get a change to test/update it to 2.0.1 ... so make sure you have a backup of the files and an active ssh if needed&lt;/strong&gt;     &lt;/p&gt;     &lt;table&gt;      &lt;tbody&gt;&lt;tr&gt;       &lt;td&gt;         &lt;pre style="width: 70px;"&gt;osx:~ user$&lt;br /&gt;osx:~ user$&lt;br /&gt;osx:~ user$&lt;br /&gt;osx:~ user$&lt;br /&gt;osx:~ user$&lt;br /&gt;osx:~ user$&lt;br /&gt;osx:~ user$&lt;br /&gt;osx:~ user$&lt;br /&gt;osx:~ user$&lt;br /&gt;osx:~ user$&lt;br /&gt;osx:~ user$&lt;br /&gt;osx:~ user$&lt;br /&gt;osx:~ user$&lt;br /&gt;osx:~ user$&lt;br /&gt;osx:~ user$&lt;br /&gt;        &lt;/pre&gt;       &lt;/td&gt;       &lt;td&gt;         &lt;pre&gt;mkdir iphone_tmp&lt;br /&gt;cd iphone_tmp&lt;br /&gt;scp root@192.168.0.1:/System/Library/PrivateFrameworks/MobileInstallation.framework/MobileInstallation .&lt;br /&gt;scp root@192.168.0.1:/System/Library/CoreServices/SpringBoard.app/SpringBoard .&lt;br /&gt;cp MobileInstallation MobileInstallation.bak&lt;br /&gt;cp SpringBoard SpringBoard.bak&lt;br /&gt;curl -O http://www.246tNt.com/iPhone/iphone_binary_patch&lt;br /&gt;curl -O http://www.246tNt.com/iPhone/SpringBoard.xcent&lt;br /&gt;chmod +x ./iphone_binary_patch&lt;br /&gt;./iphone_binary_patch&lt;br /&gt;export CODESIGN_ALLOCATE=/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/codesign_allocate&lt;br /&gt;codesign -s "iPhone developer" -f MobileInstallation&lt;br /&gt;codesign -s "iPhone developer" --entitlements SpringBoard.xcent -f SpringBoard&lt;br /&gt;scp MobileInstallation root@192.168.0.1:/System/Library/PrivateFrameworks/MobileInstallation.framework/MobileInstallation&lt;br /&gt;scp SpringBoard root@192.168.0.1:/System/Library/CoreServices/SpringBoard.app/SpringBoard&lt;br /&gt;       &lt;/pre&gt;      &lt;/td&gt;     &lt;/tr&gt;    &lt;/tbody&gt;&lt;/table&gt;     &lt;p&gt; Finally, reboot the phone ... and enjoy :) Note that you may have to restart XCode and re-plug the iPhone for the connection to work. Also, if you had done previous attempts without following this how-to, you might need to clear the /var/mobile/Media/PublicStaging directory on the iPhone. &lt;/p&gt;&lt;/li&gt;&lt;/ul&gt;source taken from:--&lt;a href="http://www.246tnt.com/iPhone/#xcode"&gt;http://www.246tnt.com/iPhone/#xcode&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7660917028131688558-4947442907280024507?l=jainmarket.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://jainmarket.blogspot.com/feeds/4947442907280024507/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7660917028131688558&amp;postID=4947442907280024507' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7660917028131688558/posts/default/4947442907280024507'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7660917028131688558/posts/default/4947442907280024507'/><link rel='alternate' type='text/html' href='http://jainmarket.blogspot.com/2009/09/debugging-from-xcode-to-real-devicejail.html' title='Debugging From Xcode To Real Device(Jail-Broken)'/><author><name>Rahul Vyas</name><uri>http://www.blogger.com/profile/08326955903115378266</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://bp1.blogger.com/_6C_XpG63jYw/SAgrxtkt56I/AAAAAAAAACc/pr7-vuTQS5w/S220/P1170634+(Small).JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7660917028131688558.post-4348913575811619925</id><published>2009-08-06T12:54:00.000+05:30</published><updated>2009-08-06T12:56:31.003+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='UISearchBar'/><category scheme='http://www.blogger.com/atom/ns#' term='UITableView'/><title type='text'>Add SearchBar As UITableView's Header</title><content type='html'>Write This Code In Your viewDidLoad Method To Add a Search Bar As Your TableView's Header&lt;br /&gt;&lt;br /&gt;&lt;div style="text-align: left;"&gt;   UISearchBar *temp = [[UISearchBar alloc]initWithFrame:CGRectMake(0, 0, 320, 45)];&lt;br /&gt;    temp.barStyle=UIBarStyleBlackTranslucent;&lt;br /&gt;    temp.showsCancelButton=NO;&lt;br /&gt;    temp.autocorrectionType=UITextAutocorrectionTypeNo;&lt;br /&gt;    temp.autocapitalizationType=UITextAutocapitalizationTypeNone;&lt;br /&gt;    temp.delegate=self;&lt;br /&gt;    YourTable.tableHeaderView=temp;&lt;br /&gt;    [temp release];&lt;br /&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7660917028131688558-4348913575811619925?l=jainmarket.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://jainmarket.blogspot.com/feeds/4348913575811619925/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7660917028131688558&amp;postID=4348913575811619925' title='3 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7660917028131688558/posts/default/4348913575811619925'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7660917028131688558/posts/default/4348913575811619925'/><link rel='alternate' type='text/html' href='http://jainmarket.blogspot.com/2009/08/add-searchbar-as-uitableviews-header.html' title='Add SearchBar As UITableView&apos;s Header'/><author><name>Rahul Vyas</name><uri>http://www.blogger.com/profile/08326955903115378266</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://bp1.blogger.com/_6C_XpG63jYw/SAgrxtkt56I/AAAAAAAAACc/pr7-vuTQS5w/S220/P1170634+(Small).JPG'/></author><thr:total>3</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7660917028131688558.post-3125049507682512953</id><published>2009-08-06T12:50:00.000+05:30</published><updated>2009-08-06T12:53:09.641+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='Objective-C'/><category scheme='http://www.blogger.com/atom/ns#' term='IPHONE'/><category scheme='http://www.blogger.com/atom/ns#' term='Memory Management'/><title type='text'>Clang GUI</title><content type='html'>&lt;h2 class="entry-title"&gt;use Clang GUI Front-End to Check Your Errors in Your Objective-c Code&lt;br /&gt;&lt;/h2&gt;     &lt;div class="entry-content"&gt; &lt;p&gt;Use the tool at this site:&lt;br /&gt;http://www.karppinen.fi/analysistool/&lt;/p&gt; This is Very Useful To Find Errors..just Ignore The m Prefix Warning..&lt;br /&gt;          &lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7660917028131688558-3125049507682512953?l=jainmarket.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://jainmarket.blogspot.com/feeds/3125049507682512953/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7660917028131688558&amp;postID=3125049507682512953' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7660917028131688558/posts/default/3125049507682512953'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7660917028131688558/posts/default/3125049507682512953'/><link rel='alternate' type='text/html' href='http://jainmarket.blogspot.com/2009/08/clang-gui.html' title='Clang GUI'/><author><name>Rahul Vyas</name><uri>http://www.blogger.com/profile/08326955903115378266</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://bp1.blogger.com/_6C_XpG63jYw/SAgrxtkt56I/AAAAAAAAACc/pr7-vuTQS5w/S220/P1170634+(Small).JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7660917028131688558.post-2197599031815724409</id><published>2009-08-06T12:43:00.000+05:30</published><updated>2009-08-06T12:49:23.859+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='SQLite3'/><category scheme='http://www.blogger.com/atom/ns#' term='Objective-C'/><category scheme='http://www.blogger.com/atom/ns#' term='IPHONE'/><title type='text'>How To Use Like Statement In Objective-c</title><content type='html'>To Use Like Statement In Objective-c&lt;br /&gt;&lt;br /&gt;First Take A Temporary String like this&lt;br /&gt;&lt;br /&gt;NSString *temp = [NSString stringWithFormat:@"%%%@%%", yourString];&lt;br /&gt;&lt;br /&gt;now here is an example on how to use this&lt;br /&gt;&lt;br /&gt;NSMutableString *query = [[NSMutableString alloc] initWithFormat:@"select flashCardId,flashCardText from Table where flashcardtext like '%@' and categoryId=%d",temp,categoryid];&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7660917028131688558-2197599031815724409?l=jainmarket.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://jainmarket.blogspot.com/feeds/2197599031815724409/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7660917028131688558&amp;postID=2197599031815724409' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7660917028131688558/posts/default/2197599031815724409'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7660917028131688558/posts/default/2197599031815724409'/><link rel='alternate' type='text/html' href='http://jainmarket.blogspot.com/2009/08/how-to-use-like-statement-in-objective.html' title='How To Use Like Statement In Objective-c'/><author><name>Rahul Vyas</name><uri>http://www.blogger.com/profile/08326955903115378266</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://bp1.blogger.com/_6C_XpG63jYw/SAgrxtkt56I/AAAAAAAAACc/pr7-vuTQS5w/S220/P1170634+(Small).JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7660917028131688558.post-5300749915552504359</id><published>2009-06-20T08:29:00.000+05:30</published><updated>2009-07-16T08:27:35.270+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='IPHONE'/><title type='text'>PhoneView 2.2.2</title><content type='html'>&lt;center&gt;&lt;noindex&gt;&lt;/noindex&gt;&lt;br /&gt;&lt;b&gt;PhoneView 2.2.2&lt;/b&gt;&lt;br /&gt;Mac App | 9mb | Rs,Hf&lt;/center&gt;&lt;br /&gt;PhoneView (formerly MegaPhone) is the desktop companion for iPhone and iPod Touch. This Mac OS X application which lets you use your iPhone or iPod Touch for file storage, provides note adding and editing, and easy access to your iTunes, iPhoto and notes, SMS, contacts and call history data. Convert your text, Word or PDF files into iPhone notes. It features drag and drop, making it fast and easy to move files back and forth between the Mac and iPhone.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;b&gt;Features:&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;In addition, PhoneView you can:&lt;br /&gt;&lt;br /&gt;Create iPhone Notes on your Mac.&lt;br /&gt;Store any type of data.&lt;br /&gt;Access your music, videos, podcasts and photos.&lt;br /&gt;Access notes, SMS, contacts and call history stored on the iPhone.&lt;br /&gt;Convert your text, Word or PDF files into iPhone notes.&lt;br /&gt;Move files between work and home.&lt;br /&gt;Back up important data to your iPhone.&lt;br /&gt;Keep useful apps and installers with you at all times.&lt;br /&gt;&lt;br /&gt;Simple interface.&lt;br /&gt;Store any type of files.&lt;br /&gt;Access music, videos, podcasts and photos.&lt;br /&gt;Instant access to Notes.&lt;br /&gt;Easily create new Notes.&lt;br /&gt;Export iPhone SMS and recent calls.&lt;br /&gt;Use your iPhone for backup.&lt;br /&gt;Bring your data between home and office.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;b&gt;More Info:&lt;/b&gt;&lt;br /&gt;&lt;noindex&gt;&lt;a rel="nofollow" href="http://anonymz.com/?http://ecamm.com/mac/phoneview/" target="_blank"&gt;&lt;b&gt;Homepage&lt;/b&gt;&lt;/a&gt;&lt;/noindex&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;b&gt;Download Links :&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;&lt;noindex&gt;&lt;a rel="nofollow" href="http://hotfile.com/dl/7228120/350db5b/PhoneView.2.2.2_www.mac.softarchive.net.rar.html" target="_blank"&gt;&lt;b&gt;Download Here&lt;/b&gt;&lt;/a&gt;&lt;/noindex&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;or&lt;br /&gt;&lt;br /&gt;&lt;noindex&gt;&lt;a rel="nofollow" href="http://anonymz.com/?http://rapidshare.com/files/246341717/PhoneView.2.2.2_www.mac.softarchive.net.rar" target="_blank"&gt;Here&lt;/a&gt;&lt;/noindex&gt;&lt;br /&gt;&lt;br /&gt;&lt;noindex&gt;&lt;a rel="nofollow" href="http://mac.softarchive.net/" target="_blank"&gt;&lt;b&gt;Click Here For The Best Of Mac And Windows Softwares!&lt;/b&gt;&lt;/a&gt;&lt;/noindex&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7660917028131688558-5300749915552504359?l=jainmarket.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://jainmarket.blogspot.com/feeds/5300749915552504359/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7660917028131688558&amp;postID=5300749915552504359' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7660917028131688558/posts/default/5300749915552504359'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7660917028131688558/posts/default/5300749915552504359'/><link rel='alternate' type='text/html' href='http://jainmarket.blogspot.com/2009/06/phoneview-222.html' title='PhoneView 2.2.2'/><author><name>Rahul Vyas</name><uri>http://www.blogger.com/profile/08326955903115378266</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://bp1.blogger.com/_6C_XpG63jYw/SAgrxtkt56I/AAAAAAAAACc/pr7-vuTQS5w/S220/P1170634+(Small).JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7660917028131688558.post-6445557369837501452</id><published>2009-06-20T08:28:00.000+05:30</published><updated>2009-06-20T08:29:45.845+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='IPHONE'/><title type='text'>Stream Movies &amp; TV Shows Instantly to iPhone/iPod/PSP/PC</title><content type='html'>ntroducing LuckyVidz! This site allow users to instantly stream movies and TV Shows to there iPhone, iPod, iPod Touch, PSP or anyother .MP4 supported device! The videos stream over WiFi, 3G, or EDGE networks.&lt;br /&gt;&lt;br /&gt;&lt;img src="http://i131.photobucket.com/albums/p290/chuthemoose/002-1.png" alt="Image" title="Image" border="0" /&gt;&lt;br /&gt;Navigate the site easily!&lt;br /&gt;&lt;br /&gt;&lt;img src="http://i131.photobucket.com/albums/p290/chuthemoose/003-1.png" alt="Image" title="Image" border="0" /&gt;&lt;br /&gt;Browse selections alphabetically!&lt;br /&gt;&lt;br /&gt;&lt;img src="http://i131.photobucket.com/albums/p290/chuthemoose/022.jpg" alt="Image" title="Image" border="0" /&gt;&lt;br /&gt;Very informative!&lt;br /&gt;&lt;br /&gt;&lt;table width="90%" align="center" border="0" cellpadding="3" cellspacing="1"&gt; &lt;tbody&gt;&lt;tr&gt; &lt;td&gt;&lt;span class="genmed"&gt;&lt;strong&gt;Code:&lt;/strong&gt;&lt;/span&gt;&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td class="code"&gt;www.luckyvidz.com&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;br /&gt;&lt;br /&gt;Don't feel like uploading or don't see your video? Use the request option on the homepage and your request will be filled. &lt;br /&gt;&lt;br /&gt;Want to help? You can help but uploading videos, donating via PayPal, or by clicking a couple of ads. Anything is appreciated.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7660917028131688558-6445557369837501452?l=jainmarket.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://jainmarket.blogspot.com/feeds/6445557369837501452/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7660917028131688558&amp;postID=6445557369837501452' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7660917028131688558/posts/default/6445557369837501452'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7660917028131688558/posts/default/6445557369837501452'/><link rel='alternate' type='text/html' href='http://jainmarket.blogspot.com/2009/06/stream-movies-tv-shows-instantly-to.html' title='Stream Movies &amp; TV Shows Instantly to iPhone/iPod/PSP/PC'/><author><name>Rahul Vyas</name><uri>http://www.blogger.com/profile/08326955903115378266</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://bp1.blogger.com/_6C_XpG63jYw/SAgrxtkt56I/AAAAAAAAACc/pr7-vuTQS5w/S220/P1170634+(Small).JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7660917028131688558.post-2537254326247284738</id><published>2009-06-20T08:16:00.001+05:30</published><updated>2009-06-20T08:16:43.101+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='IPHONE'/><title type='text'>Download Ipod Touch/iPhone Firmwarez</title><content type='html'>&lt;table width="100%" border="0" cellpadding="0" cellspacing="0"&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td class="postbody" valign="top"&gt;&lt;div class="postbody_div"&gt;hi guys,&lt;br /&gt;&lt;br /&gt;Probably a lot of u guys must be knowing about this but still for those who don't.&lt;br /&gt;&lt;br /&gt;&lt;table width="90%" align="center" border="0" cellpadding="3" cellspacing="1"&gt; &lt;tbody&gt;&lt;tr&gt; &lt;td&gt;&lt;span class="genmed"&gt;&lt;strong&gt;Code:&lt;/strong&gt;&lt;/span&gt;&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td class="code"&gt;http://www.felixbruns.de/iPod/firmware/&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;br /&gt;&lt;br /&gt;Download any ipod/iphone firmware from this site  &lt;img src="http://img5.warez-bb.org/images/smiles/icon_biggrin.gif" alt="Very Happy" border="0" /&gt; &lt;br /&gt;&lt;br /&gt;Cheers!!&lt;/div&gt;&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td class="genmed" valign="bottom" height="40"&gt;&lt;span class="postdetails"&gt;&lt;/span&gt;&lt;br /&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7660917028131688558-2537254326247284738?l=jainmarket.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://jainmarket.blogspot.com/feeds/2537254326247284738/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7660917028131688558&amp;postID=2537254326247284738' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7660917028131688558/posts/default/2537254326247284738'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7660917028131688558/posts/default/2537254326247284738'/><link rel='alternate' type='text/html' href='http://jainmarket.blogspot.com/2009/06/download-ipod-touchiphone-firmwarez.html' title='Download Ipod Touch/iPhone Firmwarez'/><author><name>Rahul Vyas</name><uri>http://www.blogger.com/profile/08326955903115378266</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://bp1.blogger.com/_6C_XpG63jYw/SAgrxtkt56I/AAAAAAAAACc/pr7-vuTQS5w/S220/P1170634+(Small).JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7660917028131688558.post-6702905744683833619</id><published>2009-06-20T07:56:00.000+05:30</published><updated>2009-06-20T08:15:58.009+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='IPHONE'/><title type='text'>Get Cracked .ipa Applications to iPhone without OpenSSH</title><content type='html'>In this tutorial I will show you how to sync and import cracked .ipa applications from AppStore to your iPhone or iPod Touch. &lt;br /&gt;&lt;br /&gt;Tested by me, works 100% for these devices with firmware 2.0, 2.0.1, 2.0.2 and 2.1:&lt;br /&gt;&lt;ul&gt;&lt;span style="font-weight: bold;"&gt;iPhone&lt;br /&gt;iPhone 3G&lt;br /&gt;iPod Touch&lt;br /&gt;iPod Touch 2G&lt;/span&gt;&lt;/ul&gt;&lt;br /&gt;&lt;br /&gt;So how to...&lt;br /&gt;Before you start you need to download and install "legal" app from AppStore. If you do not do so, you will get error while trying to run cracked app.&lt;br /&gt;So get an free app from AppStore &lt;img src="http://img5.warez-bb.org/images/smiles/icon_smile.gif" alt="Smile" border="0" /&gt;&lt;br /&gt;If you do now have any iTunes account, just google for it, try this sentence&lt;br /&gt;&lt;span style="font-style: italic;"&gt;"How to create iTunes account without credit card"&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;If you have done so, you can continue...&lt;br /&gt;&lt;br /&gt;&lt;span style="font-size: 15px; line-height: normal;"&gt;&lt;span style="font-weight: bold;"&gt;1.&lt;/span&gt; you need to have jailbreaked device(i wont tell you how to jailbrake now)&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;2.&lt;/span&gt; Cydia is required&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;3.&lt;/span&gt; in Cydia go to &lt;span style="font-style: italic;"&gt;Manage &gt;&gt; Sources&lt;/span&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;4.&lt;/span&gt; add a new source. type exactly as is shown below&lt;br /&gt;&lt;table width="90%" align="center" border="0" cellpadding="3" cellspacing="1"&gt; &lt;tbody&gt;&lt;tr&gt; &lt;td&gt;&lt;span class="genmed"&gt;&lt;strong&gt;Code:&lt;/strong&gt;&lt;/span&gt;&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td class="code"&gt;http://iphone.org.hk/apt/&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;5.&lt;/span&gt; Now go to &lt;span style="font-style: italic;"&gt;Sections &gt;&gt; Tweaks&lt;/span&gt; and find &lt;span style="font-style: italic;"&gt;&lt;span style="font-weight: bold;"&gt;MobileInstallation Patch&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;6.&lt;/span&gt; Install it and let the patch do its work.&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;7.&lt;/span&gt; now simply import cracked apps and games (you can find them at warez-bb of course) to iTunes and sync your device!&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;I hope you find this tutorial easy enough and usefull for you!&lt;br /&gt;If you like it, please leave a single thank you. It wont take you a long time &lt;img src="http://img5.warez-bb.org/images/smiles/icon_smile.gif" alt="Smile" border="0" /&gt;&lt;br /&gt;THANK YOU &lt;img src="http://img5.warez-bb.org/images/smiles/icon_smile.gif" alt="Smile" border="0" /&gt;&lt;br /&gt;&lt;br /&gt;&lt;table width="90%" align="center" border="0" cellpadding="3" cellspacing="1"&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td&gt;&lt;span class="genmed"&gt;&lt;strong&gt;Code:&lt;/strong&gt;&lt;/span&gt;&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td class="code"&gt;http://www.quickpwn.com/2008/09/jailbreak-ipod-touch-21.html&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Also......This is a great place for cracked apps!&lt;br /&gt; &lt;table width="90%" align="center" border="0" cellpadding="3" cellspacing="1"&gt;&lt;tbody&gt;&lt;tr&gt; &lt;td&gt;&lt;span class="genmed"&gt;&lt;strong&gt;Code:&lt;/strong&gt;&lt;/span&gt;&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td class="code"&gt;http://appulo.us/appdb/&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7660917028131688558-6702905744683833619?l=jainmarket.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://jainmarket.blogspot.com/feeds/6702905744683833619/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7660917028131688558&amp;postID=6702905744683833619' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7660917028131688558/posts/default/6702905744683833619'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7660917028131688558/posts/default/6702905744683833619'/><link rel='alternate' type='text/html' href='http://jainmarket.blogspot.com/2009/06/get-cracked-ipa-applications-to-iphone.html' title='Get Cracked .ipa Applications to iPhone without OpenSSH'/><author><name>Rahul Vyas</name><uri>http://www.blogger.com/profile/08326955903115378266</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://bp1.blogger.com/_6C_XpG63jYw/SAgrxtkt56I/AAAAAAAAACc/pr7-vuTQS5w/S220/P1170634+(Small).JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7660917028131688558.post-4463631497006385087</id><published>2009-05-25T19:32:00.000+05:30</published><updated>2009-05-25T19:49:27.798+05:30</updated><title type='text'></title><content type='html'>http://www.iphonedevsdk.com/forum/iphone-sdk-development/6573-howto-customize-uikeyboard.html?0f266420&lt;br /&gt;&lt;br /&gt;http://cocoawithlove.com/2009/04/showing-message-over-iphone-keyboard.html&lt;br /&gt;&lt;br /&gt;http://www.iphonedevsdk.com/forum/iphone-sdk-tutorials/7350-adding-subviews-custimize-keyboard.html&lt;br /&gt;&lt;br /&gt;http://www.ipodtouchfans.com/forums/archive/index.php/t-176944.html&lt;br /&gt;&lt;br /&gt;http://www.ipodtouchfans.com/forums/archive/index.php/t-173786.html&lt;br /&gt;&lt;br /&gt;http://www.ipodtouchfans.com/forums/archive/index.php/t-168191.html&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7660917028131688558-4463631497006385087?l=jainmarket.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://jainmarket.blogspot.com/feeds/4463631497006385087/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7660917028131688558&amp;postID=4463631497006385087' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7660917028131688558/posts/default/4463631497006385087'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7660917028131688558/posts/default/4463631497006385087'/><link rel='alternate' type='text/html' href='http://jainmarket.blogspot.com/2009/05/httpwww.html' title=''/><author><name>Rahul Vyas</name><uri>http://www.blogger.com/profile/08326955903115378266</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://bp1.blogger.com/_6C_XpG63jYw/SAgrxtkt56I/AAAAAAAAACc/pr7-vuTQS5w/S220/P1170634+(Small).JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7660917028131688558.post-4969409730676464021</id><published>2009-05-14T19:59:00.000+05:30</published><updated>2009-05-14T20:06:03.708+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='SQLite3'/><category scheme='http://www.blogger.com/atom/ns#' term='IPHONE'/><title type='text'>iPhone SDK Tutorial: Reading data from a SQLite Database</title><content type='html'>&lt;p&gt;I see many people asking for SQLite tutorials around, and since I am using SQLite for the next part in the &lt;a href="http://dblog.com.au/general/iphone-sdk-tutorial-building-an-advanced-rss-reader-using-touchxml-part-1/" target="_self"&gt;Advanced RSS Reader Tutorial&lt;/a&gt;, I thought I would write up a quick tutorial on using SQLite with the iPhone SDK.&lt;/p&gt; &lt;h3&gt;1. Project Requirements&lt;/h3&gt; &lt;p&gt;I suggest that you have at least a basic understanding of SQLite, writing SQL statements, the XCode interface and using the terminal in OSX. If you don’t know anything about any of these topics then this tutorial probably isn’t for you.&lt;/p&gt; &lt;h3&gt;2. Creating our SQLite database for our tutorial&lt;/h3&gt; &lt;p&gt;We first need to create a database for use with our application. For the purposes of this tutorial we will be building a database of animals along with a little information on them and a picture.&lt;/p&gt; &lt;p&gt;Fire up a new Terminal window and make a new folder to store the database in, here are the commands I ran&lt;/p&gt; &lt;pre&gt;cd /Users/lookaflyingdonkey/Documents&lt;br /&gt;mkdir SQLiteTutorial&lt;br /&gt;cd SQLiteTutorial&lt;br /&gt;sqlite3 AnimalDatabase.sql&lt;/pre&gt; &lt;p&gt;You should now be at a “sqlite” command prompt, this is where we will be building our database structure and entering some test data.&lt;/p&gt; &lt;p&gt;For our example we need the name of the animal, a short description and a link to an image. Follow the commands below to create the table and to enter some sample data.&lt;/p&gt; &lt;pre&gt;CREATE TABLE animals ( id INTEGER PRIMARY KEY, name VARCHAR(50), description TEXT, image VARCHAR(255) );&lt;br /&gt;&lt;br /&gt;INSERT INTO animals (name, description, image) VALUES ('Elephant', 'The elephant is a very large animal that lives in Africa and Asia', 'http://dblog.com.au/wp-content/elephant.jpg');&lt;br /&gt;INSERT INTO animals (name, description, image) VALUES ('Monkey', 'Monkies can be VERY naughty and often steal clothing from unsuspecting tourists', 'http://dblog.com.au/wp-content/monkey.jpg');&lt;br /&gt;INSERT INTO animals (name, description, image) VALUES ('Galah', 'Galahs are a wonderful bird and they make a great pet (I should know, I have one)', 'http://dblog.com.au/wp-content/galah.jpg');&lt;br /&gt;INSERT INTO animals (name, description, image) VALUES ('Kangaroo', 'Well I had to add the Kangaroo as they are the essence of the Australian image', 'http://dblog.com.au/wp-content/kangaroo.jpg');&lt;/pre&gt; &lt;p&gt;The first command will create the table with the required structure and the next four will insert some test data for us to work with. To ensure that you have entered the data correctly you can execute “SELECT * FROM animals;” and see if it returns the items above. Once you are confident that everything had been created successfully you can leave the sqlite command line by typing “.quit”.&lt;/p&gt; &lt;h3&gt;3. Creating our Project&lt;/h3&gt; &lt;p&gt;Now that our database is all ready to go we need to setup our X-Code project.&lt;/p&gt; &lt;p&gt;Start off by creating a new “Navigation-Based Application”.&lt;br /&gt;&lt;a onclick="javascript:pageTracker._trackPageview('/downloads/wp-content/uploads/2008/09/picture-23.png');" href="http://dblog.com.au/wp-content/uploads/2008/09/picture-23.png"&gt;&lt;img src="http://dblog.com.au/wp-content/uploads/2008/09/picture-23-300x230.png" alt="" title="Navigation-Based Application" class="aligncenter size-medium wp-image-69" height="230" width="300" /&gt;&lt;/a&gt;&lt;/p&gt; &lt;p&gt;Give your Project a name, I called mine “SQLiteTutorial”.&lt;/p&gt; &lt;p&gt;Now set your screen layout to how you prefer it, I suggest making the window as large as possible, and making the code view as tall as possible by dragging the horizontal slider to the top. This will allow you the most room to move when building your application.&lt;/p&gt; &lt;p&gt;Now its time to create the required classes and views for our application, we will start off by making our views.&lt;/p&gt; &lt;p&gt;Right Click on the “Resources” folder in the left hand pane and click “Add File”, we want to create a new “View XIB” under the “User Interfaces” group.&lt;br /&gt;&lt;a onclick="javascript:pageTracker._trackPageview('/downloads/wp-content/uploads/2008/09/picture-24.png');" href="http://dblog.com.au/wp-content/uploads/2008/09/picture-24.png"&gt;&lt;img src="http://dblog.com.au/wp-content/uploads/2008/09/picture-24-300x230.png" alt="" title="Create a new &amp;quot;View XIB&amp;quot;" class="aligncenter size-medium wp-image-70" height="230" width="300" /&gt;&lt;/a&gt;&lt;/p&gt; &lt;p&gt;We now need to give it a name, to stick the Apple’s naming conventions we are going to call it &lt;em&gt;“AnimalViewController.xib”&lt;/em&gt;, Now Click “Finish”.&lt;/p&gt; &lt;p&gt;Now we need to create two classes, the first one will represent an animal, right click on the “Classes” folder in the left hand pane, click “Add &gt; New File…”, choose the “NSObject subclass” template under the “Cocoa Touch Classes” group and name it “Animal”.&lt;/p&gt; &lt;p&gt;The second class will be for our AnimalsViewController, right click on the “Classes” folder in the left hand pane, click “Add &gt; New File…”, choose the “UIViewController subclass” under the “Cocoa Touch Classes” group and name it “AnimalViewController”.&lt;/p&gt; &lt;h3&gt;4. Adding SQLite Framework and our Animal Database&lt;/h3&gt; &lt;p&gt;Now that we have created all of our views and classes it is time to start the real grunt work.&lt;/p&gt; &lt;p&gt;First off we need to include the SQLite libraries so our application can utilise them. To do this you will need to right click on the “Frameworks” folder in the left hand pane, then click on “Add &gt; Existing Frameworks…”, then navigate to “/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS2.0.sdk/usr/lib/” and double click the “libsqlite3.0.dylib” file. A popup will appear, just click “Add” and the library will be added to your project.&lt;/p&gt; &lt;p&gt;We also need to add our database we created earlier to the Resources folder, to do this simply right click on the “Resources” folder, click “Add &gt; Existing Files…”, navigate to the location you created the database in then double click on the AnimalDatabase.sql file. Another popup will appear, just click add.&lt;/p&gt; &lt;p&gt;All done with the importing, time to code!&lt;/p&gt; &lt;h3&gt;5. The Coding begins!&lt;/h3&gt; &lt;p&gt;We are going to start the coding by building our “Animal” object, every animal will have 3 properties, a name, a description and an image URL.&lt;/p&gt; &lt;p&gt;Open up the “Animal.h” file from the “Classes” folder and edit its contents to look like below,&lt;/p&gt; &lt;pre&gt;#import &lt;uikit/uikit.h&gt;&lt;br /&gt;&lt;br /&gt;@interface Animal : NSObject {&lt;br /&gt; NSString *name;&lt;br /&gt; NSString *description;&lt;br /&gt; NSString *imageURL;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;@property (nonatomic, retain) NSString *name;&lt;br /&gt;@property (nonatomic, retain) NSString *description;&lt;br /&gt;@property (nonatomic, retain) NSString *imageURL;&lt;br /&gt;&lt;br /&gt;-(id)initWithName:(NSString *)n description:(NSString *)d url:(NSString *)u;&lt;br /&gt;&lt;br /&gt;@end&lt;br /&gt;&lt;/pre&gt; &lt;p&gt;Most of the above code should be pretty familiar to you, the only thing that may not be is the &lt;strong&gt;initWithName&lt;/strong&gt; line, this line will allow us to create a new object with the required data, we could have used the default &lt;strong&gt;init&lt;/strong&gt; function, but it will be easier for us to define our own.&lt;/p&gt; &lt;p&gt;Now we will actually have to implement the Animal Object, open up the “Animal.m” file and edit its contents to look like below:&lt;/p&gt; &lt;pre&gt;#import "Animal.h"&lt;br /&gt;&lt;br /&gt;@implementation Animal&lt;br /&gt;@synthesize name, description, imageURL;&lt;br /&gt;&lt;br /&gt;-(id)initWithName:(NSString *)n description:(NSString *)d url:(NSString *)u {&lt;br /&gt; self.name = n;&lt;br /&gt; self.description = d;&lt;br /&gt; self.imageURL = u;&lt;br /&gt; return self;&lt;br /&gt;}&lt;br /&gt;@end&lt;br /&gt;&lt;/pre&gt; &lt;p&gt;The above code should be pretty easy to read as well, it basically stores the supplied data from the initWithName function and return the object (self).&lt;/p&gt; &lt;p&gt;Now its time to setup the Application delegate to access the database.&lt;/p&gt; &lt;p&gt;Open up the “SQLiteTutorialAppDelegate.h” and edit its contents to look like below:&lt;/p&gt; &lt;pre&gt;#import &lt;uikit/uikit.h&gt;&lt;br /&gt;#import &lt;sqlite3.h&gt; // Import the SQLite database framework&lt;br /&gt;&lt;br /&gt;@interface SQLiteTutorialAppDelegate : NSObject &lt;uiapplicationdelegate&gt; {&lt;br /&gt;&lt;br /&gt;   UIWindow *window;&lt;br /&gt;   UINavigationController *navigationController;&lt;br /&gt;&lt;br /&gt; // Database variables&lt;br /&gt; NSString *databaseName;&lt;br /&gt; NSString *databasePath;&lt;br /&gt;&lt;br /&gt; // Array to store the animal objects&lt;br /&gt; NSMutableArray *animals;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;@property (nonatomic, retain) IBOutlet UIWindow *window;&lt;br /&gt;@property (nonatomic, retain) IBOutlet UINavigationController *navigationController;&lt;br /&gt;@property (nonatomic, retain) NSMutableArray *animals;&lt;br /&gt;&lt;br /&gt;@end&lt;br /&gt;&lt;/uiapplicationdelegate&gt;&lt;/pre&gt; &lt;p&gt;What we are doing here is importing the SQLite database framework and creating some variables for storing the database details and an array of animal objects.&lt;/p&gt; &lt;p&gt;Now open up the “SQLiteTutorialAppDelegate.m” file and edit its contents to look like below:&lt;/p&gt; &lt;pre&gt;#import "SQLiteTutorialAppDelegate.h"&lt;br /&gt;#import "RootViewController.h"&lt;br /&gt;#import "Animal.h" // Import the animal object header&lt;br /&gt;&lt;br /&gt;@implementation SQLiteTutorialAppDelegate&lt;br /&gt;&lt;br /&gt;@synthesize window;&lt;br /&gt;@synthesize navigationController;&lt;br /&gt;@synthesize animals; // Synthesize the aminals array&lt;br /&gt;&lt;br /&gt;- (void)applicationDidFinishLaunching:(UIApplication *)application {&lt;br /&gt; // Setup some globals&lt;br /&gt; databaseName = @"AnimalDatabase.sql";&lt;br /&gt;&lt;br /&gt; // Get the path to the documents directory and append the databaseName&lt;br /&gt; NSArray *documentPaths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);&lt;br /&gt; NSString *documentsDir = [documentPaths objectAtIndex:0];&lt;br /&gt; databasePath = [documentsDir stringByAppendingPathComponent:databaseName];&lt;br /&gt;&lt;br /&gt; // Execute the "checkAndCreateDatabase" function&lt;br /&gt; [self checkAndCreateDatabase];&lt;br /&gt;&lt;br /&gt; // Query the database for all animal records and construct the "animals" array&lt;br /&gt; [self readAnimalsFromDatabase];&lt;br /&gt;&lt;br /&gt; // Configure and show the window&lt;br /&gt; [window addSubview:[navigationController view]];&lt;br /&gt; [window makeKeyAndVisible];&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;- (void)applicationWillTerminate:(UIApplication *)application {&lt;br /&gt; // Save data if appropriate&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;- (void)dealloc {&lt;br /&gt; [animals release];&lt;br /&gt; [navigationController release];&lt;br /&gt; [window release];&lt;br /&gt; [super dealloc];&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;-(void) checkAndCreateDatabase{&lt;br /&gt; // Check if the SQL database has already been saved to the users phone, if not then copy it over&lt;br /&gt; BOOL success;&lt;br /&gt;&lt;br /&gt; // Create a FileManager object, we will use this to check the status&lt;br /&gt; // of the database and to copy it over if required&lt;br /&gt; NSFileManager *fileManager = [NSFileManager defaultManager];&lt;br /&gt;&lt;br /&gt; // Check if the database has already been created in the users filesystem&lt;br /&gt; success = [fileManager fileExistsAtPath:databasePath];&lt;br /&gt;&lt;br /&gt; // If the database already exists then return without doing anything&lt;br /&gt; if(success) return;&lt;br /&gt;&lt;br /&gt; // If not then proceed to copy the database from the application to the users filesystem&lt;br /&gt;&lt;br /&gt; // Get the path to the database in the application package&lt;br /&gt; NSString *databasePathFromApp = [[[NSBundle mainBundle] resourcePath] stringByAppendingPathComponent:databaseName];&lt;br /&gt;&lt;br /&gt; // Copy the database from the package to the users filesystem&lt;br /&gt; [fileManager copyItemAtPath:databasePathFromApp toPath:databasePath error:nil];&lt;br /&gt;&lt;br /&gt; [fileManager release];&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;-(void) readAnimalsFromDatabase {&lt;br /&gt; // Setup the database object&lt;br /&gt; sqlite3 *database;&lt;br /&gt;&lt;br /&gt; // Init the animals Array&lt;br /&gt; animals = [[NSMutableArray alloc] init];&lt;br /&gt;&lt;br /&gt; // Open the database from the users filessytem&lt;br /&gt; if(sqlite3_open([databasePath UTF8String], &amp;amp;database) == SQLITE_OK) {&lt;br /&gt;  // Setup the SQL Statement and compile it for faster access&lt;br /&gt;  const char *sqlStatement = "select * from animals";&lt;br /&gt;  sqlite3_stmt *compiledStatement;&lt;br /&gt;  if(sqlite3_prepare_v2(database, sqlStatement, -1, &amp;amp;compiledStatement, NULL) == SQLITE_OK) {&lt;br /&gt;   // Loop through the results and add them to the feeds array&lt;br /&gt;   while(sqlite3_step(compiledStatement) == SQLITE_ROW) {&lt;br /&gt;    // Read the data from the result row&lt;br /&gt;    NSString *aName = [NSString stringWithUTF8String:(char *)sqlite3_column_text(compiledStatement, 1)];&lt;br /&gt;    NSString *aDescription = [NSString stringWithUTF8String:(char *)sqlite3_column_text(compiledStatement, 2)];&lt;br /&gt;    NSString *aImageUrl = [NSString stringWithUTF8String:(char *)sqlite3_column_text(compiledStatement, 3)];&lt;br /&gt;&lt;br /&gt;    // Create a new animal object with the data from the database&lt;br /&gt;    Animal *animal = [[Animal alloc] initWithName:aName description:aDescription url:aImageUrl];&lt;br /&gt;&lt;br /&gt;    // Add the animal object to the animals Array&lt;br /&gt;    [animals addObject:animal];&lt;br /&gt;&lt;br /&gt;    [animal release];&lt;br /&gt;   }&lt;br /&gt;  }&lt;br /&gt;  // Release the compiled statement from memory&lt;br /&gt;  sqlite3_finalize(compiledStatement);&lt;br /&gt;&lt;br /&gt; }&lt;br /&gt; sqlite3_close(database);&lt;br /&gt;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;@end&lt;br /&gt;&lt;/pre&gt; &lt;p&gt;Now I know that may look like a fair bit of code and it probably also looks quite scary! But really it is quite simple and I have tried to comment nearly every line to describe to you what the line does and why it is there.&lt;/p&gt; &lt;p&gt;The &lt;strong&gt;checkAndCreateDatabase&lt;/strong&gt; function checks to see if we have already copied our database from the application bundle to the users filesystem (in their documents folder), if the database hasn’t already been created or it has been removed for some reason it will be recreated from the default database.&lt;/p&gt; &lt;p&gt;Next the &lt;strong&gt;readAnimalsFromDatabase&lt;/strong&gt; function will make a connection to the database that is stored in the users documents folder, and then executes the SQL statement “SELECT * FROM animals”. It will then go through each row that is returned and it will extract the name, description and imageURL from the result and build an &lt;strong&gt;Animal&lt;/strong&gt; object for each. You  will see the &lt;strong&gt;“sqlite3_column_text”&lt;/strong&gt; function used here, there are many more of these for returning other field types such as &lt;strong&gt;“sqlite3_column_int”&lt;/strong&gt; for integers, &lt;strong&gt;“sqlite3_column_blob”&lt;/strong&gt; for blobs or &lt;strong&gt;“sqlite3_column_value”&lt;/strong&gt; to get an unknown value.&lt;/p&gt; &lt;p&gt;Now that we have the data in our array and we have it in our known format we are ready to start displaying it.&lt;/p&gt; &lt;p&gt;Open up the &lt;strong&gt;“RootViewController.m”&lt;/strong&gt; file and edit the &lt;strong&gt;numberOfRowsInSection&lt;/strong&gt; to look like the following:&lt;/p&gt; &lt;pre&gt;SQLiteTutorialAppDelegate *appDelegate = (SQLiteTutorialAppDelegate *)[[UIApplication sharedApplication] delegate];&lt;br /&gt;return appDelegate.animals.count;&lt;br /&gt;&lt;/pre&gt; &lt;p&gt;What this does is it creates a link to the application delegate, and then the second line returns the size f the animals array in out Application delegate, this array was filled previously from the SQLite database.&lt;/p&gt; &lt;p&gt;Now in the cellForRowAtIndexPath function you will need at change it to look like the following:&lt;/p&gt; &lt;pre&gt;- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {&lt;br /&gt;&lt;br /&gt;   static NSString *CellIdentifier = @"Cell";&lt;br /&gt;&lt;br /&gt;   UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier];&lt;br /&gt;   if (cell == nil) {&lt;br /&gt;       cell = [[[UITableViewCell alloc] initWithFrame:CGRectZero reuseIdentifier:CellIdentifier] autorelease];&lt;br /&gt;   }&lt;br /&gt;&lt;br /&gt;   // Set up the cell&lt;br /&gt;   SQLiteTutorialAppDelegate *appDelegate = (SQLiteTutorialAppDelegate *)[[UIApplication sharedApplication] delegate];&lt;br /&gt; Animal *animal = (Animal *)[appDelegate.animals objectAtIndex:indexPath.row];&lt;br /&gt;&lt;br /&gt; [cell setText:animal.name];&lt;br /&gt; return cell;&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt; &lt;p&gt;We pretty much just added 3 lines under the &lt;strong&gt;“// Set up the cell”&lt;/strong&gt; line, the first one is the same as we added previously to access the application delegate. The second line creates a new &lt;strong&gt;Animal&lt;/strong&gt; object based on the array from the application delegate, it will be used to create a row for each individual record in the database. On the final line we are just setting the text of the cell to the name field from the &lt;strong&gt;Animal&lt;/strong&gt; object.&lt;/p&gt; &lt;p&gt;You can now run the program and you should see a table view with the 4 animals we added to the database, if you added more than my default animals you should see them in here as well.&lt;/p&gt; &lt;p&gt;We will now setup the &lt;strong&gt;AnimalViewController&lt;/strong&gt;, open up the “AnimalViewController.h” file and edit its contents to below:&lt;/p&gt; &lt;pre&gt;#import &lt;uikit/uikit.h&gt;&lt;br /&gt;&lt;br /&gt;@interface AnimalViewController : UIViewController {&lt;br /&gt; IBOutlet UITextView *animalDesciption;&lt;br /&gt; IBOutlet UIImageView *animalImage;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;@property (nonatomic, retain) IBOutlet UITextView *animalDesciption;&lt;br /&gt;@property (nonatomic, retain) IBOutlet UIImageView *animalImage;&lt;br /&gt;&lt;br /&gt;@end&lt;br /&gt;&lt;/pre&gt; &lt;p&gt;What we are doing above is adding an outlet for the description and image for the &lt;strong&gt;Animal&lt;/strong&gt;, we will use these later on when we link the view up.&lt;/p&gt; &lt;p&gt;Now open up the “AnimalViewController.m” file and add a &lt;strong&gt;synthesize&lt;/strong&gt; call for for the description and image, this will go under the &lt;strong&gt;“@implementation AnimalViewController”&lt;/strong&gt; line, like so:&lt;/p&gt; &lt;pre&gt;#import "AnimalViewController.h"&lt;br /&gt;&lt;br /&gt;@implementation AnimalViewController&lt;br /&gt;&lt;br /&gt;@synthesize animalDesciption, animalImage;&lt;br /&gt;&lt;/pre&gt; &lt;p&gt;Now it is time to make the detailed view page appear when you select a record. Open up the “AnimalViewController.xib” file from the resources folder and the interface builder should appear.&lt;/p&gt; &lt;p&gt;The first thing we need to do is to set the &lt;strong&gt;File’s Owner&lt;/strong&gt; Class to &lt;strong&gt;AnimalViewController&lt;/strong&gt;, this is done by selecting the &lt;strong&gt;“File’s Owner”&lt;/strong&gt; item in the main window and then clicking &lt;strong&gt;Tools &gt; Identity Inspector&lt;/strong&gt; in the top menu, and then selecting &lt;strong&gt;AnimalViewController&lt;/strong&gt; from the class dropdown.&lt;/p&gt; &lt;p&gt;Your inspector window should now look like this:&lt;br /&gt;&lt;a onclick="javascript:pageTracker._trackPageview('/downloads/wp-content/uploads/2008/09/picture-26.png');" href="http://dblog.com.au/wp-content/uploads/2008/09/picture-26.png"&gt;&lt;img src="http://dblog.com.au/wp-content/uploads/2008/09/picture-26-116x300.png" alt="" title="Identity Inspector" class="aligncenter size-medium wp-image-73" height="300" width="116" /&gt;&lt;/a&gt;&lt;/p&gt; &lt;p&gt;We are going to be using a &lt;strong&gt;UITextView&lt;/strong&gt; for the description (as it will allow for word wrapping and scrolling in the case that the description is quite large) and a &lt;strong&gt;UIImageView&lt;/strong&gt; to display the image. I have laid mine out like below:&lt;br /&gt;&lt;a onclick="javascript:pageTracker._trackPageview('/downloads/wp-content/uploads/2008/09/picture-25.png');" href="http://dblog.com.au/wp-content/uploads/2008/09/picture-25.png"&gt;&lt;img src="http://dblog.com.au/wp-content/uploads/2008/09/picture-25-206x299.png" alt="" title="Animal View Layout" class="aligncenter size-medium wp-image-72" height="299" width="206" /&gt;&lt;/a&gt;&lt;/p&gt; &lt;p&gt;Now that we have everything laid out it is time to link them all up, start by holding &lt;strong&gt;control&lt;/strong&gt; and &lt;strong&gt;click+drag&lt;/strong&gt; from the &lt;strong&gt;“File’s Owner”&lt;/strong&gt; to the &lt;strong&gt;“View”&lt;/strong&gt; objects, a little gray menu will appear and you will need to select &lt;strong&gt;view&lt;/strong&gt;. Now hold &lt;strong&gt;control&lt;/strong&gt; and &lt;strong&gt;click+drag&lt;/strong&gt; from the &lt;strong&gt;“File’s Owner”&lt;/strong&gt; to the &lt;strong&gt;UITextView&lt;/strong&gt; in the layout window, you should see &lt;strong&gt;“animalDescription”&lt;/strong&gt; in the popup list, select it. Repeat this process for the &lt;strong&gt;UIImageView&lt;/strong&gt; and you should see &lt;strong&gt;animalImage&lt;/strong&gt; appear, select it also.&lt;/p&gt; &lt;p&gt;Now save the interface and close the interface builder.&lt;/p&gt; &lt;p&gt;Nearly done! All we have to do now is to setup the code for when a user presses on a record in the table view.&lt;/p&gt; &lt;p&gt;Open up the &lt;strong&gt;“RootViewController.h”&lt;/strong&gt; file and edit its contents to below:&lt;/p&gt; &lt;pre&gt;#import &lt;uikit/uikit.h&gt;&lt;br /&gt;#import "AnimalViewController.h"&lt;br /&gt;&lt;br /&gt;@interface RootViewController : UITableViewController {&lt;br /&gt; AnimalViewController *animalView;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;@property(nonatomic, retain) AnimalViewController *animalView;&lt;br /&gt;&lt;br /&gt;@end&lt;br /&gt;&lt;/pre&gt; &lt;p&gt;We are creating an instance of the &lt;strong&gt;AnimalViewController&lt;/strong&gt; to be used bu the &lt;strong&gt;RootViewController&lt;/strong&gt; when a user presses on an item.&lt;/p&gt; &lt;p&gt;Now open up the &lt;strong&gt;“RootViewController.m”&lt;/strong&gt; file and edit the top part of the file to look like below:&lt;/p&gt; &lt;pre&gt;#import "RootViewController.h"&lt;br /&gt;#import "SQLiteTutorialAppDelegate.h"&lt;br /&gt;#import "Animal.h"&lt;br /&gt;&lt;br /&gt;@implementation RootViewController&lt;br /&gt;@synthesize animalView;&lt;br /&gt;&lt;/pre&gt; &lt;p&gt;This will just synthesize the &lt;strong&gt;animalView&lt;/strong&gt; that we just added.&lt;/p&gt; &lt;p&gt;First up lets set the default title of our view, to do this you need to uncomment the viewDidLoad function, and edit it to below:&lt;/p&gt; &lt;pre&gt;- (void)viewDidLoad {&lt;br /&gt;   [super viewDidLoad];&lt;br /&gt;   // Uncomment the following line to add the Edit button to the navigation bar.&lt;br /&gt;   // self.navigationItem.rightBarButtonItem = self.editButtonItem;&lt;br /&gt;&lt;br /&gt; self.title = @"My Zoo";&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt; &lt;p&gt;We also need to edit the &lt;strong&gt;didSelectRowAtIndexPath&lt;/strong&gt;&lt;/p&gt; &lt;p&gt; function in this file, edit it to look like below:&lt;/p&gt; &lt;pre&gt;- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {&lt;br /&gt;   // Navigation logic -- create and push a new view controller&lt;br /&gt; SQLiteTutorialAppDelegate *appDelegate = (SQLiteTutorialAppDelegate *)[[UIApplication sharedApplication] delegate];&lt;br /&gt; Animal *animal = (Animal *)[appDelegate.animals objectAtIndex:indexPath.row];&lt;br /&gt;&lt;br /&gt; if(self.animalView == nil) {&lt;br /&gt;  AnimalViewController *viewController = [[AnimalViewController alloc] initWithNibName:@"AnimalViewController" bundle:nil];&lt;br /&gt;  self.animalView = viewController;&lt;br /&gt;  [viewController release];&lt;br /&gt; }&lt;br /&gt;&lt;br /&gt; // Setup the animation&lt;br /&gt; [self.navigationController pushViewController:self.animalView animated:YES];&lt;br /&gt; // Set the title of the view to the animal's name&lt;br /&gt; self.animalView.title = [animal name];&lt;br /&gt; // Set the description field to the animals description&lt;br /&gt; [self.animalView.animalDesciption setText:[animal description]];&lt;br /&gt; // Load the animals image into a NSData boject and then assign it to the UIImageView&lt;br /&gt; NSData *imageData = [NSData dataWithContentsOfURL:[NSURL URLWithString:[animal imageURL]]];&lt;br /&gt; UIImage *animalImage = [[UIImage alloc] initWithData:imageData cache:YES];&lt;br /&gt; self.animalView.animalImage.image = animalImage;&lt;br /&gt;&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt; &lt;p&gt;What we are doing here is checking to see if the animalView object has already been created, if not then create it.&lt;/p&gt; &lt;p&gt;The next few lines are used to setup the animation (slide from right to left) and to set the actual data fields to those of the selected animal.&lt;/p&gt; &lt;p&gt;Now you should be ready to fire up the application and see it in all its glory.&lt;/p&gt; &lt;p&gt;You should see your windows looking like below.&lt;br /&gt;&lt;a onclick="javascript:pageTracker._trackPageview('/downloads/wp-content/uploads/2008/09/picture-27.png');" href="http://dblog.com.au/wp-content/uploads/2008/09/picture-27.png"&gt;&lt;img src="http://dblog.com.au/wp-content/uploads/2008/09/picture-27-161x300.png" alt="" title="picture-27" class="alignnone size-medium wp-image-74" height="300" width="161" /&gt;&lt;/a&gt; &lt;a onclick="javascript:pageTracker._trackPageview('/downloads/wp-content/uploads/2008/09/picture-291.png');" href="http://dblog.com.au/wp-content/uploads/2008/09/picture-291.png"&gt;&lt;img src="http://dblog.com.au/wp-content/uploads/2008/09/picture-291-161x300.png" alt="" title="picture-291" class="alignnone size-medium wp-image-76" height="300" width="161" /&gt;&lt;/a&gt;&lt;/p&gt; &lt;h3&gt;5. Project Files&lt;/h3&gt; &lt;p&gt;Here are the source files for this project: &lt;a onclick="javascript:pageTracker._trackPageview('/downloads/wp-content/uploads/2008/09/sqlitetutorial.zip');" href="http://dblog.com.au/wp-content/uploads/2008/09/sqlitetutorial.zip"&gt;Download the project source files&lt;/a&gt;&lt;/p&gt; &lt;p&gt;If you have any questions or comments please feel free to post them here and I will try to get back to you ASAP. Also keep your eye out for my second part to the advanced RSS Reader tutorial, it will be using TouchXML, SQLite, UIWebview and more!&lt;/p&gt;&lt;p&gt;original post is here&lt;/p&gt;&lt;p&gt;http://dblog.com.au/iphone-development-tutorials/iphone-sdk-tutorial-reading-data-from-a-sqlite-database/comment-page-3/#comment-3095&lt;br /&gt;&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7660917028131688558-4969409730676464021?l=jainmarket.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://jainmarket.blogspot.com/feeds/4969409730676464021/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7660917028131688558&amp;postID=4969409730676464021' title='3 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7660917028131688558/posts/default/4969409730676464021'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7660917028131688558/posts/default/4969409730676464021'/><link rel='alternate' type='text/html' href='http://jainmarket.blogspot.com/2009/05/iphone-sdk-tutorial-reading-data-from.html' title='iPhone SDK Tutorial: Reading data from a SQLite Database'/><author><name>Rahul Vyas</name><uri>http://www.blogger.com/profile/08326955903115378266</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://bp1.blogger.com/_6C_XpG63jYw/SAgrxtkt56I/AAAAAAAAACc/pr7-vuTQS5w/S220/P1170634+(Small).JPG'/></author><thr:total>3</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7660917028131688558.post-3830304258625249021</id><published>2009-05-14T19:56:00.001+05:30</published><updated>2009-05-14T19:56:52.870+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='SQLite3'/><category scheme='http://www.blogger.com/atom/ns#' term='IPHONE'/><title type='text'>iPhone SQLite Database Basics - Part 2</title><content type='html'>After writing the article on &lt;a href="http://leefalin.com/blog/2008/10/02/iphone-sqlite-database-basics/"&gt;iPhone SQLite Database Basics&lt;/a&gt;, I received lots of followup questions and comments, some of which I will discuss here.&lt;div class="entry"&gt; &lt;h3&gt;SQLite Database Creation&lt;/h3&gt; &lt;p&gt;In my first article I wrote that the easiest way to work with SQLite databases on the mac was the &lt;a href="https://addons.mozilla.org/en-US/firefox/addon/5817"&gt;SQLite extension for Firefox&lt;/a&gt;.&lt;/p&gt; &lt;p&gt;Since then, my attention has been brought to Menial’s &lt;a href="http://menial.co.uk/software/base/"&gt;Base&lt;/a&gt; application. This is the application that I now use for all of my SQLite work. It is super fast, and has an interface that is extremely easy to use. It also has a lot of nice touches that make it more Mac-like than using a Firefox extension. If you’re doing SQLite work on the Mac, I strongly recommend that you check it out.&lt;/p&gt; &lt;h3&gt;Making a Writable Copy of the Database&lt;/h3&gt; &lt;p&gt;In the &lt;a href="http://leefalin.com/blog/2008/10/02/iphone-sqlite-database-basics/"&gt;first part&lt;/a&gt; of this tutorial, I mentioned that if you needed to write to your database you needed to copy it to a location that you could write to. &lt;/p&gt; &lt;p&gt;A couple of people have asked how to do this. To answer that, I first want to talk a little bit about how to control SQLite access in Cocoa applications. There are really three ways to do this:&lt;/p&gt; &lt;ol&gt;&lt;li&gt;Have DB access code in each class that needs it (bad)&lt;/li&gt;&lt;li&gt;Have you application delegate handle all DB access for you (better)&lt;/li&gt;&lt;li&gt;Use a singleton object for your DB access (best)&lt;/li&gt;&lt;/ol&gt; &lt;p&gt;For more about the tradeoffs between application delegate usage and singleton objects see &lt;a href="http://cocoawithlove.com/2008/11/singletons-appdelegates-and-top-level.html"&gt;this post from Cocoa with Love&lt;/a&gt;.&lt;/p&gt; &lt;p&gt;If you are using the singleton pattern, then you can make a writable copy of your database in your &lt;a href="http://developer.apple.com/documentation/Cocoa/Conceptual/CocoaFundamentals/CocoaObjects/chapter_3_section_10.html"&gt;singleton object’s allocation&lt;/a&gt; method, using something like this:&lt;/p&gt; &lt;blockquote class="blockSource"&gt; &lt;ol&gt;&lt;li&gt;&lt;span class="sourceTextTwo"&gt;-(NSString*)createWriteableDB&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span class="sourceTextTwo"&gt;{&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span class="sourceTextTwo"&gt;    // See if writeable database already exists&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span class="sourceTextTwo"&gt;    NSFileManager *fileManager = [NSFileManager defaultManager];&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span class="sourceTextTwo"&gt;    NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span class="sourceTextTwo"&gt;    NSString *documentsDirectory = [paths objectAtIndex:0];&lt;/span&gt;&lt;/li&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;li&gt;&lt;span class="sourceTextTwo"&gt;    NSString *readOnlyDBPath = [[[NSBundle mainBundle] resourcePath] stringByAppendingPathComponent:self.databaseFileName];&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span class="sourceTextTwo"&gt;    NSString *writableDBPath = [[documentsDirectory stringByAppendingPathComponent:self.databaseFileName] retain];&lt;/span&gt;&lt;/li&gt;&lt;p&gt;&lt;br /&gt; &lt;/p&gt;&lt;li&gt;&lt;span class="sourceTextTwo"&gt;    // First time install&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span class="sourceTextTwo"&gt;    if(![fileManager fileExistsAtPath:writableDBPath])&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span class="sourceTextTwo"&gt;    {&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span class="sourceTextTwo"&gt;        if(![fileManager copyItemAtPath:readOnlyDBPath toPath:writableDBPath error:&amp;amp;self.lastError])&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span class="sourceTextTwo"&gt;        {&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span class="sourceTextTwo"&gt;            NSAssert1(0, @”Failed to create writable database file with message ‘%@’.”, [self.lastError localizedDescription]);&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span class="sourceTextTwo"&gt;            return nil;&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span class="sourceTextTwo"&gt;        }&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span class="sourceTextTwo"&gt;    }&lt;/span&gt;&lt;/li&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;li&gt;&lt;span class="sourceTextTwo"&gt;    return [writableDBPath autorelease];&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span class="sourceTextTwo"&gt;}&lt;/span&gt;&lt;/li&gt;&lt;/ol&gt; &lt;/blockquote&gt; &lt;p&gt;A couple of important things to note here:&lt;/p&gt; &lt;p&gt;If you have a very large database and the things that you need to allow the user to update, (i.e. bookmarks, or annotations) are small in comparison, it may be better for you to have two databases files, one that contains the data that won’t change, and the other that contains the data used for annotations. This way you won’t have two large copies of the database on the user’s device. &lt;/p&gt; &lt;p&gt;This will of course have a large impact on your query design, and some database purists may be lining up to lynch me, but as I mentioned in the first article, there are some SQLite considerations that are unique to mobile devices like the iPhone.&lt;/p&gt; &lt;p&gt;Another thing to consider is versioning. You need to be very careful how you handle application updates that change the database structure and/or content when you are allowing the user to write data (that presumably they want to persist between updates).&lt;/p&gt; &lt;p&gt;One way to handle this is to simply have a table in your writable database called “Version” which contains one row and one column with the version number of the database schema. &lt;/p&gt; &lt;p&gt;Then in the above code you can add some logic to transfer the data from a pervious schema version to the new writable database file. &lt;/p&gt; &lt;h3&gt;Third Party SQLite Wrappers&lt;/h3&gt; &lt;p&gt;There are &lt;a href="http://code.google.com/p/flycode/source/browse/trunk/fmdb"&gt;lots&lt;/a&gt; of &lt;a href="http://www.webbotech.com/"&gt;SQLite&lt;/a&gt; wrappers &lt;a href="http://code.google.com/p/touchcode/"&gt;available&lt;/a&gt; for iPhone development. I’ve never used any so I can’t say if any one is better than another. If the idea of using c-based SQLite calls makes you anxious, you may want to check them out.&lt;/p&gt; &lt;h3&gt;Security&lt;/h3&gt; &lt;p&gt;Someone suggested that I point out that SQLite databases on the iPhone aren’t really secure. I’m not a database security expert, but that statement is true of databases on any platform. The database is only as secure as the device itself. If someone gets ahold of your iPhone, they can most likely get the data off of it.&lt;/p&gt;     &lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7660917028131688558-3830304258625249021?l=jainmarket.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://jainmarket.blogspot.com/feeds/3830304258625249021/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7660917028131688558&amp;postID=3830304258625249021' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7660917028131688558/posts/default/3830304258625249021'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7660917028131688558/posts/default/3830304258625249021'/><link rel='alternate' type='text/html' href='http://jainmarket.blogspot.com/2009/05/iphone-sqlite-database-basics-part-2.html' title='iPhone SQLite Database Basics - Part 2'/><author><name>Rahul Vyas</name><uri>http://www.blogger.com/profile/08326955903115378266</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://bp1.blogger.com/_6C_XpG63jYw/SAgrxtkt56I/AAAAAAAAACc/pr7-vuTQS5w/S220/P1170634+(Small).JPG'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7660917028131688558.post-4297800716847792581</id><published>2009-05-14T19:54:00.000+05:30</published><updated>2009-05-14T19:56:09.355+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='SQLite3'/><category scheme='http://www.blogger.com/atom/ns#' term='IPHONE'/><title type='text'>iPhone SQLite Database Basics</title><content type='html'>&lt;span class="postData"&gt;&lt;/span&gt;&lt;div class="entry"&gt;      &lt;p&gt;In celebration of the lifting of the NDA on the iPhone SDK, I decided to write a tutorial on using SQLite on the iPhone.&lt;/p&gt; &lt;p&gt;This tutorial covers the basics of SQLite database creation, things to consider in the design of the database, and some particular things to be aware of when deploying these types of applications to the iPhone. &lt;/p&gt; &lt;p&gt;Once you have finished with these basics, take a look at the &lt;a href="http://developer.apple.com/iphone/library/samplecode/SQLiteBooks/index.html"&gt;SQLiteBooks&lt;/a&gt; sample code from the iPhone dev center for details on how to interface with the database from your code.&lt;/p&gt; &lt;h3&gt;Step 1: Create a SQLite Database File&lt;/h3&gt; &lt;p&gt;There are lots of ways to create a SQLite database file. The easiest way that I have found is to download the &lt;a href="https://addons.mozilla.org/en-US/firefox/addon/5817"&gt;SQLite Firefox extension&lt;/a&gt;, which provides a GUI to create and manage your SQLite database. The rest of this tutorial will assume you have that extension installed.&lt;/p&gt; &lt;p&gt;In this tutorial we’ll be creating a recipe application, so we are naming our database “recipes”.&lt;/p&gt; &lt;p&gt;To create the database:&lt;/p&gt; &lt;ol&gt;&lt;li&gt;Click the “New Database” toolbar button.&lt;/li&gt;&lt;li&gt;Enter the name of the database file.&lt;/li&gt;&lt;li&gt;Click OK.&lt;/li&gt;&lt;/ol&gt; &lt;p&gt;&lt;img src="http://leefalin.com/blog/wp-content/uploads/2008/10/createdb.jpg" alt="createDB.jpg" border="0" height="364" width="626" /&gt;&lt;/p&gt; &lt;p&gt;You will then be prompted for a location to save the database. The ideal place is in the directory of your XCode project.&lt;/p&gt; &lt;h3&gt;Step 2: Create the Database Schema&lt;/h3&gt; &lt;p&gt;Now we are going to setup our database tables. This will be a very simple database with two tables:&lt;/p&gt; &lt;p&gt;&lt;img src="http://leefalin.com/blog/wp-content/uploads/2008/10/schema.png" alt="schema.png" border="0" height="261" width="685" /&gt;&lt;/p&gt; &lt;p&gt;There are entire textbooks about “proper” database design and if you are developing a super large-scale ultra robust data warehouse app, you might want to look them over. However rather than make your eyes glaze over with the merits of &lt;a href="http://en.wikipedia.org/wiki/Third_normal_form"&gt;third normal form&lt;/a&gt;, let me just share a few guidelines that I picked up during several years as a DBA/Database application developer:&lt;/p&gt; &lt;blockquote&gt; &lt;ol&gt;&lt;li&gt;Every table should mirror an object, with each non-calculated object property mapping directly to a table field.&lt;/li&gt;&lt;li&gt;In addition to the object properties, every table should have an integer field that is autofilled with a unique identifier (commonly know as the primary key).&lt;/li&gt;&lt;li&gt;Every table that is dependent on a parent table should have a way to refer back to its parent. (This is sometimes called a Foreign Key)&lt;/li&gt;&lt;/ol&gt; &lt;/blockquote&gt; &lt;p&gt;In our application we’re going to have two model objects. A Recipe object, and an Ingredient object. Each recipe object can have 1 or more ingredient child objects. (The blue arrow in the above diagram signifies this, and is called a 1-to many relationship).&lt;/p&gt; &lt;p&gt;The Recipe object has a name and description property. These are both strings, and these map to database fields of type VarChar (meaning Variable length Character string). In addition, the Recipes table has a Recipe_ID field of type Integer. This field is the primary key of the Recipes table.&lt;/p&gt; &lt;p&gt;The ingredient object in our simple application only has one property, Description. Since this is a string it also maps to a VarChar field. Our Ingredients table also has a primary key (Ingredient_ID) which gives us a way to refer to a specific ingredient. &lt;/p&gt; &lt;p&gt;Finally, the Recipe_ID field in the Ingredients table is our foreign key back to the Recipes table. Using that key you can look at any ingredient and know what Recipe it belongs to. More commonly an application will use that key to get all of the ingredients that belong to a specific recipe.&lt;/p&gt; &lt;p&gt;To create the Recipes table, click the “New Table” toolbar button and enter the information as seen below:&lt;/p&gt; &lt;p&gt;&lt;img src="http://leefalin.com/blog/wp-content/uploads/2008/10/recipetable.jpg" alt="RecipeTable.jpg" border="0" height="403" width="690" /&gt;&lt;/p&gt; &lt;p&gt;Notice that we check the Primary Key and Autoinc checkboxes for the Recipe_ID field. The Primary Key checkbox tells SQLite to treat this field as a Unique Index, meaning that it can guarantee that the values in this field won’t be duplicated and should be kept sorted for faster queries. (Later we’ll talk a little more about optimizing queries by adding additional table indices.)&lt;/p&gt; &lt;p&gt;The Autoinc checkbox tells SQLite how to handle the automatic creation of primary key values. Without autoinc being checked, when a new row is added SQLite sets the primary key to one greater than the current highest primary key. With the box checked, SQLite sets the primary key to one greater than the highest primary key that the table has every had. (Which it keeps track of in its own table called sqlite_sequence). How you set this box will depend on how you want to handle deleted records.&lt;/p&gt; &lt;p&gt;For the Ingredients table, it is much the same:&lt;/p&gt; &lt;p&gt;&lt;img src="http://leefalin.com/blog/wp-content/uploads/2008/10/ingredientstable.jpg" alt="IngredientsTable.jpg" border="0" height="403" width="690" /&gt;&lt;/p&gt; &lt;p&gt;Notice that we do NOT mark the Recipe_ID field of the Ingredients table as a primary key. It is the primary key of the Recipes table, not of this table. (In this table some people would call the Recipe_ID field the foreign key).&lt;/p&gt; &lt;p&gt;The last thing that we want to do regarding our database schema is to create an index on the Recipe_ID field of the Ingredients table. Since most of our queries that involve this table will involve looking up a specific value in the Recipe_ID field, it will speed things up to have an index on this field. (Note: You really won’t notice a significant speed increase unless your Ingredients table has a lot of records, but since it is a good design principle, we’re going to do it anyway.)&lt;/p&gt; &lt;p&gt;&lt;img src="http://leefalin.com/blog/wp-content/uploads/2008/10/createindex.jpg" alt="createIndex.jpg" border="0" height="403" width="690" /&gt;&lt;/p&gt; &lt;p&gt;Finally you need to populate the table with some data. You can do that using the SQLite Manager by selecting the table and then clicking the “Add new Record” button, or by selecting the “Execute SQL” tab and using several &lt;a href="http://www.sqlite.org/lang_insert.html"&gt;Insert statements&lt;/a&gt;. &lt;/p&gt; &lt;p&gt;For example to insert this data into my Recipes table:&lt;/p&gt; &lt;table border="1" cellpadding="5"&gt; &lt;tbody&gt;&lt;tr style="background-color: rgb(204, 204, 204);"&gt; &lt;th&gt;Recipe_ID&lt;/th&gt; &lt;th&gt;Name&lt;/th&gt; &lt;th&gt;Description&lt;/th&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td&gt;1&lt;/td&gt; &lt;td&gt;Omelet&lt;/td&gt; &lt;td&gt;A delicious and eggy breakfast.&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td&gt;2&lt;/td&gt; &lt;td&gt;Grilled Cheese Sandwich&lt;/td&gt; &lt;td&gt;A delicious and cheese filled lunch.&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td&gt;3&lt;/td&gt; &lt;td&gt;Pizza&lt;/td&gt; &lt;td&gt;A classic dinner from the old world.&lt;/td&gt; &lt;/tr&gt; &lt;/tbody&gt;&lt;/table&gt; &lt;p&gt;I could use these three insert statements:&lt;/p&gt; &lt;div style="color: rgb(102, 0, 0);"&gt;INSERT into Recipes(Name, Description) VALUES(’Omelet’, ‘A delicious and eggy breakfast.’);&lt;/div&gt; &lt;div style="color: rgb(102, 0, 0);"&gt;INSERT into Recipes(Name, Description) VALUES(’Grilled Cheese Sandwich’, ‘A delicious and cheese filled lunch.’);&lt;/div&gt; &lt;div style="color: rgb(102, 0, 0);"&gt;INSERT into Recipes(Name, Description) VALUES(’Pizza’, ‘A classic dinner from the old world.’);&lt;/div&gt; &lt;p&gt;Notice that I did not insert the values for the Recipe_ID field. As I mentioned above, since it is the primary key the database calculates those values automatically.&lt;/p&gt; &lt;p&gt;Next comes the Ingredients table:&lt;/p&gt; &lt;table border="1" cellpadding="5"&gt; &lt;tbody&gt;&lt;tr style="background-color: rgb(204, 204, 204);"&gt; &lt;th&gt;Ingredient_ID&lt;/th&gt; &lt;th&gt;Recipe_ID&lt;/th&gt; &lt;th&gt;Description&lt;/th&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td&gt;1&lt;/td&gt; &lt;td&gt;1&lt;/td&gt; &lt;td&gt;Eggs&lt;/td&gt;&lt;/tr&gt; &lt;tr&gt; &lt;td&gt;2&lt;/td&gt; &lt;td&gt;1&lt;/td&gt; &lt;td&gt;Water&lt;/td&gt;&lt;/tr&gt; &lt;tr&gt; &lt;td&gt;3&lt;/td&gt; &lt;td&gt;1&lt;/td&gt; &lt;td&gt;Salt&lt;/td&gt;&lt;/tr&gt; &lt;tr&gt; &lt;td&gt;4&lt;/td&gt; &lt;td&gt;2&lt;/td&gt; &lt;td&gt;Bread&lt;/td&gt;&lt;/tr&gt; &lt;tr&gt; &lt;td&gt;5&lt;/td&gt; &lt;td&gt;2&lt;/td&gt; &lt;td&gt;Cheese&lt;/td&gt;&lt;/tr&gt; &lt;tr&gt; &lt;td&gt;6&lt;/td&gt; &lt;td&gt;2&lt;/td&gt; &lt;td&gt;Butter&lt;/td&gt;&lt;/tr&gt; &lt;tr&gt; &lt;td&gt;7&lt;/td&gt; &lt;td&gt;3&lt;/td&gt; &lt;td&gt;Pizza Dough&lt;/td&gt;&lt;/tr&gt; &lt;tr&gt; &lt;td&gt;8&lt;/td&gt; &lt;td&gt;3&lt;/td&gt; &lt;td&gt;Pizza Sauce&lt;/td&gt;&lt;/tr&gt; &lt;tr&gt; &lt;td&gt;9&lt;/td&gt; &lt;td&gt;3&lt;/td&gt; &lt;td&gt;Cheese&lt;/td&gt;&lt;/tr&gt; &lt;tr&gt; &lt;td&gt;10&lt;/td&gt; &lt;td&gt;3&lt;/td&gt; &lt;td&gt;Toppings&lt;/td&gt;&lt;/tr&gt; &lt;/tbody&gt;&lt;/table&gt; &lt;p&gt;Which I could use the following statements for:&lt;/p&gt; &lt;div style="color: rgb(102, 0, 0);"&gt;INSERT into Ingredients(Recipe_ID, Description) VALUES(1, ‘Eggs’);&lt;/div&gt; &lt;div style="color: rgb(102, 0, 0);"&gt;INSERT into Ingredients(Recipe_ID, Description) VALUES(1, ‘Water’);&lt;/div&gt; &lt;div style="color: rgb(102, 0, 0);"&gt;INSERT into Ingredients(Recipe_ID, Description) VALUES(1, ‘Salt’);&lt;/div&gt; &lt;div style="color: rgb(102, 0, 0);"&gt;INSERT into Ingredients(Recipe_ID, Description) VALUES(2, ‘Bread’);&lt;/div&gt; &lt;div style="color: rgb(102, 0, 0);"&gt;…&lt;/div&gt; &lt;div style="color: rgb(102, 0, 0);"&gt;INSERT into Ingredients(Recipe_ID, Description) VALUES(3, ‘Toppings’);&lt;/div&gt; &lt;p&gt;Again notice that I did not specify the values for the table’s primary key (Ingredient_ID), but I did specify the foreign key values (Recipe_ID).&lt;/p&gt; &lt;h3&gt;Step 3: Add the Database File to Your XCode Project&lt;/h3&gt; &lt;p&gt;To do this, just right click on the Resources folder and select “Add-&gt;Existing Files…” and then select the database file that you created.&lt;/p&gt; &lt;p&gt;&lt;img src="http://leefalin.com/blog/wp-content/uploads/2008/10/addfile.jpg" alt="addFile.jpg" border="0" height="361" width="637" /&gt;&lt;/p&gt; &lt;p&gt;XCode should automatically add the file that you select to the “Copy Bundle Resources” build phase of your project target. (Meaning that when the program is compiled, your database file is automatically stored in the application bundle’s resource folder so that you can access it from your application.)&lt;/p&gt; &lt;p&gt;&lt;strong&gt;Update: &lt;/strong&gt;&lt;a href="http://toxicsoftware.com/"&gt;Jonathan Wight&lt;/a&gt; suggested that instead of embedding the SQLite db file directly into the XCode project, it is better to embed the SQL source file into the project and then setup a compile rule in XCode to generate the db file and embed it into the bundle at compile time. As he points out this has a particular advantage related to source code control. He provides an example of how to do this &lt;a href="http://public.toxicsoftware.com/CompileSQL.png"&gt;here&lt;/a&gt;.&lt;/p&gt; &lt;h3&gt;Step 4: Link to the SQLite Library&lt;/h3&gt; &lt;p&gt;Finally you are ready to link to the library that contains all of the SQLite functions. To link to that library, from your XCode project right click the frameworks folder and select “Add-&gt;Existing Frameworks…”.&lt;/p&gt; &lt;p&gt;&lt;img src="http://leefalin.com/blog/wp-content/uploads/2008/10/addframework.jpg" alt="addFramework.jpg" border="0" height="279" width="566" /&gt;&lt;/p&gt; &lt;p&gt;Next, navigate to the your iPhoneSDK folder and select the usr/lib/libsqlite3.0.dylib file. (Don’t be confused by the other libsqlite*.lib files in that folder, they are all just aliases to this one.)&lt;/p&gt; &lt;p&gt;&lt;img src="http://leefalin.com/blog/wp-content/uploads/2008/10/xcode-1.jpg" alt="Xcode.jpg" border="0" height="357" width="594" /&gt;&lt;/p&gt; &lt;p&gt;You are now ready to start writing some SQLite code. (Again see the &lt;a href="http://developer.apple.com/iphone/library/samplecode/SQLiteBooks/index.html"&gt;SQLiteBooks&lt;/a&gt; sample code for some tips on doing that.)&lt;/p&gt; &lt;p&gt;&lt;strong&gt;Update: &lt;/strong&gt;&lt;a href="http://toxicsoftware.com/"&gt;Jonathan Wight&lt;/a&gt; also suggested that it is better to use the other linker flags setting in the the Build tab of the Project settings to link to the SQLite library instead of using the framework method. You can do this by adding the -lsqlite3 flag to that field as shown here:&lt;/p&gt; &lt;p&gt;&lt;img src="http://leefalin.com/blog/wp-content/uploads/2008/10/project-sqlitebooks-info.jpg" alt="Project “SQLiteBooks” Info.jpg" border="0" height="196" width="656" /&gt;&lt;/p&gt; &lt;p&gt;This method has the advantage of linking to the correct library no matter what platform you are targeting.&lt;/p&gt; &lt;h3&gt;SQLite on the iPhone Nuances&lt;/h3&gt; &lt;ol&gt;&lt;li&gt;SQLite on the actual iPhone is much slower for some things than on the simulator. In particular the same queries that run in the blink of an eye on the simulator take several seconds to run on the actual device.&lt;/li&gt;&lt;li&gt;If you need to write to your database, make sure you make a copy of it in a location that you can write to. See the &lt;a href="http://developer.apple.com/iphone/library/samplecode/SQLiteBooks/index.html"&gt;SQLiteBooks&lt;/a&gt; sample code for an example of how to do this.&lt;/li&gt;&lt;li&gt;Be aware that SQLite extensions such as Full Text Search don’t appear to be compiled into the iPhone SQLite libraries.&lt;/li&gt;&lt;li&gt;Plan for the future! If you plan on adding a feature that relies on a certain table or field in the database make that part of your database design now. This will save you the trouble of having to write all the necessary SQL commands for versioning your database later when you release an application update.&lt;/li&gt;&lt;/ol&gt;     &lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7660917028131688558-4297800716847792581?l=jainmarket.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://jainmarket.blogspot.com/feeds/4297800716847792581/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7660917028131688558&amp;postID=4297800716847792581' title='4 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7660917028131688558/posts/default/4297800716847792581'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7660917028131688558/posts/default/4297800716847792581'/><link rel='alternate' type='text/html' href='http://jainmarket.blogspot.com/2009/05/iphone-sqlite-database-basics.html' title='iPhone SQLite Database Basics'/><author><name>Rahul Vyas</name><uri>http://www.blogger.com/profile/08326955903115378266</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://bp1.blogger.com/_6C_XpG63jYw/SAgrxtkt56I/AAAAAAAAACc/pr7-vuTQS5w/S220/P1170634+(Small).JPG'/></author><thr:total>4</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7660917028131688558.post-931442792577953860</id><published>2009-05-14T19:48:00.000+05:30</published><updated>2009-05-14T19:54:45.931+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='IPHONE'/><title type='text'>Creating a ToDo List Using SQLite Part 4</title><content type='html'>&lt;p style="text-align: left;"&gt;This is the final installment of our 4 part series of creating a Todo list for the iPhone.  In this tutorial, I will detail how to add and delete new todo objects from the SQLite database.  Make sure that you have completed the following tutorials before you begin this one:&lt;/p&gt; &lt;ul style="text-align: left;"&gt;&lt;li&gt;&lt;a title="Permanent Link to iPhone Programming Tutorial - Creating a ToDo List Using SQLite Part 1" rel="bookmark" href="http://icodeblog.com/2008/08/19/iphone-programming-tutorial-creating-a-todo-list-using-sqlite-part-1/"&gt;iPhone Programming Tutorial - Creating a ToDo List Using SQLite Part 1&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a title="Permanent Link to iPhone Programming Tutorial - Creating a ToDo List Using SQLite Part 1" rel="bookmark" href="http://icodeblog.com/2008/09/02/iphone-programming-tutorial-creating-a-todo-list-using-sqlite-part-2/"&gt;iPhone Programming Tutorial - Creating a ToDo List Using SQLite Part 2&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href="http://icodeblog.com/2008/09/10/iphone-programming-tutorial-creating-a-todo-list-using-sqlite-part-3/"&gt;iPhone Programming Tutorial - Creating a ToDo List Using SQLite Part 3&lt;/a&gt;&lt;/li&gt;&lt;/ul&gt; &lt;p style="text-align: left;"&gt;When you have completed this tutorial, you should have a main screen that looks something like this:&lt;/p&gt; &lt;p style="text-align: left;"&gt;&lt;a href="http://icodeblog.com/wp-content/uploads/2008/09/mainscreen.png"&gt;&lt;img style="width: 303px; height: 576px;" class="size-full wp-image-394 aligncenter" title="screenshot" src="http://icodeblog.com/wp-content/uploads/2008/09/mainscreen.png" alt="" /&gt;&lt;/a&gt;&lt;/p&gt; &lt;p style="text-align: left;"&gt;Let’s get started…&lt;/p&gt; &lt;p style="text-align: left;"&gt;The first thing we need to do is add the UIBarButtonItem items to the NavigationBar so that we get the “Edit” and “Add” button.  Open up &lt;strong&gt;RootViewController.m&lt;/strong&gt; and add the following code to the &lt;strong&gt;viewDidLoad&lt;/strong&gt; method.&lt;/p&gt; &lt;p style="text-align: left;"&gt;&lt;a href="http://icodeblog.com/wp-content/uploads/2008/09/viewdidload.png"&gt;&lt;img style="width: 608px; height: 134px;" class="size-full wp-image-396 aligncenter" title="viewdidload" src="http://icodeblog.com/wp-content/uploads/2008/09/viewdidload.png" alt="" /&gt;&lt;/a&gt;&lt;/p&gt; &lt;p style="text-align: left;"&gt;The first thing we see is the line that sets the leftBarButtonItem to self.editButtonItem.  This automatically adds the “Edit” button to the NavigationController.  Also, it sets up the functionality that allows the “delete” buttons to be displayed when the button is pressed.  You can see this functionality if you do a “Build and Go” at this step.  Next, I have manually created a UIBarButtonItem and added it to the navigationbar.  This can be done in Interface Builder, but I wanted to show you how to do it manually and assign an action to it (I’m sure you will require this functionality in a future program).  Here is a break down of the parameters:&lt;/p&gt; &lt;ul style="text-align: left;"&gt;&lt;li&gt;initWithTitle - The text to be displayed on the button&lt;/li&gt;&lt;li&gt;style - How the button will look&lt;/li&gt;&lt;li&gt;target - The class object that handles the messages sent from this button&lt;/li&gt;&lt;li&gt;action - The method to be called when the button is passed.  We can use @selector and give it the name of the function to call.&lt;/li&gt;&lt;/ul&gt; &lt;p style="text-align: left;"&gt;Finally, we assign this button to the rightBarButtonItem.  If you do a Build and Go, it should error since we haven’t created the addTodo method. We will do that in a bit.  Now, let’s create a method inside of our Todo object that will add new Todos to the database.&lt;/p&gt; &lt;p style="text-align: left;"&gt;Open up &lt;strong&gt;Todo.h&lt;/strong&gt; and add the following code:&lt;/p&gt; &lt;p style="text-align: left;"&gt;&lt;a href="http://icodeblog.com/wp-content/uploads/2008/09/todo.png"&gt;&lt;img class="alignnone size-full wp-image-398" title="todo" src="http://icodeblog.com/wp-content/uploads/2008/09/todo.png" alt="" height="33" width="363" /&gt;&lt;/a&gt;&lt;/p&gt; &lt;p style="text-align: left;"&gt;So in addition to the &lt;strong&gt;insertNewTodoIntoDatabase&lt;/strong&gt; method, we also see the deleteFromDatabase method signature.  I have just added this so I don’t have to come back to it later.  We will be implementing this when I show you how to delete todos from the database.  One thing to note about the &lt;strong&gt;insertNewTodoIntoDatabase &lt;/strong&gt;method is it has a “+” rather than a “-” sign.  This means that it is a static method.  Static methods are associated with the class not the instance meaning we can call this method without instanciating this class.  So we can do stuff like Todo.insertNewTodoIntoDatabase.  Now we will implement this method.&lt;/p&gt; &lt;p style="text-align: left;"&gt;Before we can do this, we must declare a few more static sqlite3_statement’s.  Add the following statements to the top of &lt;strong&gt;Todo.m&lt;/strong&gt;&lt;/p&gt; &lt;p style="text-align: left;"&gt;&lt;a href="http://icodeblog.com/wp-content/uploads/2008/09/todomstatic.png"&gt;&lt;img class="size-full wp-image-400 aligncenter" title="todomstatic" src="http://icodeblog.com/wp-content/uploads/2008/09/todomstatic.png" alt="" height="30" width="270" /&gt;&lt;/a&gt;&lt;/p&gt; &lt;p style="text-align: left;"&gt;Nothing new here…Now implement the following method:&lt;/p&gt; &lt;p style="text-align: left;"&gt;&lt;a href="http://icodeblog.com/wp-content/uploads/2008/09/todom3.png"&gt;&lt;img style="width: 660px; height: 264px;" class="size-full wp-image-399 aligncenter" title="todom3" src="http://icodeblog.com/wp-content/uploads/2008/09/todom3.png" alt="" /&gt;&lt;/a&gt;&lt;/p&gt; &lt;p style="text-align: left;"&gt;This is similar to our update method.  Notice that we are inserting default values into the database.  This is so we don’t run into any problems with null or nil values.  The most important part of this method is the fact that it returns the primary key of the newly created todo object.  This will be used later so we can immediately transition to the todo when the “Add” button is pressed.  The last thing we need to do to the todo object is update the dehydrate method so that the todoText gets saved if it gets changed.  Update the dehydrate method to look like this:&lt;/p&gt; &lt;p style="text-align: left;"&gt;&lt;a href="http://icodeblog.com/wp-content/uploads/2008/09/dehydrate.png"&gt;&lt;img style="width: 616px; height: 319px;" class="size-full wp-image-401 aligncenter" title="dehydrate" src="http://icodeblog.com/wp-content/uploads/2008/09/dehydrate.png" alt="" /&gt;&lt;/a&gt;&lt;/p&gt; &lt;p style="text-align: left;"&gt;There are only a few minor changes here.  First we see the “text = ?” part added to the sql statement.  This is simply so we can update the text of the todo.  The other change is we bound the self.text property to the 1st question mark in the sql statement.  One thing to notice is we call [self.text UTF8String].  This is because sqlite3_bind_text takes a (char *).  This will convert an NSString to an acceptable format.&lt;/p&gt; &lt;p style="text-align: left;"&gt;Now we need to add a method inside of our RootViewController to add a todo.  This is the method that will be called when the user presses the “Add” button.  Inside of RootViewController.m add the following code:&lt;/p&gt; &lt;p&gt;&lt;a href="http://icodeblog.com/wp-content/uploads/2008/09/1-rootviewcontroller.png"&gt;&lt;img style="width: 622px; height: 225px;" class="size-full wp-image-422 aligncenter" title="1-rootviewcontroller" src="http://icodeblog.com/wp-content/uploads/2008/09/1-rootviewcontroller.png" alt="" /&gt;&lt;/a&gt;&lt;/p&gt; &lt;p style="text-align: left;"&gt;First, we get a reference to the appDelegate object.  This is because we need to call its addTodo method.  Next, we instantiate the TodoViewController if it has not already been instantiated.  We need this around because we will push it on to the view stack and transition to it after we create our new todo object.  After this is done, we call the addTodo method of the appDelegate.  It will return the newly created todo object and the view will be transitioned to its detail screen in order to update its details.  Now we need to implement the method addTodo inside of our appDelegate.  Open up todoAppDelegate.h and add the following code to create the method signature.&lt;/p&gt; &lt;p style="text-align: center;"&gt;&lt;a href="http://icodeblog.com/wp-content/uploads/2008/09/2-appdelegateh.png"&gt;&lt;img class="size-full wp-image-423 aligncenter" title="2-appdelegateh" src="http://icodeblog.com/wp-content/uploads/2008/09/2-appdelegateh.png" alt="" height="18" width="107" /&gt;&lt;/a&gt;&lt;/p&gt; &lt;p style="text-align: left;"&gt; &lt;/p&gt; &lt;p style="text-align: left;"&gt; &lt;/p&gt;&lt;p style="text-align: left;"&gt;Now, let’s implement this method.  Open up todoAppDelegate.m and add the following code:&lt;script type="text/javascript"&gt;ent = "pub-7921832321836192"; google_alternate_color = "FFFFFF"; google_ad_width = 234; google_ad_height = 60; google_ad_format = "234x60_as"; google_ad_type = "text_image"; google_ad_channel =""; google_color_border = "DFEDF6"; google_color_link = "262D36"; google_color_bg = "DFEDF6"; google_color_text = "0066CC"; google_color_url = "262D36"; google_ui_features = "rc:0"; //--&gt;&lt;/script&gt; &lt;script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js"&gt; &lt;/script&gt;&lt;script src="http://pagead2.googlesyndication.com/pagead/expansion_embed.js"&gt;&lt;/script&gt;&lt;script src="http://googleads.g.doubleclick.net/pagead/test_domain.js"&gt;&lt;/script&gt;&lt;script&gt;window.google_render_ad();&lt;/script&gt;&lt;ins style="border: medium none ; margin: 0pt; padding: 0pt; display: inline-table; height: 60px; position: relative; visibility: visible; width: 234px;"&gt;&lt;ins style="border: medium none ; margin: 0pt; padding: 0pt; display: block; height: 60px; position: relative; visibility: visible; width: 234px;"&gt;&lt;/ins&gt;&lt;/ins&gt;&lt;a href="http://icodeblog.com/wp-content/uploads/2008/09/3-appdelegatem.png"&gt;&lt;img style="width: 504px; height: 123px;" class="size-full wp-image-424 aligncenter" title="3-appdelegatem" src="http://icodeblog.com/wp-content/uploads/2008/09/3-appdelegatem.png" alt="" /&gt;&lt;/a&gt;&lt;/p&gt; &lt;p style="text-align: left;"&gt; &lt;/p&gt;&lt;p&gt;First, we are calling the insertNewTodoIntoDatabase method of the Todo object.  Notice that we are simply calling the method without first building an instance of a todo object.  As I said in tutorial 3, this is because that method is static and gets called without building an instance of the class.  Next, we insatiate the todo object that was just created by calling its initWithPrimaryKey method.  This will give us reference to the new todo object.  Finally, we append this todo to the end of our todos array.  Since our UITableView is updated with this array, it will automatically include the new todo object.  The last line just returns this todo object.&lt;/p&gt; &lt;p&gt;Remember is the last tutorial we made it so the users could update the status and the priority of a todo?  Well, now we also need to give them the ability to update the text of the todo.  So open up TodoViewController.h and add the following code:&lt;/p&gt; &lt;p style="text-align: center;"&gt; &lt;/p&gt;&lt;p&gt;&lt;a href="http://icodeblog.com/wp-content/uploads/2008/09/5-todoviewcontrollerh.png"&gt;&lt;img class="alignnone size-full wp-image-425" title="5-todoviewcontrollerh" src="http://icodeblog.com/wp-content/uploads/2008/09/5-todoviewcontrollerh.png" alt="" height="271" width="430" /&gt;&lt;/a&gt;&lt;a href="http://icodeblog.com/wp-content/uploads/2008/09/5-todoviewcontrollerh.png"&gt;&lt;br /&gt;&lt;/a&gt;&lt;/p&gt; &lt;p style="text-align: left;"&gt; &lt;/p&gt;&lt;p&gt;Ok, so I’m guessing you are wondering why the UITextView for the todoText object has been changed to a UITextField.  Well, I will tell you.  UITextView doesn’t have the methods that we need to save the text with our current design.  We will also be changing this on our Interface inside of Interface Builder.  So for now, just believe me and anywhere it says UITextView, change it to UITextField.  The only additional code we added here is the method signature for the updateText method.  It’s an IBAction that will get called when the user presses the “Done” button on the keyboard after setting the text for the todo.  Next, we need to implement this method.  Open up TodoViewController.m and add the following code:&lt;/p&gt; &lt;p style="text-align: center;"&gt;&lt;a href="http://icodeblog.com/wp-content/uploads/2008/09/5-todoviewcontrollerm.png"&gt;&lt;img class="size-full wp-image-426 aligncenter" title="5-todoviewcontrollerm" src="http://icodeblog.com/wp-content/uploads/2008/09/5-todoviewcontrollerm.png" alt="" height="53" width="245" /&gt;&lt;/a&gt;&lt;/p&gt; &lt;p style="text-align: left;"&gt;All this does is update the text of the todo to the text that the user entered inside of the UITextField.  The last thing we need to do in order to add a todo is to replace the UITextView with a UITextField and connect it to our updateText method.  Double click on your TodoViewController.xib file to open it in Interface Builder.&lt;/p&gt;  &lt;p style="text-align: center;"&gt;Now click on the UITextView on your interface and press the delete key on your keyboard to delete it.  Now, drag a UITextField from the library and drop it onto your interface.  Resize it to fit.  When you have completed that, your interface should look something like this:&lt;/p&gt;&lt;p style="text-align: left;"&gt;&lt;script type="text/javascript"&gt;- google_ad_client = "pub-7921832321836192"; google_alternate_color = "FFFFFF"; google_ad_width = 234; google_ad_height = 60; google_ad_format = "234x60_as"; google_ad_type = "text_image"; google_ad_channel =""; google_color_border = "DFEDF6"; google_color_link = "262D36"; google_color_bg = "DFEDF6"; google_color_text = "0066CC"; google_color_url = "262D36"; google_ui_features = "rc:0"; //--&gt;&lt;/script&gt; &lt;script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js"&gt; &lt;/script&gt;&lt;script&gt;window.google_render_ad();&lt;/script&gt;&lt;ins style="border: medium none ; margin: 0pt; padding: 0pt; display: inline-table; height: 60px; position: relative; visibility: visible; width: 234px;"&gt;&lt;ins style="border: medium none ; margin: 0pt; padding: 0pt; display: block; height: 60px; position: relative; visibility: visible; width: 234px;"&gt;&lt;/ins&gt;&lt;/ins&gt;&lt;a href="http://icodeblog.com/wp-content/uploads/2008/09/6-interfacebuilder.png"&gt;&lt;img style="width: 253px; height: 395px;" class="size-full wp-image-427 aligncenter" title="6-interfacebuilder" src="http://icodeblog.com/wp-content/uploads/2008/09/6-interfacebuilder.png" alt="" /&gt;&lt;/a&gt;&lt;/p&gt; &lt;p style="text-align: left;"&gt;Now we need to connect this component.  Make sure it is selected and click Tools -&gt; Connections Inspector to open up the connections inspector.  Drag from the circle next to the method “Did End On Exit” to the “File’s Owner” object.  The words udpateText should pop up.  Click on them to make the connection.  Next, click in the circle next to “New Referencing Outlet” and drag it to the “File’s Owner” object.  Select todoText  when it pops up.  The Connections Inspector should look like this:&lt;/p&gt; &lt;p style="text-align: left;"&gt;&lt;a href="http://icodeblog.com/wp-content/uploads/2008/09/12-ib.png"&gt;&lt;img class="size-full wp-image-434 aligncenter" title="12-ib" src="http://icodeblog.com/wp-content/uploads/2008/09/12-ib.png" alt="" height="708" width="287" /&gt;&lt;/a&gt;&lt;/p&gt; &lt;p&gt;Now we are done with Interface Builder.  Go ahead and close it.  We are now able to add todos.  The last thing we need to do is give the ability to delete todos from the list as well as our database.  This is all done in code, and we won’t need interface builder for this.&lt;/p&gt; &lt;p&gt;Let’s start by adding the methods to the appDelegate to handle the deletion of todos.  Open up todoAppDelegate.h and add the following code:&lt;/p&gt; &lt;p style="text-align: left;"&gt;&lt;a href="http://icodeblog.com/wp-content/uploads/2008/09/7-appdelegateh.png"&gt;&lt;img class="alignnone size-full wp-image-428" title="7-appdelegateh" src="http://icodeblog.com/wp-content/uploads/2008/09/7-appdelegateh.png" alt="" height="16" width="194" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p style="text-align: left;"&gt;All we see here is a signature for the removeTodo method.  Also, be sure to add a #import “Todo.h” statement to the top of this file so that we can interface with the todo objects. Now let’s implement the removeTodo method.  Open up todoAppDelegate.m and add the following code:&lt;ins style="border: medium none ; margin: 0pt; padding: 0pt; display: inline-table; height: 60px; position: relative; visibility: visible; width: 468px;"&gt;&lt;/ins&gt;&lt;a href="http://icodeblog.com/wp-content/uploads/2008/09/8-appdelegatem.png"&gt;&lt;img class="size-full wp-image-429 aligncenter" title="8-appdelegatem" src="http://icodeblog.com/wp-content/uploads/2008/09/8-appdelegatem.png" alt="" height="119" width="308" /&gt;&lt;/a&gt;&lt;/p&gt; &lt;p style="text-align: left;"&gt;The first line looks up the todo in the todos NSArray.  It returns the index in the array of the todo to be deleted.  Then, we call the deleteFromDatabase method on the todo object and then remove it from the todos array.  Since the UITableView is updated via this array, it will automatically remove the todo without any additional code on our part.&lt;/p&gt; &lt;p&gt;Now, let’s create the removeTodo method for the todo object. We have already written the method signature in Todo.h in a previous step, so open up Todo.m and add the following code:&lt;/p&gt; &lt;p style="text-align: left;"&gt;&lt;a href="http://icodeblog.com/wp-content/uploads/2008/09/10-todom.png"&gt;&lt;img style="width: 582px; height: 214px;" class="size-full wp-image-431 aligncenter" title="10-todom" src="http://icodeblog.com/wp-content/uploads/2008/09/10-todom.png" alt="" /&gt;&lt;/a&gt;&lt;/p&gt; &lt;p style="text-align: left;"&gt;Remember the delete_statement variable is a static sqlite3_stmt that we declared in a previous step.  First, we check to see if it is nil.  If it is we compile the statement using the sqlite3_prepare statement.  Next, we bind the primary key of the current todo to the “?” in the sqlite3 statement.  Next, we just step the statement to execute it and reset it.  The last thing we need to do to delete todos from the database is to specify what happens when the user presses the “delete” button.  Open up RootViewController.m and add the following code:&lt;/p&gt; &lt;p style="text-align: left;"&gt;&lt;a href="http://icodeblog.com/wp-content/uploads/2008/09/11-rootviewcontroller1.png"&gt;&lt;img style="width: 591px; height: 173px;" class="size-full wp-image-432 aligncenter" title="11-rootviewcontroller1" src="http://icodeblog.com/wp-content/uploads/2008/09/11-rootviewcontroller1.png" alt="" /&gt;&lt;/a&gt;&lt;/p&gt; &lt;p style="text-align: left;"&gt; &lt;/p&gt;&lt;p style="text-align: left;"&gt;The first step (like the first step of many functions) is to get a reference to the appDelegate.  Next, we check to see if we are currently editing.  If so, call the removeTodo method on appDelegate.  The next line, removes the row from the UITableView at the given indexPath.&lt;/p&gt; &lt;p&gt;Now click Build and Go!  You should now be able to add and delete todo items from the database.  This concludes our four part series of creating a todo list for the iPhone.  As always, if you have any questions feel free to leave them in the comments section.  If you get lost at any time you can download the sample code &lt;a href="http://icodeblog.com/wp-content/uploads/2008/09/todo-part-4.zip"&gt;here&lt;/a&gt;.&lt;/p&gt; &lt;p&gt;Happy iCoding!&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7660917028131688558-931442792577953860?l=jainmarket.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://jainmarket.blogspot.com/feeds/931442792577953860/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7660917028131688558&amp;postID=931442792577953860' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7660917028131688558/posts/default/931442792577953860'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7660917028131688558/posts/default/931442792577953860'/><link rel='alternate' type='text/html' href='http://jainmarket.blogspot.com/2009/05/creating-todo-list-using-sqlite-part-4.html' title='Creating a ToDo List Using SQLite Part 4'/><author><name>Rahul Vyas</name><uri>http://www.blogger.com/profile/08326955903115378266</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://bp1.blogger.com/_6C_XpG63jYw/SAgrxtkt56I/AAAAAAAAACc/pr7-vuTQS5w/S220/P1170634+(Small).JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7660917028131688558.post-1650963885705278748</id><published>2009-05-14T19:43:00.000+05:30</published><updated>2009-05-14T19:46:56.112+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='IPHONE'/><title type='text'>Creating a ToDo List Using SQLite Part 3</title><content type='html'>&lt;p style="text-align: left;"&gt;This is part 3 in our multipart series of creating a todo list for the iPhone.  For this, you must have completed the following tutorials.&lt;/p&gt; &lt;ul&gt;&lt;li&gt;&lt;a title="Permanent Link to iPhone Programming Tutorial - Creating a ToDo List Using SQLite Part 1" rel="bookmark" href="http://icodeblog.com/2008/08/19/iphone-programming-tutorial-creating-a-todo-list-using-sqlite-part-1/"&gt;iPhone Programming Tutorial - Creating a ToDo List Using SQLite Part 1&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a title="Permanent Link to iPhone Programming Tutorial - Creating a ToDo List Using SQLite Part 1" rel="bookmark" href="http://icodeblog.com/2008/09/02/iphone-programming-tutorial-creating-a-todo-list-using-sqlite-part-2/"&gt;iPhone Programming Tutorial - Creating a ToDo List Using SQLite Part 2&lt;/a&gt;&lt;/li&gt;&lt;/ul&gt; &lt;p&gt;The focus of this tutorial will mainly be on viewing the todo items when selected.  I will also show you how to update the todo status.  This will require us to use interface builder.  When you are completed, you will be able to edit todos through an interface similar to this:&lt;/p&gt; &lt;p style="text-align: center;"&gt;&lt;a href="http://icodeblog.com/wp-content/uploads/2008/09/screenshot1.png"&gt;&lt;img style="width: 316px; height: 604px;" class="size-full wp-image-390 aligncenter" title="screenshot1" src="http://icodeblog.com/wp-content/uploads/2008/09/screenshot1.png" alt="" /&gt;&lt;/a&gt;&lt;/p&gt; &lt;h2&gt;Bringing Your Code Up To Speed&lt;/h2&gt; &lt;p&gt;For this tutorial, we will need to get the last variable from the todo database.  This is of course being the status variable.  If you recall, it’s a boolean value (1 for complete, 0 for in progress).  We need to get it from the database and associate it with the todo object.  First let’s create a property to hold this value.  Open todo.h and add the following code:&lt;/p&gt; &lt;p style="text-align: center;"&gt;&lt;a href="http://icodeblog.com/wp-content/uploads/2008/09/todoh1.png"&gt;&lt;img class="alignnone size-full wp-image-370" title="todoh1" src="http://icodeblog.com/wp-content/uploads/2008/09/todoh1.png" alt="" height="329" width="393" /&gt;&lt;/a&gt;&lt;/p&gt; &lt;p style="text-align: left;"&gt;So a few changes here…First there is the added NSInteger status.  This will be the property we associate with the status (complete or not) of the todo.  We also create a property from it.  Next, there is a BOOL property called “dirty”.  We will use this object to signify when a todo has been altered.  You will see how this comes into play when we implement the dehydrate method. Also, I have added 3 method signatures.  updateStatus will be the method called when we want to update our status variable.  Similarly, the updatePriority method will be called to update the priority.  Finally, we have added a dehydrate method.  This method should be familiar (or confusing) if you have messed with Apple’s books example.  Basically, it will be used to save the state of the todo to the database.  We will be calling this method on each todo item when the program exits.  I will show you how to do this in a little bit.&lt;/p&gt; &lt;p style="text-align: left;"&gt;Be sure to add the status variable to the synthesize line.  Also, as we did before, we need to create a static sqlite3_stmt to hold the compiled dehydration statement.  Add the following code to Todo.m:&lt;/p&gt; &lt;p style="text-align: center;"&gt;&lt;a href="http://icodeblog.com/wp-content/uploads/2008/09/synth1.png"&gt;&lt;img class="alignnone size-full wp-image-382" title="synth1" src="http://icodeblog.com/wp-content/uploads/2008/09/synth1.png" alt="" height="74" width="280" /&gt;&lt;/a&gt;&lt;/p&gt; &lt;p style="text-align: left;"&gt;Now let’s implement the methods.  Add the following code:&lt;/p&gt; &lt;p style="text-align: center;"&gt;&lt;a href="http://icodeblog.com/wp-content/uploads/2008/09/todom2.png"&gt;&lt;img style="width: 646px; height: 418px;" class="size-full wp-image-371 aligncenter" title="todom2" src="http://icodeblog.com/wp-content/uploads/2008/09/todom2.png" alt="" /&gt;&lt;/a&gt;&lt;/p&gt; &lt;p style="text-align: left;"&gt;The first two methods (udpateStatus and updatePriority) are pretty strait forward.  They update the status and the priority of the todo and then set the “dirty” property to 1.  This signifies that the todo has been altered and will need to be saved to the database.&lt;/p&gt; &lt;p style="text-align: left;"&gt;Finally, there is the dehydrate method… We will call this method on each todo upon termination of the program.  If the todo is “dirty” meaning the dirty property was set to YES, we will need to save the new data to the database.  The database code should look pretty similar to code in previous tutorials.  First, we check to see if the dehydrate_statement is equal to nil.  If you recall, this will only happen the first time this method gets called.  Next we create the update statement and then bind our variables to each of the “?”’s.  Notice the ordering.  The numbers represent the question marks from left to right (1 being the first, 2 being the second, 3 being the third).  It took me quite some time to figure this out.  Finally, we execute the sqlite statement by calling sqlite3_step and then reset the statement.&lt;/p&gt; &lt;p style="text-align: left;"&gt;The last thing we need to do to Todo.m is change the SELECT statement in the initWithPrimaryKey method to grab the ‘complete’ field.  Update the code to look like the screenshot below:&lt;/p&gt; &lt;p style="text-align: center;"&gt;&lt;a href="http://icodeblog.com/wp-content/uploads/2008/09/00-todom.png"&gt;&lt;img style="width: 641px; height: 382px;" class="size-full wp-image-357 aligncenter" title="00-todom" src="http://icodeblog.com/wp-content/uploads/2008/09/00-todom.png" alt="" /&gt;&lt;/a&gt;&lt;/p&gt; &lt;p style="text-align: left;"&gt;There are not really many changes.  The first change is the added status to the synthesize line.  Next, the sql statement was updated to read&lt;/p&gt; &lt;p style="text-align: left;"&gt;SELECT text,priority,complete FROM todo WHERE pk=?&lt;/p&gt; &lt;p style="text-align: left;"&gt;This allows us to get the “complete” field from the database.  Finally, there is the line “self.status = sqlite3_column_in(init_statement,2);”.  This is assigning the status property to the data at index 2 in the sql data array.  We can now use this field.&lt;/p&gt; &lt;p style="text-align: left;"&gt;One thing we need to do for the navigation to function properly is add a title to our main view.  Open up rootViewController.m and add the following code to the viewDidLoad method:&lt;/p&gt; &lt;p style="text-align: center;"&gt;&lt;a href="http://icodeblog.com/wp-content/uploads/2008/09/title.png"&gt;&lt;img class="alignnone size-full wp-image-381" title="title" src="http://icodeblog.com/wp-content/uploads/2008/09/title.png" alt="" height="16" width="175" /&gt;&lt;/a&gt;&lt;/p&gt; &lt;h2&gt;Create the Todo Detail View&lt;/h2&gt; &lt;p&gt;Now we are going to create the view that will display when the user selects the todo in the UITableView.  Go ahead and open up Interface Builder by selecting one of you existing nib (.xib) files.  Once it’s open add a new View by clicking &lt;strong&gt;File -&gt; New&lt;/strong&gt; and select &lt;strong&gt;View.&lt;/strong&gt; Drag the following controls.&lt;/p&gt; &lt;ul&gt;&lt;li&gt;UITextView&lt;/li&gt;&lt;li&gt;UISegmentedControl - For this you will need to set the number of segments to 3.  You will also see a dropdown menu below this option.  Select each segment and fill in one of the priorities for the title.  Here is a screenshot. You should give a title to each (Low , Medium, High). &lt;p style="text-align: center;"&gt;&lt;a href="http://icodeblog.com/wp-content/uploads/2008/09/segmented-control.png"&gt;&lt;img class="alignnone size-full wp-image-340" title="segmented-control" src="http://icodeblog.com/wp-content/uploads/2008/09/segmented-control.png" alt="" height="708" width="287" /&gt;&lt;/a&gt;&lt;/p&gt; &lt;/li&gt;&lt;li&gt;UILabel - This will be used to display the status&lt;/li&gt;&lt;li&gt;UIButton - Users will click this button to update the status (Mark as complete)&lt;/li&gt;&lt;/ul&gt; &lt;div style="margin: 15px; text-align: center;"&gt;&lt;div class="advertisement-box"&gt; &lt;script type="text/javascript"&gt;&lt;!-- google_ad_client = "pub-7921832321836192"; google_alternate_color = "FFFFFF"; google_ad_width = 234; google_ad_height = 60; google_ad_format = "234x60_as"; google_ad_type = "text_image"; google_ad_channel =""; google_color_border = "DFEDF6"; google_color_link = "262D36"; google_color_bg = "DFEDF6"; google_color_text = "0066CC"; google_color_url = "262D36"; google_ui_features = "rc:0"; //--&gt;&lt;/script&gt; &lt;script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js"&gt; &lt;/script&gt;&lt;script src="http://pagead2.googlesyndication.com/pagead/expansion_embed.js"&gt;&lt;/script&gt;&lt;script src="http://googleads.g.doubleclick.net/pagead/test_domain.js"&gt;&lt;/script&gt;&lt;script&gt;window.google_render_ad();&lt;/script&gt;&lt;ins style="border: medium none ; margin: 0pt; padding: 0pt; display: inline-table; height: 60px; position: relative; visibility: visible; width: 234px;"&gt;&lt;ins style="border: medium none ; margin: 0pt; padding: 0pt; display: block; height: 60px; position: relative; visibility: visible; width: 234px;"&gt;&lt;iframe allowtransparency="true" hspace="0" id="google_ads_frame1" marginheight="0" marginwidth="0" name="google_ads_frame" src="http://googleads.g.doubleclick.net/pagead/ads?client=ca-pub-7921832321836192&amp;amp;dt=1242305975437&amp;amp;lmt=1242305958&amp;amp;alt_color=FFFFFF&amp;amp;format=234x60_as&amp;amp;output=html&amp;amp;correlator=1242305975437&amp;amp;url=http%3A%2F%2Ficodeblog.com%2F2008%2F09%2F10%2Fiphone-programming-tutorial-creating-a-todo-list-using-sqlite-part-3%2F&amp;amp;color_bg=DFEDF6&amp;amp;color_text=0066CC&amp;amp;color_link=262D36&amp;amp;color_url=262D36&amp;amp;color_border=DFEDF6&amp;amp;ad_type=text_image&amp;amp;ref=http%3A%2F%2Ficodeblog.com%2F2008%2F08%2F19%2Fiphone-programming-tutorial-creating-a-todo-list-using-sqlite-part-1%2F&amp;amp;frm=0&amp;amp;ui=rc%3A0&amp;amp;ga_vid=1791180195.1242219149&amp;amp;ga_sid=1242304596&amp;amp;ga_hid=264680607&amp;amp;ga_fc=true&amp;amp;flash=9.0.124&amp;amp;w=234&amp;amp;h=60&amp;amp;u_h=768&amp;amp;u_w=1024&amp;amp;u_ah=742&amp;amp;u_aw=1024&amp;amp;u_cd=24&amp;amp;u_tz=330&amp;amp;u_his=1&amp;amp;u_java=true&amp;amp;u_nplug=4&amp;amp;u_nmime=80&amp;amp;dtd=113&amp;amp;w=234&amp;amp;h=60&amp;amp;xpc=FkqosrqpVu&amp;amp;p=http%3A//icodeblog.com" style="left: 0pt; position: absolute; top: 0pt;" vspace="0" frameborder="0" height="60" scrolling="no" width="234"&gt;&lt;/iframe&gt;&lt;/ins&gt;&lt;/ins&gt;&lt;/div&gt;&lt;/div&gt;&lt;p&gt;When you are done, your interface should look something like this (but probably better):&lt;/p&gt; &lt;p style="text-align: center;"&gt;&lt;a href="http://icodeblog.com/wp-content/uploads/2008/09/ibscreenshot.png"&gt;&lt;img class="alignnone size-full wp-image-369" title="ibscreenshot" src="http://icodeblog.com/wp-content/uploads/2008/09/ibscreenshot.png" alt="" height="502" width="320" /&gt;&lt;/a&gt;&lt;/p&gt; &lt;p style="text-align: left;"&gt;I know that my interface doesn’t look the coolest.  I’m a programmer not a graphic designer… Ok save this view by pressing Command-S.  Make sure you are in your current projects directory.  Name it &lt;strong&gt;TodoViewController&lt;/strong&gt; and press Save&lt;strong&gt;. &lt;/strong&gt;&lt;/p&gt; &lt;p style="text-align: center;"&gt;&lt;a href="http://icodeblog.com/wp-content/uploads/2008/09/2-save.png"&gt;&lt;img class="size-full wp-image-343 aligncenter" title="2-save" src="http://icodeblog.com/wp-content/uploads/2008/09/2-save.png" alt="" height="392" width="500" /&gt;&lt;/a&gt;&lt;/p&gt; &lt;p style="text-align: left;"&gt;It will then ask you if you want to add it to your project. Check the box next to the word todo and click Add.&lt;/p&gt; &lt;p style="text-align: center;"&gt;&lt;a href="http://icodeblog.com/wp-content/uploads/2008/09/3-save.png"&gt;&lt;img class="alignnone size-full wp-image-344" title="3-save" src="http://icodeblog.com/wp-content/uploads/2008/09/3-save.png" alt="" height="290" width="431" /&gt;&lt;/a&gt;&lt;/p&gt; &lt;p style="text-align: left;"&gt;Now close Interface Builder.  Next, we are going to add the viewController class and set up variables to interface with this view.&lt;/p&gt; &lt;h2 style="text-align: left;"&gt;Create TodoViewController Class Files&lt;/h2&gt; &lt;p&gt;Click &lt;strong&gt;File -&gt; New File…&lt;/strong&gt; Select &lt;strong&gt;UIViewController Subclass&lt;/strong&gt; and click Next.&lt;/p&gt; &lt;div style="margin: 15px; text-align: center;"&gt;&lt;div class="advertisement-box"&gt; &lt;script type="text/javascript"&gt;&lt;!-- google_ad_client = "pub-7921832321836192"; google_alternate_color = "FFFFFF"; google_ad_width = 468; google_ad_height = 60; google_ad_format = "468x60_as"; google_ad_type = "text_image"; google_ad_channel =""; google_color_border = "DFEDF6"; google_color_link = "262D36"; google_color_bg = "DFEDF6"; google_color_text = "0066CC"; google_color_url = "262D36"; google_ui_features = "rc:0"; //--&gt;&lt;/script&gt; &lt;script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js"&gt; &lt;/script&gt;&lt;script&gt;window.google_render_ad();&lt;/script&gt;&lt;ins style="border: medium none ; margin: 0pt; padding: 0pt; display: inline-table; height: 60px; position: relative; visibility: visible; width: 468px;"&gt;&lt;ins style="border: medium none ; margin: 0pt; padding: 0pt; display: block; height: 60px; position: relative; visibility: visible; width: 468px;"&gt;&lt;iframe allowtransparency="true" hspace="0" id="google_ads_frame2" marginheight="0" marginwidth="0" name="google_ads_frame" src="http://googleads.g.doubleclick.net/pagead/ads?client=ca-pub-7921832321836192&amp;amp;dt=1242305975577&amp;amp;lmt=1242305958&amp;amp;alt_color=FFFFFF&amp;amp;prev_fmts=234x60_as&amp;amp;format=468x60_as&amp;amp;output=html&amp;amp;correlator=1242305975437&amp;amp;url=http%3A%2F%2Ficodeblog.com%2F2008%2F09%2F10%2Fiphone-programming-tutorial-creating-a-todo-list-using-sqlite-part-3%2F&amp;amp;color_bg=DFEDF6&amp;amp;color_text=0066CC&amp;amp;color_link=262D36&amp;amp;color_url=262D36&amp;amp;color_border=DFEDF6&amp;amp;ad_type=text_image&amp;amp;ref=http%3A%2F%2Ficodeblog.com%2F2008%2F08%2F19%2Fiphone-programming-tutorial-creating-a-todo-list-using-sqlite-part-1%2F&amp;amp;frm=0&amp;amp;ui=rc%3A0&amp;amp;ga_vid=1791180195.1242219149&amp;amp;ga_sid=1242304596&amp;amp;ga_hid=264680607&amp;amp;ga_fc=true&amp;amp;flash=9.0.124&amp;amp;w=468&amp;amp;h=60&amp;amp;u_h=768&amp;amp;u_w=1024&amp;amp;u_ah=742&amp;amp;u_aw=1024&amp;amp;u_cd=24&amp;amp;u_tz=330&amp;amp;u_his=1&amp;amp;u_java=true&amp;amp;u_nplug=4&amp;amp;u_nmime=80&amp;amp;dtd=4&amp;amp;w=468&amp;amp;h=60&amp;amp;xpc=SSUvkVikCJ&amp;amp;p=http%3A//icodeblog.com" style="left: 0pt; position: absolute; top: 0pt;" vspace="0" frameborder="0" height="60" scrolling="no" width="468"&gt;&lt;/iframe&gt;&lt;/ins&gt;&lt;/ins&gt;&lt;/div&gt;&lt;/div&gt;&lt;p style="text-align: center;"&gt;&lt;a href="http://icodeblog.com/wp-content/uploads/2008/08/14addviewcontrollerclass.png"&gt;&lt;img class="size-full wp-image-212 aligncenter" title="14addviewcontrollerclass" src="http://icodeblog.com/wp-content/uploads/2008/08/14addviewcontrollerclass.png" alt="" height="368" width="500" /&gt;&lt;/a&gt;&lt;/p&gt; &lt;p style="text-align: left;"&gt;Name the file &lt;strong&gt;TodoViewController&lt;/strong&gt; and make sure that the box that says “Also create TodoViewController.h” is checked and click Finish.&lt;/p&gt; &lt;p style="text-align: center;"&gt;&lt;a href="http://icodeblog.com/wp-content/uploads/2008/09/4-viewcontroller.png"&gt;&lt;img class="size-full wp-image-345 aligncenter" title="4-viewcontroller" src="http://icodeblog.com/wp-content/uploads/2008/09/4-viewcontroller.png" alt="" height="368" width="500" /&gt;&lt;/a&gt;&lt;/p&gt; &lt;p style="text-align: left;"&gt;Open up TodoViewController.h and add the following code.&lt;/p&gt; &lt;p style="text-align: center;"&gt;&lt;a href="http://icodeblog.com/wp-content/uploads/2008/09/04-todoviewcontroller.png"&gt;&lt;img class="alignnone size-full wp-image-359" title="04-todoviewcontroller" src="http://icodeblog.com/wp-content/uploads/2008/09/04-todoviewcontroller.png" alt="" height="300" width="430" /&gt;&lt;/a&gt;&lt;/p&gt; &lt;p style="text-align: left;"&gt;Basically, we are setting up Interface Builder Outlets for each of the UI components to be connected to.  Notice, the UIButton has an IBOutlet.  This is because we will need to update the text on the button depending on whether or not the todo is completed.  Also, I have an IBAction called updateStatus.  We will be connecting this to the button we created.  It will toggle the status (pending/complete) of a todo item.  Finally, we see the updatePriority method.  This method will be called when the user selects one of the priority segments in the UISegmentedControl. Next, open up TodoViewController.m and add the following synthesize code:&lt;/p&gt; &lt;p style="text-align: center;"&gt;&lt;a href="http://icodeblog.com/wp-content/uploads/2008/09/synthtodoviewcontroller1.png"&gt;&lt;img class="alignnone size-full wp-image-364" title="synthtodoviewcontroller1" src="http://icodeblog.com/wp-content/uploads/2008/09/synthtodoviewcontroller1.png" alt="" height="22" width="374" /&gt;&lt;/a&gt;&lt;/p&gt; &lt;p style="text-align: left;"&gt;This will allow us to get and set these variables.&lt;/p&gt; &lt;p style="text-align: left;"&gt;Before we connect this code to the Interface, we need to implement the methods that will be called when the user presses the button to mark a todo as complete as well as when the user presses a segment in the UISegmentedControl.  Inside of TodoViewController add the following methods.&lt;/p&gt; &lt;p style="text-align: center;"&gt;&lt;a href="http://icodeblog.com/wp-content/uploads/2008/09/todoviewcontrollerm.png"&gt;&lt;img style="width: 614px; height: 263px;" class="size-full wp-image-368 aligncenter" title="todoviewcontrollerm" src="http://icodeblog.com/wp-content/uploads/2008/09/todoviewcontrollerm.png" alt="" /&gt;&lt;/a&gt;&lt;/p&gt; &lt;p style="text-align: left;"&gt;Let’s go through this.  First we see the updateStatus method.  This gets called when a user presses the button to alter the status.  We basically check the current status of the todo (whether or not it’s completed) and depending on that, change the text to be displayed on the UIButton.  So, if the todo is not complete (in progress) and this button is pressed, the text will be changed from “Mark As Complete” to “Mark As In Progress”.  Finally, we call the updateStatus of the todo and pass the new value (1 or 0) to it.&lt;/p&gt; &lt;p style="text-align: left;"&gt;Next we see the updatePriority method.  It simply reads the value of the UISegmentedControl by calling the selectedSegmentIndex method on it.  The next part looks a little messy.   There are 2 reasons that reason we can’t just pass the value of the UISegmentedControl directly to the method.  The first is, the UISegmentedControl is ordered in acending order (1, 2, 3…), but our priorities are in descending order (3 = low, 2 = medium, 1 = high).  This is where the “2 - priority” comes from.  Next, UISegmented controls are “0 indexed” meaning the indices start at 0 and increment from there.  So we need to add a “+1″ to the index as our todo priorities start at 1.&lt;/p&gt; &lt;p style="text-align: left;"&gt;Now we need to connect the UI Components in Interface Builder to this code.  Double click on TodoViewController.xib to open it in Interface Builder.&lt;/p&gt; &lt;h2 style="text-align: left;"&gt;Connecting UI Components To Code&lt;/h2&gt; &lt;p&gt;We first need to associate this view with the class we just created.  In the Interface Builder, click on the File’s Owner object.  Next click &lt;strong&gt;Tools -&gt; Identity Inspector&lt;/strong&gt;.  You should see a drop-down next to class.  Select TodoViewController from this list and you will see the variables we just created appear in the boxes below.&lt;/p&gt; &lt;p style="text-align: center;"&gt;&lt;a href="http://icodeblog.com/wp-content/uploads/2008/09/07-files-owner.png"&gt;&lt;img class="size-full wp-image-349 aligncenter" title="07-files-owner" src="http://icodeblog.com/wp-content/uploads/2008/09/07-files-owner.png" alt="" height="287" width="305" /&gt;&lt;/a&gt;&lt;/p&gt; &lt;p style="text-align: left;"&gt;This is what the Identity window should look like after you have selected TodoViewController.&lt;/p&gt; &lt;p style="text-align: center;"&gt;&lt;a href="http://icodeblog.com/wp-content/uploads/2008/09/todoviewcontrollerfilesowner.png"&gt;&lt;img class="alignnone size-full wp-image-380" title="todoviewcontrollerfilesowner" src="http://icodeblog.com/wp-content/uploads/2008/09/todoviewcontrollerfilesowner.png" alt="" height="708" width="287" /&gt;&lt;/a&gt;&lt;/p&gt; &lt;p style="text-align: left;"&gt;Now that the class is associated, we can begin connecting the components.  We will start by connecting the view.  Click on the top of your view window to select the view itself (make sure you haven’t selected any of the UI components).  Click &lt;strong&gt;Tools -&gt; Connections Inspector&lt;/strong&gt;.  Next to where is says “New Referencing Outlet” click in the circle and drag it to the “File’s Owner” object and release it.  The word “view” should pop up.  Click on the word view.  It should now look like this.&lt;/p&gt; &lt;p style="text-align: center;"&gt;&lt;a href="http://icodeblog.com/wp-content/uploads/2008/09/08-view-connect.png"&gt;&lt;img class="size-full wp-image-350 aligncenter" title="08-view-connect" src="http://icodeblog.com/wp-content/uploads/2008/09/08-view-connect.png" alt="" height="708" width="287" /&gt;&lt;/a&gt;&lt;/p&gt; &lt;p style="text-align: left;"&gt;Now repeat these steps for each of the components (UITextView, UISegmentedControl, UILabel, UIButton) connecting each to the “File’s Owner Object”.   Instead of the word “view” popping up, you should see the variable name for the corresponding variable that you want to connect the component to.   So for the UITextView, you should see the word “todoText” appear when you drag it to the File’s Owner object.&lt;/p&gt; &lt;p style="text-align: left;"&gt;We need to connect the UIButton to the updateStatus method we created.  To do this click inside the “Touch up inside” circle and drag it to the “File’s Owner” object.  You should see the text “updateStatus” appear.  Click on it.  If all goes well it should look like this.&lt;/p&gt; &lt;p style="text-align: center;"&gt;&lt;a href="http://icodeblog.com/wp-content/uploads/2008/09/uibutton1.png"&gt;&lt;img class="alignnone size-full wp-image-362" title="uibutton1" src="http://icodeblog.com/wp-content/uploads/2008/09/uibutton1.png" alt="" height="708" width="287" /&gt;&lt;/a&gt;&lt;/p&gt; &lt;p style="text-align: left;"&gt;The last thing we need to do inside of Interface Builder is connect the UISegmentedControl.  Click on it in your view and then click &lt;strong&gt;Tools -&gt; Connections Inspector…&lt;/strong&gt; Click on the circle next to the “Value Changed” method and drag it to the “File’s Owner” object.  You will see the method updatePriority popup.  Go ahead and click on it.  Your window for the UISegmentedControl should now look like this:&lt;/p&gt; &lt;p style="text-align: center;"&gt;&lt;a href="http://icodeblog.com/wp-content/uploads/2008/09/uisegementedcontrol1.png"&gt;&lt;img class="alignnone size-full wp-image-366" title="uisegementedcontrol1" src="http://icodeblog.com/wp-content/uploads/2008/09/uisegementedcontrol1.png" alt="" height="708" width="287" /&gt;&lt;/a&gt;&lt;/p&gt; &lt;p style="text-align: left;"&gt;Now, let’s display this view when a row is selected.  Close Interface Builder and open up RootViewController.h and add the following code:&lt;/p&gt; &lt;p style="text-align: center;"&gt;&lt;a href="http://icodeblog.com/wp-content/uploads/2008/09/11-rootviewcontroller.png"&gt;&lt;img class="size-full wp-image-354 aligncenter" title="11-rootviewcontroller" src="http://icodeblog.com/wp-content/uploads/2008/09/11-rootviewcontroller.png" alt="" height="149" width="352" /&gt;&lt;/a&gt;&lt;/p&gt; &lt;p style="text-align: left;"&gt;We need a variable to associate with the TodoViewController that we will be transitioning to.  Next, open up RootViewController.m and add the following code to synthesize this property.&lt;/p&gt; &lt;p style="text-align: center;"&gt;&lt;a href="http://icodeblog.com/wp-content/uploads/2008/09/12-synth.png"&gt;&lt;img class="size-full wp-image-355 aligncenter" title="12-synth" src="http://icodeblog.com/wp-content/uploads/2008/09/12-synth.png" alt="" height="21" width="133" /&gt;&lt;/a&gt;&lt;/p&gt; &lt;h2 style="text-align: left;"&gt;Keeping the UITableView Up To Date&lt;/h2&gt; &lt;div style="margin: 15px; text-align: center;"&gt;&lt;div class="advertisement-box"&gt; &lt;script type="text/javascript"&gt;&lt;!-- google_ad_client = "pub-7921832321836192"; google_alternate_color = "FFFFFF"; google_ad_width = 468; google_ad_height = 60; google_ad_format = "468x60_as"; google_ad_type = "text_image"; google_ad_channel =""; google_color_border = "DFEDF6"; google_color_link = "262D36"; google_color_bg = "DFEDF6"; google_color_text = "0066CC"; google_color_url = "262D36"; google_ui_features = "rc:0"; //--&gt;&lt;/script&gt; &lt;script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js"&gt; &lt;/script&gt;&lt;script&gt;window.google_render_ad();&lt;/script&gt;Whenever a todo item is altered (status or priority) the UITableView needs to be updated with the new changes.  Add the following code to the viewWillAppear.&lt;/div&gt;&lt;/div&gt; &lt;p style="text-align: center;"&gt;&lt;a href="http://icodeblog.com/wp-content/uploads/2008/09/rootviewcontrollermwillapprea.png"&gt;&lt;img class="size-full wp-image-372 aligncenter" title="rootviewcontrollermwillapprea" src="http://icodeblog.com/wp-content/uploads/2008/09/rootviewcontrollermwillapprea.png" alt="" height="65" width="246" /&gt;&lt;/a&gt;&lt;/p&gt; &lt;p style="text-align: left;"&gt;The line [self.tableView reloadData] reloads the table data every time the view appears (or reappears).  This will ensure that our table is always up to date.&lt;/p&gt; &lt;p style="text-align: left;"&gt;Now add the following code to the didSelectRowAtIndex method:&lt;/p&gt; &lt;p style="text-align: center;"&gt;&lt;a href="http://icodeblog.com/wp-content/uploads/2008/09/didselectrowatindex.png"&gt;&lt;img style="width: 635px; height: 377px;" class="size-full wp-image-373 aligncenter" title="didselectrowatindex" src="http://icodeblog.com/wp-content/uploads/2008/09/didselectrowatindex.png" alt="" /&gt;&lt;/a&gt;&lt;/p&gt; &lt;p style="text-align: left;"&gt;This is quite a bulky method with a lot of familiar code.  First, we get a handle to the appDelegate and the todo object that was selected.  Next, we push the todoView (the view you created in interface builder) on to the viewController stack to transition to it.  After that, we are setting some of the properties of the view.  The title is set to the text of the todo (it will get truncated if it is too long) and the UITextView is also set to the todo text.  Next, we are translating our priority to an index for the UISegmentedView.  I explained why this was necessary above.  Then the index of the UISegmentedControl is set by using the setSelectedSegmentIndex method.  Finally, we set the text of the button and label based on the status of the todo.&lt;/p&gt; &lt;p style="text-align: left;"&gt;The very last thing we need to do is tell the application to save itself when it closes.  Open up todoAppDelegate.m and add the following code to the applicationWillTerminate method:&lt;/p&gt; &lt;p style="text-align: center;"&gt;&lt;a href="http://icodeblog.com/wp-content/uploads/2008/09/applicationwillterminate.png"&gt;&lt;img class="size-full wp-image-374 aligncenter" title="applicationwillterminate" src="http://icodeblog.com/wp-content/uploads/2008/09/applicationwillterminate.png" alt="" height="64" width="388" /&gt;&lt;/a&gt;&lt;/p&gt; &lt;p style="text-align: left;"&gt;If you ask me, this is some freakin sweet functionality.  The method “makeObjectsPerformSelector” is a built in method on an NSArray.  It basically loops over every object in the array, calling the method you pass in to it on each one.  It’s like doing a for loop and calling the todo[x].dehydrate method for each todo.  Only this is much cleaner.  So, to reiterate, this method will call the dehydrate method on each todo.  If the todo is “dirty” meaning it was altered, it will be saved to the database, otherwise the dehydrate method will do nothing.&lt;/p&gt; &lt;p style="text-align: left;"&gt;* One thing to note.  The applicationWillTerminate method will not be called if you quit the simulator while the application is running.  To make sure it gets called (and the todo data gets saved) make sure you press the home button on the simulator after you make alterations to the todos.  If you simply press Apple-q and quit the simulator while inside of the todo program, no data will be saved and you will post angry comments on my site telling me that my tutorial is wrong.&lt;/p&gt; &lt;p style="text-align: left;"&gt;Click Build and Go and just sit back and enjoy the magic of rock! I mean XCode…&lt;/p&gt; &lt;p style="text-align: left;"&gt;When you select a todo item, your screen should look something like this:&lt;/p&gt; &lt;p style="text-align: center;"&gt;&lt;a href="http://icodeblog.com/wp-content/uploads/2008/09/screenshot1.png"&gt;&lt;img style="width: 313px; height: 598px;" class="size-full wp-image-390 aligncenter" title="screenshot1" src="http://icodeblog.com/wp-content/uploads/2008/09/screenshot1.png" alt="" /&gt;&lt;/a&gt;&lt;/p&gt; &lt;p style="text-align: left;"&gt;Well, that concludes part 3 of our series.  Join me next time, when I will show you how to add and delete todos from the SQLite database. If you have any comments or questions, feel free to leave them in the comments section.  I would love to hear them.  Please &lt;a href="http://feeds.feedburner.com/icodeblog" onclick="pageTracker._trackPageview('/outgoing/feeds.feedburner.com/icodeblog?referer=http://icodeblog.com/2008/08/19/iphone-programming-tutorial-creating-a-todo-list-using-sqlite-part-1/');"&gt;subscribe to the RSS feed&lt;/a&gt; if you want to be automatically notified of new tutorials.  If you get lost at any point, you can download the sample code for this tutorial &lt;a href="http://icodeblog.com/wp-content/uploads/2008/09/todo-part-3.zip"&gt;here&lt;/a&gt;.&lt;/p&gt; &lt;p style="text-align: left;"&gt;Happy iCoding!&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7660917028131688558-1650963885705278748?l=jainmarket.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://jainmarket.blogspot.com/feeds/1650963885705278748/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7660917028131688558&amp;postID=1650963885705278748' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7660917028131688558/posts/default/1650963885705278748'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7660917028131688558/posts/default/1650963885705278748'/><link rel='alternate' type='text/html' href='http://jainmarket.blogspot.com/2009/05/creating-todo-list-using-sqlite-part-3.html' title='Creating a ToDo List Using SQLite Part 3'/><author><name>Rahul Vyas</name><uri>http://www.blogger.com/profile/08326955903115378266</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://bp1.blogger.com/_6C_XpG63jYw/SAgrxtkt56I/AAAAAAAAACc/pr7-vuTQS5w/S220/P1170634+(Small).JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7660917028131688558.post-1299303960082130153</id><published>2009-05-14T19:20:00.000+05:30</published><updated>2009-05-14T19:33:29.876+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='IPHONE'/><title type='text'>Creating a ToDo List Using SQLite Part 2</title><content type='html'>This tutorial is part 2 in our series of creating a to-do list.  I will assume that you have completed the following tutorial and its prequisites.                   &lt;ul&gt;&lt;li&gt;&lt;a href="http://icodeblog.com/2008/08/19/iphone-programming-tutorial-creating-a-todo-list-using-sqlite-part-1/"&gt;iPhone Programming Tutorial - Creating a ToDo List Using SQLite Part 1&lt;/a&gt;&lt;/li&gt;&lt;/ul&gt; &lt;p&gt;I will be using the code produced from that tutorial as a base for this one.  When you are finished with this tutorial, your application will look something like this:&lt;/p&gt; &lt;p style="text-align: center;"&gt;&lt;a href="http://icodeblog.com/wp-content/uploads/2008/09/screenshot.png"&gt;&lt;img style="width: 314px; height: 600px;" class="alignnone size-full wp-image-327" title="screenshot" src="http://icodeblog.com/wp-content/uploads/2008/09/screenshot.png" alt="" /&gt;&lt;/a&gt;&lt;/p&gt; &lt;p&gt;In this section, I will not only teach you how to display the SQL data in UITablewView, but I will be detailing how to display it in &lt;strong&gt;multiple columns&lt;/strong&gt; with images and text.  For this tutorial, you will need to download the following images.&lt;/p&gt; &lt;ul&gt;&lt;li&gt;&lt;a href="http://icodeblog.com/wp-content/uploads/2008/09/red.png"&gt;&lt;img class="alignnone size-full wp-image-304" title="red1" src="http://icodeblog.com/wp-content/uploads/2008/09/red.png" alt="" /&gt;&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href="http://icodeblog.com/wp-content/uploads/2008/09/green.png"&gt;&lt;img class="alignnone size-full wp-image-305" title="green1" src="http://icodeblog.com/wp-content/uploads/2008/09/green.png" alt="" /&gt;&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href="http://icodeblog.com/wp-content/uploads/2008/09/yellow.png"&gt;&lt;img class="alignnone size-full wp-image-306" title="yellow" src="http://icodeblog.com/wp-content/uploads/2008/09/yellow.png" alt="" /&gt;&lt;/a&gt;&lt;/li&gt;&lt;/ul&gt; &lt;p&gt;We will be using these images to denote the priority (Green = low, Yellow = medium, Red = high).&lt;/p&gt; &lt;h2&gt;Bring Your Code Up To Speed&lt;/h2&gt; &lt;div style="margin: 15px; text-align: center;"&gt;&lt;div class="advertisement-box"&gt; &lt;script type="text/javascript"&gt;&lt;!-- google_ad_client = "pub-7921832321836192"; google_alternate_color = "FFFFFF"; google_ad_width = 468; google_ad_height = 60; google_ad_format = "468x60_as"; google_ad_type = "text_image"; google_ad_channel =""; google_color_border = "DFEDF6"; google_color_link = "262D36"; google_color_bg = "DFEDF6"; google_color_text = "0066CC"; google_color_url = "262D36"; google_ui_features = "rc:0"; //--&gt;&lt;/script&gt; &lt;script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js"&gt; &lt;/script&gt;&lt;script src="http://pagead2.googlesyndication.com/pagead/expansion_embed.js"&gt;&lt;/script&gt;&lt;script src="http://googleads.g.doubleclick.net/pagead/test_domain.js"&gt;&lt;/script&gt;&lt;script&gt;window.google_render_ad();&lt;/script&gt;&lt;ins style="border: medium none ; margin: 0pt; padding: 0pt; display: inline-table; height: 60px; position: relative; visibility: visible; width: 468px;"&gt;&lt;ins style="border: medium none ; margin: 0pt; padding: 0pt; display: block; height: 60px; position: relative; visibility: visible; width: 468px;"&gt;&lt;iframe allowtransparency="true" hspace="0" id="google_ads_frame1" marginheight="0" marginwidth="0" name="google_ads_frame" src="http://googleads.g.doubleclick.net/pagead/ads?client=ca-pub-7921832321836192&amp;amp;dt=1242305973791&amp;amp;lmt=1242305957&amp;amp;alt_color=FFFFFF&amp;amp;format=468x60_as&amp;amp;output=html&amp;amp;correlator=1242305973791&amp;amp;url=http%3A%2F%2Ficodeblog.com%2F2008%2F09%2F02%2Fiphone-programming-tutorial-creating-a-todo-list-using-sqlite-part-2%2F&amp;amp;color_bg=DFEDF6&amp;amp;color_text=0066CC&amp;amp;color_link=262D36&amp;amp;color_url=262D36&amp;amp;color_border=DFEDF6&amp;amp;ad_type=text_image&amp;amp;ref=http%3A%2F%2Ficodeblog.com%2F2008%2F08%2F19%2Fiphone-programming-tutorial-creating-a-todo-list-using-sqlite-part-1%2F&amp;amp;frm=0&amp;amp;ui=rc%3A0&amp;amp;ga_vid=1791180195.1242219149&amp;amp;ga_sid=1242304596&amp;amp;ga_hid=440413875&amp;amp;ga_fc=true&amp;amp;flash=9.0.124&amp;amp;w=468&amp;amp;h=60&amp;amp;u_h=768&amp;amp;u_w=1024&amp;amp;u_ah=742&amp;amp;u_aw=1024&amp;amp;u_cd=24&amp;amp;u_tz=330&amp;amp;u_his=1&amp;amp;u_java=true&amp;amp;u_nplug=4&amp;amp;u_nmime=80&amp;amp;dtd=81&amp;amp;w=468&amp;amp;h=60&amp;amp;xpc=l0MKt8cyQB&amp;amp;p=http%3A//icodeblog.com" style="left: 0pt; position: absolute; top: 0pt;" vspace="0" frameborder="0" height="60" scrolling="no" width="468"&gt;&lt;/iframe&gt;&lt;/ins&gt;&lt;/ins&gt;&lt;/div&gt;&lt;/div&gt;&lt;p&gt;Before we begin, we need to add some code to the Todo.h and Todo.m class to support the priority field in the database.  Open up Todo.h and add the following code:&lt;/p&gt; &lt;p style="text-align: center;"&gt;&lt;a href="http://icodeblog.com/wp-content/uploads/2008/09/todoh.png"&gt;&lt;img class="size-full wp-image-308 aligncenter" title="todoh" src="http://icodeblog.com/wp-content/uploads/2008/09/todoh.png" alt="" height="146" width="378" /&gt;&lt;/a&gt;&lt;/p&gt; &lt;p style="text-align: left;"&gt;All that is new here is the added NSInteger priority property.  We will be using this to get and set the priority for a given todo object.  Next, open Todo.m and add the following code.&lt;/p&gt; &lt;p style="text-align: center;"&gt;&lt;a href="http://icodeblog.com/wp-content/uploads/2008/09/todom1.png"&gt;&lt;img style="width: 616px; height: 354px;" class="size-full wp-image-310 aligncenter" title="todom1" src="http://icodeblog.com/wp-content/uploads/2008/09/todom1.png" alt="" /&gt;&lt;/a&gt;&lt;/p&gt; &lt;p style="text-align: left;"&gt;The first line that has changed is the synthesize line.  We added our priority property to allow XCode to create the getter and setter methods for it.  Next, you will notice that the sql statement has changed slightly.  We are now getting the priority in addition to the text from the todo table.  Finally,  we set self.priority property to the selected priority value from the todo table.  This is done by using the sqlite3_column_int method.  We pass the init_statement and the number 1.  1 being the index of the sql array for which the priority data is contained.&lt;/p&gt; &lt;h2&gt;Add Images to Your Project&lt;/h2&gt; &lt;p&gt;Download the images above and save them to your project directory.  Inside of your project, right click (control-click) on the &lt;strong&gt;Resources&lt;/strong&gt; folder and click &lt;strong&gt;Add -&gt; Existing Files…&lt;/strong&gt; Browser for the images, select all of them and click &lt;strong&gt;Add&lt;/strong&gt;. Check the box that sais “Copy items into destination group’s folder (if needed)”.  Click &lt;strong&gt;Add. &lt;/strong&gt;The image files should now appear inside of your &lt;strong&gt;Resources &lt;/strong&gt;folder.&lt;/p&gt; &lt;p style="text-align: center;"&gt;&lt;a href="http://icodeblog.com/wp-content/uploads/2008/09/add-images.png"&gt;&lt;img class="size-full wp-image-300 aligncenter" title="add-images" src="http://icodeblog.com/wp-content/uploads/2008/09/add-images.png" alt="" height="374" width="400" /&gt;&lt;/a&gt;&lt;/p&gt; &lt;h2&gt;Create a UITableViewCell Subclass&lt;/h2&gt; &lt;p&gt;To display data in columns within a UITableView, we have to create our own cell class that defines the type of data we want to display.  By default, Apple provides us with a simple cell object that can only display one column of text.  Normally, this is fine as it will work for a wide variety of applications.  Since we require 3 columns for this tutorial, we need to wrap our own cell object.&lt;/p&gt; &lt;p&gt;Click &lt;strong&gt;File -&gt; New File…&lt;/strong&gt; and select &lt;strong&gt;UITableViewCell&lt;/strong&gt;. Click &lt;strong&gt;Next.&lt;/strong&gt;&lt;/p&gt; &lt;p style="text-align: center;"&gt;&lt;a href="http://icodeblog.com/wp-content/uploads/2008/09/uitableviewcell.png"&gt;&lt;img class="size-full wp-image-295 aligncenter" title="uitableviewcell" src="http://icodeblog.com/wp-content/uploads/2008/09/uitableviewcell.png" alt="" height="368" width="500" /&gt;&lt;/a&gt;&lt;/p&gt; &lt;p&gt;Name this file &lt;strong&gt;TodoCell&lt;/strong&gt; and make sure this that the box that sais “Also create TodoCell.h” is checked.&lt;/p&gt; &lt;p style="text-align: center;"&gt;&lt;a href="http://icodeblog.com/wp-content/uploads/2008/09/todocell.png"&gt;&lt;img class="size-full wp-image-296 aligncenter" title="todocell" src="http://icodeblog.com/wp-content/uploads/2008/09/todocell.png" alt="" height="368" width="500" /&gt;&lt;/a&gt;&lt;/p&gt; &lt;p style="text-align: left;"&gt;This will create a “barebones” UITableViewCell object with some basic methods already filled out.  Let’s add some properties to this class.  Open up &lt;strong&gt;TodoCell.h&lt;/strong&gt; and add the following code.&lt;/p&gt; &lt;p style="text-align: center;"&gt;&lt;a href="http://icodeblog.com/wp-content/uploads/2008/09/todocellh.png"&gt;&lt;img class="alignnone size-full wp-image-313" title="todocellh" src="http://icodeblog.com/wp-content/uploads/2008/09/todocellh.png" alt="" height="292" width="403" /&gt;&lt;/a&gt;&lt;/p&gt; &lt;p style="text-align: left;"&gt;Let’s take this line by line…&lt;/p&gt; &lt;p style="text-align: left;"&gt;First, we see a Todo object being declared.  Each cell will know which Todo item is associated with it.  This will help out when updating the data in each cell.  Next, we see 2 UILabels and a UIImageView.  To understand why these components are needed, here is a screenshot of how each cell will look.&lt;/p&gt; &lt;p style="text-align: center;"&gt;&lt;a href="http://icodeblog.com/wp-content/uploads/2008/09/datasample.png"&gt;&lt;img class="alignnone size-full wp-image-314" title="datasample" src="http://icodeblog.com/wp-content/uploads/2008/09/datasample.png" alt="" height="45" width="320" /&gt;&lt;/a&gt;&lt;/p&gt; &lt;p style="text-align: left;"&gt;We see the “Green Dot” which is an image being rendered by a UIImageView.  The word “low” and “Take out the trash” are both UILabels. After they are declared, we simply create them as properties.  Notice that we are NOT creating a property for the Todo object. We will not be synthesizing it either. This is because we want this variable to be private.  Setting this variable requires some additional code so we don’t want any code writer to simply be able to say cell.todo = foo;  You will see why this is so further on in this tutorial.&lt;/p&gt; &lt;p style="text-align: left;"&gt;Below this are some method declarations.  First we see the method “imageForPriority”.  We will be using this method to decide which image (green, red, yellow) gets displayed for a given priority.  Next, we see the “getter and setter” methods for the todo object.  As I explained above, the setter will contain additonal code besides assigning the todo object.&lt;/p&gt; &lt;div style="margin: 15px; text-align: center;"&gt;&lt;div class="advertisement-box"&gt; &lt;script type="text/javascript"&gt;&lt;!-- google_ad_client = "pub-7921832321836192"; google_alternate_color = "FFFFFF"; google_ad_width = 468; google_ad_height = 60; google_ad_format = "468x60_as"; google_ad_type = "text_image"; google_ad_channel =""; google_color_border = "DFEDF6"; google_color_link = "262D36"; google_color_bg = "DFEDF6"; google_color_text = "0066CC"; google_color_url = "262D36"; google_ui_features = "rc:0"; //--&gt;&lt;/script&gt; &lt;script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js"&gt; &lt;/script&gt;&lt;script&gt;window.google_render_ad();&lt;/script&gt;&lt;ins style="border: medium none ; margin: 0pt; padding: 0pt; display: inline-table; height: 60px; position: relative; visibility: visible; width: 468px;"&gt;&lt;ins style="border: medium none ; margin: 0pt; padding: 0pt; display: block; height: 60px; position: relative; visibility: visible; width: 468px;"&gt;&lt;iframe allowtransparency="true" hspace="0" id="google_ads_frame2" marginheight="0" marginwidth="0" name="google_ads_frame" src="http://googleads.g.doubleclick.net/pagead/ads?client=ca-pub-7921832321836192&amp;amp;dt=1242305973909&amp;amp;lmt=1242305957&amp;amp;alt_color=FFFFFF&amp;amp;prev_fmts=468x60_as&amp;amp;format=468x60_as&amp;amp;output=html&amp;amp;correlator=1242305973791&amp;amp;url=http%3A%2F%2Ficodeblog.com%2F2008%2F09%2F02%2Fiphone-programming-tutorial-creating-a-todo-list-using-sqlite-part-2%2F&amp;amp;color_bg=DFEDF6&amp;amp;color_text=0066CC&amp;amp;color_link=262D36&amp;amp;color_url=262D36&amp;amp;color_border=DFEDF6&amp;amp;ad_type=text_image&amp;amp;ref=http%3A%2F%2Ficodeblog.com%2F2008%2F08%2F19%2Fiphone-programming-tutorial-creating-a-todo-list-using-sqlite-part-1%2F&amp;amp;frm=0&amp;amp;ui=rc%3A0&amp;amp;ga_vid=1791180195.1242219149&amp;amp;ga_sid=1242304596&amp;amp;ga_hid=440413875&amp;amp;ga_fc=true&amp;amp;flash=9.0.124&amp;amp;w=468&amp;amp;h=60&amp;amp;u_h=768&amp;amp;u_w=1024&amp;amp;u_ah=742&amp;amp;u_aw=1024&amp;amp;u_cd=24&amp;amp;u_tz=330&amp;amp;u_his=1&amp;amp;u_java=true&amp;amp;u_nplug=4&amp;amp;u_nmime=80&amp;amp;dtd=5&amp;amp;w=468&amp;amp;h=60&amp;amp;xpc=78lEm4gwsp&amp;amp;p=http%3A//icodeblog.com" style="left: 0pt; position: absolute; top: 0pt;" vspace="0" frameborder="0" height="60" scrolling="no" width="468"&gt;&lt;/iframe&gt;&lt;/ins&gt;&lt;/ins&gt;&lt;/div&gt;&lt;/div&gt;&lt;p style="text-align: left;"&gt;Now open up &lt;strong&gt;TodoCell.m&lt;/strong&gt;.  We will be writing quite a bit of code in here so I will break it up the best I can.  First, add the following code to create some of the initialization:&lt;/p&gt; &lt;p style="text-align: center;"&gt;&lt;a href="http://icodeblog.com/wp-content/uploads/2008/09/todocellm1.png"&gt;&lt;img class="alignnone size-full wp-image-316" title="todocellm1" src="http://icodeblog.com/wp-content/uploads/2008/09/todocellm1.png" alt="" height="344" width="485" /&gt;&lt;/a&gt;&lt;/p&gt; &lt;p style="text-align: left;"&gt;Ok, some new stuff here.  First, we see 3 static UIImages.  These will hold reference to each of the three images (red, green, yellow).  Since we only need to allocate them once, we make them static.  Static means that they will be associated with the class not the instance.  So we can make as many TodoCells as we want but only 3 UIImages will be created.  On the next line there is a private interface.  This allows us to declare a private method that no one else can use except this class.  Following this is the synthesize line.  Notice again that we are NOT synthesizing the todo object.&lt;/p&gt; &lt;p style="text-align: left;"&gt;Looking at the initialize method…  All that is going on here is we are intanciating each of our UIImages with the correct image for a given priority.  This initialize method will get called once when the first instance of the todocell class is built.  Moving on… Add the following code: (Note: it might be small and hard to read.  If this is the case, click on the image to open it and the text will be full size)&lt;/p&gt; &lt;p style="text-align: center;"&gt;&lt;a href="http://icodeblog.com/wp-content/uploads/2008/09/todocellm2.png"&gt;&lt;img style="width: 587px; height: 327px;" class="size-full wp-image-317 aligncenter" title="todocellm2" src="http://icodeblog.com/wp-content/uploads/2008/09/todocellm2.png" alt="" /&gt;&lt;/a&gt;&lt;/p&gt; &lt;p style="text-align: left;"&gt;This is the initialiazation method for any UITableViewCell.  First, we need to call the super classe’s (UITableViewCell) initWithFrame to ensure that the underlying components of the cell get set up properly.  Next, we get a reference to the contentView.  The contentView is the view for each cell.  We will be adding all of our UI components to this view.&lt;/p&gt; &lt;p style="text-align: left;"&gt;The next 3 lines initialize a UIImageView and add it to our view.  Notice that we are populating it with the priority1Image.  This will just be a dummy placeholder until we update it.&lt;/p&gt; &lt;p style="text-align: left;"&gt;Following this, we initialize the todoTextLabel.  This label will display what it is we need “to do” such as “Take out the trash”.  There is a method that we will be calling called “newLabelWithPrimaryColor”.  This is a method I will detail a little further down.  What it will do is build a new label with the attributes that we specify when we call it.  This method was taken directly from Apple’s “Seismic XML” sample code.  It’s pretty handy.  After this gets called, we simply add the new label to our view and these steps get repeated for the todoPriorityLabel.&lt;/p&gt; &lt;p style="text-align: left;"&gt;Finally, the method “bringSubviewToFront” is called on the priority UIImageView.  This method is used in case there is text that gets near the image.  It will cause the image to appear above the text.  &lt;strong&gt;You can use this for layering your UI components.&lt;/strong&gt;&lt;/p&gt; &lt;p style="text-align: left;"&gt;Still with me?  Good… now let’s add the following “getter” and “setter” methods for the todo object.&lt;/p&gt; &lt;p style="text-align: center;"&gt;&lt;a href="http://icodeblog.com/wp-content/uploads/2008/09/todocellm3.png"&gt;&lt;img class="size-full wp-image-318 aligncenter" title="todocellm3" src="http://icodeblog.com/wp-content/uploads/2008/09/todocellm3.png" alt="" height="388" width="492" /&gt;&lt;/a&gt;&lt;/p&gt; &lt;p style="text-align: left;"&gt;The first method todo is simple.  All it does is return our todo object.  The setTodo is a little more involved…&lt;/p&gt; &lt;p style="text-align: left;"&gt;First, we set the incoming (newTodo) to our classe’s todo object.  Next, we update the UITextLabel so we can display the detailed todo information.  Following this we set the image of our UIImageView by calling the method imageforPriority.  I will detail this method further down in this tutorial but all it does is return an image for a given priority.  Last, we have a switch statement.  The syntax of a switch statement is the same in objective C as it is in most languages.  If you don’t know what a switch statement is &lt;a href="http://icodeblog.com/2008/09/02/iphone-programming-tutorial-creating-a-todo-list-using-sqlite-part-2/switch%20statement" target="_blank"&gt;Google it&lt;/a&gt;.  Based on the priority of the newTodo, the priority label gets updated with one of three words (High, Medium, Low).  The [self setNeedsDisplay] tells the cell to redisplay itself after this todo has been set.&lt;/p&gt; &lt;p style="text-align: left;"&gt;Now, let’s add the code that lays out the cell.&lt;/p&gt; &lt;p style="text-align: center;"&gt;&lt;a href="http://icodeblog.com/wp-content/uploads/2008/09/todocellm4.png"&gt;&lt;img style="width: 599px; height: 468px;" class="size-full wp-image-319 aligncenter" title="todocellm4" src="http://icodeblog.com/wp-content/uploads/2008/09/todocellm4.png" alt="" /&gt;&lt;/a&gt;&lt;/p&gt; &lt;p style="text-align: left;"&gt;This method gets called automatically when a UITableViewCell is being displayed.  It tells the UITableView how to display your cell.  The define statements are similar to define statements in C.  The reason we are coding like this is because we can tweak these variables to get the display to our liking.  First, we call the layoutSubviews of the super class.  Next, we get a reference to the contentView.bounds.  This variable will allow us to figure out how much drawing area we have and allow us to line objects up properly.&lt;/p&gt; &lt;p style="text-align: left;"&gt;The if(!self.editing) part is not neccessary but is good practice.  You would use this if you allowed editing of your cells.  This code is a little tough to explain by typing, but I will do the best that I can.  First, we declare our right-most column.  This is done by making a frame to hold the content.  This column will hold the text of the todo item.  Most of the code here is just positioning.  You can play with these numbers and see how it moves stuff around.  Once all of the positioning code is completed, the frame of our todoTextLabel gets set to this newly created frame.  This is done for each of our UI components.  You can lay them out however you like, as I may not have the best layout.&lt;/p&gt; &lt;p&gt;We have one more method to override.  It’s the setSelected method.  Go ahead and add the following code.&lt;/p&gt; &lt;p style="text-align: center;"&gt;&lt;a href="http://icodeblog.com/wp-content/uploads/2008/09/todocellm5.png"&gt;&lt;img class="size-full wp-image-321 aligncenter" title="todocellm5" src="http://icodeblog.com/wp-content/uploads/2008/09/todocellm5.png" alt="" height="276" width="380" /&gt;&lt;/a&gt;&lt;/p&gt; &lt;div style="margin: 15px; text-align: center;"&gt;&lt;div class="advertisement-box"&gt; &lt;script type="text/javascript"&gt;&lt;!-- google_ad_client = "pub-7921832321836192"; google_alternate_color = "FFFFFF"; google_ad_width = 468; google_ad_height = 60; google_ad_format = "468x60_as"; google_ad_type = "text_image"; google_ad_channel =""; google_color_border = "DFEDF6"; google_color_link = "262D36"; google_color_bg = "DFEDF6"; google_color_text = "0066CC"; google_color_url = "262D36"; google_ui_features = "rc:0"; //--&gt;&lt;/script&gt; &lt;script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js"&gt; &lt;/script&gt;&lt;script&gt;window.google_render_ad();&lt;/script&gt;&lt;ins style="border: medium none ; margin: 0pt; padding: 0pt; display: inline-table; height: 60px; position: relative; visibility: visible; width: 468px;"&gt;&lt;ins style="border: medium none ; margin: 0pt; padding: 0pt; display: block; height: 60px; position: relative; visibility: visible; width: 468px;"&gt;&lt;iframe allowtransparency="true" hspace="0" id="google_ads_frame3" marginheight="0" marginwidth="0" name="google_ads_frame" src="http://googleads.g.doubleclick.net/pagead/ads?client=ca-pub-7921832321836192&amp;amp;dt=1242305973950&amp;amp;lmt=1242305957&amp;amp;alt_color=FFFFFF&amp;amp;prev_fmts=468x60_as%2C468x60_as&amp;amp;format=468x60_as&amp;amp;output=html&amp;amp;correlator=1242305973791&amp;amp;url=http%3A%2F%2Ficodeblog.com%2F2008%2F09%2F02%2Fiphone-programming-tutorial-creating-a-todo-list-using-sqlite-part-2%2F&amp;amp;color_bg=DFEDF6&amp;amp;color_text=0066CC&amp;amp;color_link=262D36&amp;amp;color_url=262D36&amp;amp;color_border=DFEDF6&amp;amp;ad_type=text_image&amp;amp;ref=http%3A%2F%2Ficodeblog.com%2F2008%2F08%2F19%2Fiphone-programming-tutorial-creating-a-todo-list-using-sqlite-part-1%2F&amp;amp;frm=0&amp;amp;ui=rc%3A0&amp;amp;ga_vid=1791180195.1242219149&amp;amp;ga_sid=1242304596&amp;amp;ga_hid=440413875&amp;amp;ga_fc=true&amp;amp;flash=9.0.124&amp;amp;w=468&amp;amp;h=60&amp;amp;u_h=768&amp;amp;u_w=1024&amp;amp;u_ah=742&amp;amp;u_aw=1024&amp;amp;u_cd=24&amp;amp;u_tz=330&amp;amp;u_his=1&amp;amp;u_java=true&amp;amp;u_nplug=4&amp;amp;u_nmime=80&amp;amp;dtd=4&amp;amp;w=468&amp;amp;h=60&amp;amp;xpc=LNdMDzLhpf&amp;amp;p=http%3A//icodeblog.com" style="left: 0pt; position: absolute; top: 0pt;" vspace="0" frameborder="0" height="60" scrolling="no" width="468"&gt;&lt;/iframe&gt;&lt;/ins&gt;&lt;/ins&gt;&lt;/div&gt;&lt;/div&gt;&lt;p style="text-align: left;"&gt;This method gets called when the user taps on a given cell.  We need to tell the cell how to behave when it gets tapped on.  This method should look pretty straight forward.  First, we call the setSelected method of the super class.  Next, we update the background color depending on whether or not the cell was selected.  Finally, the labels get set to a white color if the cell gets selected.  This is to contrast the blue color that the background becomes when the cell is selected.&lt;/p&gt; &lt;p style="text-align: left;"&gt;This last 2 methods that I want to talk about are the helper methods that we used earlier in the code.  Add the following methods to your code.&lt;/p&gt; &lt;p style="text-align: center;"&gt;&lt;a href="http://icodeblog.com/wp-content/uploads/2008/09/todocellm6.png"&gt;&lt;img style="width: 615px; height: 448px;" class="size-full wp-image-322 aligncenter" title="todocellm6" src="http://icodeblog.com/wp-content/uploads/2008/09/todocellm6.png" alt="" /&gt;&lt;/a&gt;&lt;/p&gt; &lt;p style="text-align: left;"&gt;&lt;strong&gt;newLabelWithPrimaryColor&lt;/strong&gt;&lt;/p&gt; &lt;p&gt;This method got called when we were initializing our UILabels.  It takes a few parameters that should be pretty self explanatory.  Looking through the code, we first see the font being initialized with the size that we specified.  If bold was specified this is also accounted for.  Next, we instantiate a new UILabel and give it some properties.  Finally, this newly created UILabel gets returned.&lt;/p&gt; &lt;p&gt;&lt;strong&gt;&lt;span style="color: rgb(136, 136, 136);"&gt;imageForPriority&lt;/span&gt;&lt;/strong&gt;&lt;/p&gt; &lt;p&gt;This method is actually quite simple.  It simply takes a priority and returns the UIImage that is associated with that priority.  Notice the default clause.  I decided to handle it like this instead of doing “case 1″ to handle all other cases.  For whatever reason, if there is ever a priority that is not 1,2 or 3 it will, by default, have low priority.&lt;/p&gt; &lt;p&gt;Now that we have created our UITableViewCell, we need to display it in the table.  Open up RootViewController.m and add the following import statement.  This will allow us to use our TodoCell object.&lt;/p&gt; &lt;p style="text-align: center;"&gt;&lt;a href="http://icodeblog.com/wp-content/uploads/2008/09/rootviewcontrollerm1.png"&gt;&lt;img class="size-full wp-image-323 aligncenter" title="rootviewcontrollerm1" src="http://icodeblog.com/wp-content/uploads/2008/09/rootviewcontrollerm1.png" alt="" height="18" width="130" /&gt;&lt;/a&gt;&lt;/p&gt; &lt;p style="text-align: left;"&gt;Now find the numberOfRowsInSection method and add the following code&lt;/p&gt; &lt;p style="text-align: center;"&gt;&lt;a href="http://icodeblog.com/wp-content/uploads/2008/09/rootviewcontrollerm2.png"&gt;&lt;img style="width: 612px; height: 79px;" class="size-full wp-image-324 aligncenter" title="rootviewcontrollerm2" src="http://icodeblog.com/wp-content/uploads/2008/09/rootviewcontrollerm2.png" alt="" /&gt;&lt;/a&gt;&lt;/p&gt; &lt;p style="text-align: left;"&gt;I’m not going to really go over this, as this is almost the exact same code as in the Fruits example.  Basically, we are returning the number of todo items.&lt;/p&gt; &lt;p&gt;Now for the magic…We will now add our TodoCell to allow it to be displayed.  Find the cellForRowAtIndexPath method and add the following code.&lt;/p&gt; &lt;p style="text-align: center;"&gt;&lt;a href="http://icodeblog.com/wp-content/uploads/2008/09/rootviewcontrollerm3.png"&gt;&lt;img style="width: 646px; height: 222px;" class="size-full wp-image-325 aligncenter" title="rootviewcontrollerm3" src="http://icodeblog.com/wp-content/uploads/2008/09/rootviewcontrollerm3.png" alt="" /&gt;&lt;/a&gt;&lt;/p&gt; &lt;p style="text-align: left;"&gt;This code is fairly similar to the default code that Apple has provided us.  The first change is we are instantiating our TodoCell object.  We are creating it with the initWithFrame method and passing our identifier to it.  Next, we get reference to the application’s appDelegate and use it to look up the todo item at the given index.  This should be familiar.  Finally, we set the todo item of the cell to the todo item at the row index and return the cell.  That’s it! Go ahead and click the Build and Go icon and see your todo list come to life.  Here is a screenshot of what your app should look like.&lt;/p&gt; &lt;p style="text-align: center;"&gt;&lt;a href="http://icodeblog.com/wp-content/uploads/2008/09/screenshot.png"&gt;&lt;img style="width: 314px; height: 600px;" class="alignnone size-full wp-image-327" title="screenshot" src="http://icodeblog.com/wp-content/uploads/2008/09/screenshot.png" alt="" /&gt;&lt;/a&gt;&lt;/p&gt; &lt;p style="text-align: left;"&gt;That concludes part 2 of this tutorial. Join me next time as I show you how to display detailed todo info using some new UI controls that we haven’t seen yet. As always, post your questions and comments in the comments section of the blog. &lt;a href="http://icodeblog.com/wp-content/uploads/2008/09/todo-part-21.zip"&gt;Download The Sample Code&lt;/a&gt;&lt;/p&gt; &lt;p&gt;Happy iCoding!&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7660917028131688558-1299303960082130153?l=jainmarket.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://jainmarket.blogspot.com/feeds/1299303960082130153/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7660917028131688558&amp;postID=1299303960082130153' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7660917028131688558/posts/default/1299303960082130153'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7660917028131688558/posts/default/1299303960082130153'/><link rel='alternate' type='text/html' href='http://jainmarket.blogspot.com/2009/05/creating-todo-list-using-sqlite-part-2.html' title='Creating a ToDo List Using SQLite Part 2'/><author><name>Rahul Vyas</name><uri>http://www.blogger.com/profile/08326955903115378266</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://bp1.blogger.com/_6C_XpG63jYw/SAgrxtkt56I/AAAAAAAAACc/pr7-vuTQS5w/S220/P1170634+(Small).JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7660917028131688558.post-373333790273118684</id><published>2009-05-14T18:08:00.000+05:30</published><updated>2009-05-14T18:24:36.411+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='IPHONE'/><title type='text'>Creating a ToDo List Using SQLite Part 1</title><content type='html'>&lt;p&gt;If you have been following my tutorials, you know that we have been working primarily with UITableViews.  This is mostly because SO many applications can be developed using this simple control.  This final UITableView tutorial will be taking all of the skills learned from previous tutorials, putting them all together, and adding SQLite to create a prioritized To-Do list.  I will also be showing you how to add multiple columns to your table cells and we will be exploring some of the other controls that the iPhone has to offer.  What good would the tutorials be if we didn’t use them to create something useful.&lt;/p&gt; &lt;p&gt;I will move a little faster in this tutorial while still explaining the new stuff in detail.  I will assume that you have completed the &lt;a href="http://icodeblog.com/2008/08/08/iphone-programming-tutorial-populating-uitableview-with-an-nsarray/"&gt;fruits tutorial&lt;/a&gt; and it’s prerequisites.&lt;/p&gt; &lt;p&gt;This tutorial will be a multipart series as it will be a little longer than my previous ones.  In this first tutorial, you will learn:&lt;/p&gt; &lt;ul&gt;&lt;li&gt;&lt;a href="http://icodeblog.com/2008/08/19/iphone-programming-tutorial-creating-a-todo-list-using-sqlite-part-1/#nav-based"&gt;Create a NavigationBased Application&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href="http://icodeblog.com/2008/08/19/iphone-programming-tutorial-creating-a-todo-list-using-sqlite-part-1/#create-db"&gt;Create a Database&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href="http://icodeblog.com/2008/08/19/iphone-programming-tutorial-creating-a-todo-list-using-sqlite-part-1/#add-db"&gt;Add the Database to Your Project&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href="http://icodeblog.com/2008/08/19/iphone-programming-tutorial-creating-a-todo-list-using-sqlite-part-1/#sqlite3-framework"&gt;Add the SQLite3 Framework&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href="http://icodeblog.com/2008/08/19/iphone-programming-tutorial-creating-a-todo-list-using-sqlite-part-1/#todo-object"&gt;Create a Todo Class Object&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href="http://icodeblog.com/2008/08/19/iphone-programming-tutorial-creating-a-todo-list-using-sqlite-part-1/#init-db"&gt;Initialize the Database&lt;/a&gt;&lt;/li&gt;&lt;/ul&gt; &lt;p&gt;So let’s get started…&lt;/p&gt; &lt;h2&gt;&lt;a name="nav-based"&gt;&lt;/a&gt;&lt;/h2&gt; &lt;p&gt;Open up X-Code and Select &lt;strong&gt;File-&gt;New Project… &lt;/strong&gt;Select &lt;strong&gt;Navigation-Based Application&lt;/strong&gt; and click &lt;strong&gt;Choose…&lt;/strong&gt;&lt;/p&gt; &lt;p style="text-align: center;"&gt;&lt;a href="http://icodeblog.com/wp-content/uploads/2008/08/01navigationbased.png"&gt;&lt;img class="size-full wp-image-198 aligncenter" title="01navigationbased" src="http://icodeblog.com/wp-content/uploads/2008/08/01navigationbased.png" alt="" height="368" width="500" /&gt;&lt;/a&gt;&lt;/p&gt; &lt;p style="text-align: left;"&gt;Name your project &lt;strong&gt;todo&lt;/strong&gt;.  Now let’s create the todo database that we will be using.  Open up the &lt;strong&gt;Terminal&lt;/strong&gt; application on your Mac.  This is located in &lt;strong&gt;Applications &gt; Utilities.&lt;/strong&gt;&lt;/p&gt; &lt;h2 style="text-align: left;"&gt;&lt;a name="create-db"&gt;&lt;/a&gt;&lt;/h2&gt; &lt;p&gt;If you have installed XCode, you should have mysqlite3 already on your computer.  To check this, type:&lt;/p&gt; &lt;p style="text-align: left;"&gt;&lt;code&gt;sqlite3&lt;/code&gt; into the Terminal and sqlite3 should start.  Type &lt;code&gt;.quit&lt;/code&gt; to exit.  If sqlite3 is not installed, install all of the &lt;strong&gt;XTools&lt;/strong&gt; from your &lt;strong&gt;Mac Installation Disk&lt;/strong&gt;.&lt;/p&gt; &lt;p style="text-align: left;"&gt;Now that the terminal is open let’s create the database. This is done with the command:&lt;/p&gt; &lt;p style="text-align: left;"&gt;sqlite3 todo.sqlite&lt;/p&gt; &lt;p style="text-align: left;"&gt;SQLite3 will now start and load the todo.sqlite database.  By default the database is empty and contains no tables.  If you need a refresher on the basics of SQL databases &lt;a href="http://www.google.com/search?q=sql+tutorial&amp;amp;ie=utf-8&amp;amp;oe=utf-8&amp;amp;aq=t&amp;amp;rls=org.mozilla:en-US:official&amp;amp;client=firefox-a" onclick="pageTracker._trackPageview('/outgoing/www.google.com/search?q=sql+tutorial_amp_ie=utf-8_amp_oe=utf-8_amp_aq=t_amp_rls=org.mozilla_en-US_official_amp_client=firefox-a&amp;amp;referer=');"&gt;Google It.&lt;/a&gt; Since our application is fairly simple, we only need to create one table.  We will create a table called todo by typing the following statement:&lt;/p&gt; &lt;p style="text-align: left;"&gt;&lt;code&gt;CREATE TABLE todo(pk INTEGER PRIMARY KEY, text VARCHAR(25), priority INTEGER, complete BOOLEAN);&lt;/code&gt;&lt;/p&gt; &lt;p style="text-align: left;"&gt;One thing to note here is the &lt;strong&gt;pk&lt;/strong&gt; field.  It is the primary key of the table.  This adds functionality such that every time a row is added to the database, it auto-increments this field.  This will be a unique identifier to identify each row.  All of the other fields should be fairly self explanitory.&lt;/p&gt; &lt;p style="text-align: left;"&gt;Now that our table has been created, let’s add some data.  We will eventually be adding todo items within our app, but for now we will add some defaults.  Type the following commands below.&lt;/p&gt; &lt;p style="text-align: left;"&gt;&lt;code&gt;INSERT INTO todo(text,priority,complete) VALUES('Take out the trash',3,0);&lt;br /&gt;INSERT INTO todo(text,priority,complete) VALUES('Do Computer Science homework',1,0);&lt;br /&gt;INSERT INTO todo(text,priority,complete) VALUES('Learn Objective C',1,0);&lt;br /&gt;INSERT INTO todo(text,priority,complete) VALUES('DIGG this tutorial',2,0);&lt;/code&gt;&lt;/p&gt; &lt;p style="text-align: left;"&gt;You can add as many todo items as you would like.  For this tutorial, make sure you enter a priority between 1 and 3 (You’ll see why later).  Now our database has been created and populated let’s exit out of SQLite3.  Do this by typing .quit.  Your terminal window should look something like this.&lt;/p&gt; &lt;p style="text-align: center;"&gt;&lt;a href="http://icodeblog.com/wp-content/uploads/2008/08/1-deb-creation.png"&gt;&lt;img class="size-full wp-image-272 aligncenter" title="1-db-creation" src="http://icodeblog.com/wp-content/uploads/2008/08/1-deb-creation.png" alt="" height="272" width="500" /&gt;&lt;/a&gt;&lt;/p&gt; &lt;h2 style="text-align: left;"&gt;&lt;a name="add-db"&gt;&lt;/a&gt;&lt;/h2&gt; &lt;p&gt;Now go back to XCode.  Do a Control-Click (right click) on the folder named &lt;strong&gt;Resources&lt;/strong&gt;. Click &lt;strong&gt;Add -&gt; Existing Files…&lt;/strong&gt; and browse to your todo.sqlite file and click &lt;strong&gt;Add&lt;/strong&gt;.  It will then prompt you with a screen like this.&lt;/p&gt; &lt;p style="text-align: center;"&gt;&lt;a href="http://icodeblog.com/wp-content/uploads/2008/08/2-add-db.png"&gt;&lt;img class="size-full wp-image-259 aligncenter" title="2-add-db" src="http://icodeblog.com/wp-content/uploads/2008/08/2-add-db.png" alt="" height="374" width="400" /&gt;&lt;/a&gt;&lt;/p&gt; &lt;p style="text-align: left;"&gt;Make sure you check the box that says &lt;strong&gt;Copy items into destination group’s folder (if needed).&lt;/strong&gt; You should now see the todo.sqlite file inside of the resource folder.&lt;/p&gt; &lt;p style="text-align: center;"&gt;&lt;a href="http://icodeblog.com/wp-content/uploads/2008/08/3-db.png"&gt;&lt;img class="size-full wp-image-260 aligncenter" title="3-db" src="http://icodeblog.com/wp-content/uploads/2008/08/3-db.png" alt="" height="324" width="188" /&gt;&lt;/a&gt;&lt;/p&gt; &lt;h2 style="text-align: left;"&gt;&lt;a name="sqlite3-framework"&gt;&lt;/a&gt;&lt;/h2&gt; &lt;p&gt;Now that we have added the database, we need to load the Objective C libraries so we can use it.  Do a control-click (right click) on the &lt;strong&gt;Frameworks &lt;/strong&gt;folder.  Click &lt;strong&gt;Add -&gt; Existing Frameworks&lt;/strong&gt;.  Now this part is a little strange.  It has been my experience that these libraries are not in the same place on all machines.  So in the search bar type in &lt;strong&gt;libsqlite3. &lt;/strong&gt;The file we are looking for is called &lt;strong&gt;libsqlite3.0.dylib.&lt;/strong&gt; This may pull up multiple files as OSX has it’s own versions of this file.  Just click on the largest of the files that show up and click &lt;strong&gt;Add.&lt;/strong&gt; As you can see, mine is about 1.7 MB.&lt;/p&gt; &lt;p style="text-align: center;"&gt;&lt;a href="http://icodeblog.com/wp-content/uploads/2008/08/4-framework.png"&gt;&lt;img class="size-full wp-image-261 aligncenter" title="4-framework" src="http://icodeblog.com/wp-content/uploads/2008/08/4-framework.png" alt="" height="371" width="500" /&gt;&lt;/a&gt;&lt;/p&gt; &lt;p style="text-align: left;"&gt;Now it should add the framework and your directory will look something like this:&lt;/p&gt; &lt;p style="text-align: center;"&gt;&lt;a href="http://icodeblog.com/wp-content/uploads/2008/08/5-frameworkin.png"&gt;&lt;img class="size-full wp-image-262 aligncenter" title="5-frameworkin" src="http://icodeblog.com/wp-content/uploads/2008/08/5-frameworkin.png" alt="" height="85" width="174" /&gt;&lt;/a&gt;&lt;/p&gt; &lt;h2 style="text-align: left;"&gt;&lt;a name="todo-object"&gt;&lt;/a&gt;&lt;/h2&gt; &lt;p&gt;We need to create an object to hold our todo information.  We will eventually be making an array of these objects to populate a UITableView.  Go ahead and click &lt;strong&gt;File -&gt; New File…&lt;/strong&gt; Select &lt;strong&gt;NSObject Subclass&lt;/strong&gt; and click &lt;strong&gt;Next.&lt;/strong&gt;&lt;/p&gt; &lt;p style="text-align: center;"&gt;&lt;a href="http://icodeblog.com/wp-content/uploads/2008/08/6-object.png"&gt;&lt;img class="size-full wp-image-263 aligncenter" title="6-object" src="http://icodeblog.com/wp-content/uploads/2008/08/6-object.png" alt="" height="368" width="500" /&gt;&lt;/a&gt;&lt;/p&gt; &lt;p style="text-align: left;"&gt;Name this object &lt;strong&gt;todo.m&lt;/strong&gt; and check the box that says &lt;strong&gt;Also create “Todo.h”&lt;/strong&gt; and click &lt;strong&gt;Finish.&lt;/strong&gt;&lt;/p&gt; &lt;p style="text-align: center;"&gt;&lt;a href="http://icodeblog.com/wp-content/uploads/2008/08/7-addobject.png"&gt;&lt;img class="size-full wp-image-264 aligncenter" title="7-addobject" src="http://icodeblog.com/wp-content/uploads/2008/08/7-addobject.png" alt="" height="368" width="500" /&gt;&lt;/a&gt;&lt;/p&gt; &lt;p style="text-align: left;"&gt;Open up &lt;strong&gt;todo.h&lt;/strong&gt; and add the following code.&lt;/p&gt; &lt;p style="text-align: center;"&gt;&lt;a href="http://icodeblog.com/wp-content/uploads/2008/08/8-todoh.png"&gt;&lt;img class="size-full wp-image-265 aligncenter" title="8-todoh" src="http://icodeblog.com/wp-content/uploads/2008/08/8-todoh.png" alt="" height="227" width="382" /&gt;&lt;/a&gt;&lt;/p&gt; &lt;p style="text-align: left;"&gt;We see some new things here…First, there is a variable of type sqlite3 called database.  This will be a reference to the applications database and will allow the todo object to communicate with it.  Make sure you add a #import&lt;sqlite3.h&gt; in your imports.&lt;/sqlite3.h&gt;&lt;/p&gt; &lt;p style="text-align: left;"&gt;Next, we see a primary key.  Notice that in the property declaration it has the keywords &lt;strong&gt;assign&lt;/strong&gt; and &lt;strong&gt;readonly&lt;/strong&gt;.  This tells the compiler that this variable, once assiged, can not be changed again.  This is good since each todo will be uniquely identified by this variable.&lt;/p&gt; &lt;div style="margin: 15px; text-align: center;"&gt;&lt;div class="advertisement-box"&gt; &lt;script type="text/javascript"&gt;&lt;!-- google_ad_client = "pub-7921832321836192"; google_alternate_color = "FFFFFF"; google_ad_width = 234; google_ad_height = 60; google_ad_format = "234x60_as"; google_ad_type = "text_image"; google_ad_channel =""; google_color_border = "DFEDF6"; google_color_link = "262D36"; google_color_bg = "DFEDF6"; google_color_text = "0066CC"; google_color_url = "262D36"; google_ui_features = "rc:0"; //--&gt;&lt;/script&gt; &lt;script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js"&gt; &lt;/script&gt;&lt;script src="http://pagead2.googlesyndication.com/pagead/expansion_embed.js"&gt;&lt;/script&gt;&lt;script src="http://googleads.g.doubleclick.net/pagead/test_domain.js"&gt;&lt;/script&gt;&lt;script&gt;window.google_render_ad();&lt;/script&gt;&lt;ins style="border: medium none ; margin: 0pt; padding: 0pt; display: inline-table; height: 60px; position: relative; visibility: visible; width: 234px;"&gt;&lt;ins style="border: medium none ; margin: 0pt; padding: 0pt; display: block; height: 60px; position: relative; visibility: visible; width: 234px;"&gt;&lt;iframe allowtransparency="true" hspace="0" id="google_ads_frame1" marginheight="0" marginwidth="0" name="google_ads_frame" src="http://googleads.g.doubleclick.net/pagead/ads?client=ca-pub-7921832321836192&amp;amp;dt=1242304521141&amp;amp;lmt=1242304460&amp;amp;alt_color=FFFFFF&amp;amp;format=234x60_as&amp;amp;output=html&amp;amp;correlator=1242304521141&amp;amp;url=http%3A%2F%2Ficodeblog.com%2F2008%2F08%2F19%2Fiphone-programming-tutorial-creating-a-todo-list-using-sqlite-part-1%2F&amp;amp;color_bg=DFEDF6&amp;amp;color_text=0066CC&amp;amp;color_link=262D36&amp;amp;color_url=262D36&amp;amp;color_border=DFEDF6&amp;amp;ad_type=text_image&amp;amp;frm=0&amp;amp;ui=rc%3A0&amp;amp;ga_vid=1791180195.1242219149&amp;amp;ga_sid=1242304596&amp;amp;ga_hid=1351659881&amp;amp;ga_fc=true&amp;amp;flash=9.0.124&amp;amp;w=234&amp;amp;h=60&amp;amp;u_h=768&amp;amp;u_w=1024&amp;amp;u_ah=742&amp;amp;u_aw=1024&amp;amp;u_cd=24&amp;amp;u_tz=330&amp;amp;u_his=2&amp;amp;u_java=true&amp;amp;u_nplug=4&amp;amp;u_nmime=80&amp;amp;dtd=M&amp;amp;w=234&amp;amp;h=60&amp;amp;xpc=LzEh1HeAdh&amp;amp;p=http%3A//icodeblog.com" style="left: 0pt; position: absolute; top: 0pt;" vspace="0" frameborder="0" height="60" scrolling="no" width="234"&gt;&lt;/iframe&gt;&lt;/ins&gt;&lt;/ins&gt;&lt;/div&gt;&lt;/div&gt;&lt;p style="text-align: left;"&gt;Also, I have declared a method called initWithPrimaryKey.  This will be the contstructor for this object.  It takes an integer to assign as the primary key and an sqlite3 object to use as the database reference.&lt;/p&gt; &lt;p style="text-align: left;"&gt;Let’s implement this method…Open up &lt;strong&gt;todo.m&lt;/strong&gt; and add the following code.&lt;/p&gt; &lt;div style="margin: 15px; text-align: center;"&gt;&lt;div class="advertisement-box"&gt; &lt;script type="text/javascript"&gt;&lt;!-- google_ad_client = "pub-7921832321836192"; google_alternate_color = "FFFFFF"; google_ad_width = 468; google_ad_height = 60; google_ad_format = "468x60_as"; google_ad_type = "text_image"; google_ad_channel =""; google_color_border = "DFEDF6"; google_color_link = "262D36"; google_color_bg = "DFEDF6"; google_color_text = "0066CC"; google_color_url = "262D36"; google_ui_features = "rc:0"; //--&gt;&lt;/script&gt; &lt;script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js"&gt; &lt;/script&gt;&lt;script&gt;window.google_render_ad();&lt;/script&gt;&lt;ins style="border: medium none ; margin: 0pt; padding: 0pt; display: inline-table; height: 60px; position: relative; visibility: visible; width: 468px;"&gt;&lt;ins style="border: medium none ; margin: 0pt; padding: 0pt; display: block; height: 60px; position: relative; visibility: visible; width: 468px;"&gt;&lt;iframe allowtransparency="true" hspace="0" id="google_ads_frame2" marginheight="0" marginwidth="0" name="google_ads_frame" src="http://googleads.g.doubleclick.net/pagead/ads?client=ca-pub-7921832321836192&amp;amp;dt=1242304595934&amp;amp;lmt=1242304460&amp;amp;alt_color=FFFFFF&amp;amp;prev_fmts=234x60_as&amp;amp;format=468x60_as&amp;amp;output=html&amp;amp;correlator=1242304521141&amp;amp;url=http%3A%2F%2Ficodeblog.com%2F2008%2F08%2F19%2Fiphone-programming-tutorial-creating-a-todo-list-using-sqlite-part-1%2F&amp;amp;color_bg=DFEDF6&amp;amp;color_text=0066CC&amp;amp;color_link=262D36&amp;amp;color_url=262D36&amp;amp;color_border=DFEDF6&amp;amp;ad_type=text_image&amp;amp;frm=0&amp;amp;ui=rc%3A0&amp;amp;ga_vid=1791180195.1242219149&amp;amp;ga_sid=1242304596&amp;amp;ga_hid=1351659881&amp;amp;ga_fc=true&amp;amp;flash=9.0.124&amp;amp;w=468&amp;amp;h=60&amp;amp;u_h=768&amp;amp;u_w=1024&amp;amp;u_ah=742&amp;amp;u_aw=1024&amp;amp;u_cd=24&amp;amp;u_tz=330&amp;amp;u_his=2&amp;amp;u_java=true&amp;amp;u_nplug=4&amp;amp;u_nmime=80&amp;amp;dtd=5&amp;amp;w=468&amp;amp;h=60&amp;amp;xpc=AIrd0jvyAb&amp;amp;p=http%3A//icodeblog.com" style="left: 0pt; position: absolute; top: 0pt;" vspace="0" frameborder="0" height="60" scrolling="no" width="468"&gt;&lt;/iframe&gt;&lt;/ins&gt;&lt;/ins&gt;&lt;/div&gt;&lt;/div&gt;&lt;p style="text-align: center;"&gt;&lt;a href="http://icodeblog.com/wp-content/uploads/2008/08/9-todom.png"&gt;&lt;img style="width: 654px; height: 390px;" class="size-full wp-image-266 aligncenter" title="9-todom" src="http://icodeblog.com/wp-content/uploads/2008/08/9-todom.png" alt="" /&gt;&lt;/a&gt;&lt;/p&gt; &lt;p style="text-align: left;"&gt;There are quite a few new things that need to be explained here.  I will just go through it line by line.&lt;/p&gt; &lt;p style="text-align: left;"&gt;&lt;code&gt;static sqlite3_stmt *init_statement = nil&lt;/code&gt;&lt;/p&gt; &lt;p style="text-align: left;"&gt;This will hold our initialize statement when retrieving todo data from the database.  This statement is static, meaning it is independent of any instance.  In other words, there will be only one of them no matter how many todo objects we create.  This statement will get compiled and allow us to do some neat things.  I’ll explain more  in a bit.&lt;/p&gt; &lt;p style="text-align: left;"&gt;The next lines makes sure that the super class (NSObject) initilizes properly before we initilize a todo object.  We then set the local &lt;strong&gt;primary key&lt;/strong&gt; and &lt;strong&gt;database&lt;/strong&gt; objects to the parameters passed to the initWithPrimaryKey method.&lt;/p&gt; &lt;p style="text-align: left;"&gt;Now some interesting stuff happens.  The next lines checks if our init_statment is null.  This will happen only once per launch of the application.  If it is null, we create a new string containing an SQL statement.  If you are familiar with SQL at all, this should look pretty familiar with one exception.  What is a question mark doing in there?  Well, I will tell you.  After the SQL statement gets compiled, we can bind a value to it that will eventually replace the question mark.  So this allows us to have 1 generic SQL statement, but bind different values to it to retrieve different results.  So the next line, you guessed it, prepares the statement and stores it in our init_statement.  The &lt;strong&gt;if statement&lt;/strong&gt; just checks to see if this finished correctly and prints an error if there was a problem.&lt;/p&gt; &lt;p style="text-align: left;"&gt;Moving on… The line sqlite3_bind_int simply replaces that question mark with the primary key of the current todo object, so what we end up with is statements like this:&lt;/p&gt; &lt;p style="text-align: left;"&gt;&lt;code&gt;SELECT text FROM todo WHERE pk = 1;&lt;br /&gt;SELECT text FROM todo WHERE pk = 2;&lt;br /&gt;SELECT text FROM todo WHERE pk = 3;&lt;br /&gt;SELECT text FROM todo WHERE pk = n;&lt;/code&gt;&lt;/p&gt; &lt;p style="text-align: left;"&gt;After that, the sqlite3_step(init_statement) method is called.  This method executes the SQL statement on the database.  It is contained inside of an if statement to make sure it executed properly.  Now we can finally access the todo data.  We see this line:&lt;/p&gt; &lt;p style="text-align: left;"&gt;&lt;code&gt;self.text = [NSString stringWithUTF8String:(char*) sqlite3_column_text(init_statement,0)];&lt;/code&gt;&lt;/p&gt; &lt;p style="text-align: left;"&gt;Wow, that’s a mouthful… Let’s analyze it.  The sqlite3_column_text method tells SQL that we want to retrieve a string object from the database.  It has 2 parameters.  The first, is just a reference to the SQL statement that was used.  The second is the column number that we wish to get text from.  So in this case, we only have one column (SELECT text FROM…) so there is only 1 index and that’s the 0th index.  Next, the (char *) is just a cast to a string (might not be needed, but good practice).  And finally, we build an NSString object with the data returned so that we can assign self.text to it.&lt;/p&gt; &lt;p style="text-align: left;"&gt;This is quite a bit to explain in just text.  If I have lost you, feel free to ask me questions in the comments.&lt;/p&gt; &lt;p style="text-align: left;"&gt;We are done with the todo object for now…&lt;/p&gt; &lt;h2 style="text-align: left;"&gt;&lt;a name="init-db"&gt;&lt;/a&gt;&lt;/h2&gt; &lt;p&gt;Go ahead and open up &lt;strong&gt;todoAppDelegate.h&lt;/strong&gt; and add the following code.&lt;/p&gt; &lt;p style="text-align: center;"&gt;&lt;a href="http://icodeblog.com/wp-content/uploads/2008/08/10-app-delegate.png"&gt;&lt;img class="size-full wp-image-267 aligncenter" title="10-app-delegate" src="http://icodeblog.com/wp-content/uploads/2008/08/10-app-delegate.png" alt="" height="244" width="466" /&gt;&lt;/a&gt;&lt;/p&gt; &lt;p style="text-align: left;"&gt;This should look a little familiar with the exception of a few lines.  Notice that I have created an NSMutableArray of todo objects.  This will be (like the &lt;a href="http://icodeblog.com/2008/08/08/iphone-programming-tutorial-populating-uitableview-with-an-nsarray/"&gt;fruit example&lt;/a&gt;) an array to hold our todo items.  We will eventually use this array to populate a UITableView.  The only new lines here are the import of &lt;strong&gt;sqlite3.h&lt;/strong&gt; and the &lt;strong&gt;sqlite3 *database &lt;/strong&gt;line&lt;strong&gt;.&lt;/strong&gt; Now let’s open up &lt;strong&gt;todoAppDelegate.m&lt;/strong&gt; and add some code.&lt;/p&gt; &lt;p style="text-align: center;"&gt;&lt;a href="http://icodeblog.com/wp-content/uploads/2008/08/11-appdelegatem-1.png"&gt;&lt;img class="size-full wp-image-268 aligncenter" title="11-appdelegatem-1" src="http://icodeblog.com/wp-content/uploads/2008/08/11-appdelegatem-1.png" alt="" height="202" width="285" /&gt;&lt;/a&gt;&lt;/p&gt; &lt;div style="margin: 15px; text-align: center;"&gt;&lt;div class="advertisement-box"&gt; &lt;script type="text/javascript"&gt;&lt;!-- google_ad_client = "pub-7921832321836192"; google_alternate_color = "FFFFFF"; google_ad_width = 468; google_ad_height = 60; google_ad_format = "468x60_as"; google_ad_type = "text_image"; google_ad_channel =""; google_color_border = "DFEDF6"; google_color_link = "262D36"; google_color_bg = "DFEDF6"; google_color_text = "0066CC"; google_color_url = "262D36"; google_ui_features = "rc:0"; //--&gt;&lt;/script&gt; &lt;script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js"&gt; &lt;/script&gt;&lt;script&gt;window.google_render_ad();&lt;/script&gt;&lt;ins style="border: medium none ; margin: 0pt; padding: 0pt; display: inline-table; height: 60px; position: relative; visibility: visible; width: 468px;"&gt;&lt;ins style="border: medium none ; margin: 0pt; padding: 0pt; display: block; height: 60px; position: relative; visibility: visible; width: 468px;"&gt;&lt;iframe allowtransparency="true" hspace="0" id="google_ads_frame3" marginheight="0" marginwidth="0" name="google_ads_frame" src="http://googleads.g.doubleclick.net/pagead/ads?client=ca-pub-7921832321836192&amp;amp;dt=1242304596021&amp;amp;lmt=1242304460&amp;amp;alt_color=FFFFFF&amp;amp;prev_fmts=234x60_as%2C468x60_as&amp;amp;format=468x60_as&amp;amp;output=html&amp;amp;correlator=1242304521141&amp;amp;url=http%3A%2F%2Ficodeblog.com%2F2008%2F08%2F19%2Fiphone-programming-tutorial-creating-a-todo-list-using-sqlite-part-1%2F&amp;amp;color_bg=DFEDF6&amp;amp;color_text=0066CC&amp;amp;color_link=262D36&amp;amp;color_url=262D36&amp;amp;color_border=DFEDF6&amp;amp;ad_type=text_image&amp;amp;frm=0&amp;amp;ui=rc%3A0&amp;amp;ga_vid=1791180195.1242219149&amp;amp;ga_sid=1242304596&amp;amp;ga_hid=1351659881&amp;amp;ga_fc=true&amp;amp;flash=9.0.124&amp;amp;w=468&amp;amp;h=60&amp;amp;u_h=768&amp;amp;u_w=1024&amp;amp;u_ah=742&amp;amp;u_aw=1024&amp;amp;u_cd=24&amp;amp;u_tz=330&amp;amp;u_his=2&amp;amp;u_java=true&amp;amp;u_nplug=4&amp;amp;u_nmime=80&amp;amp;dtd=4&amp;amp;w=468&amp;amp;h=60&amp;amp;xpc=SL1EoAVEjW&amp;amp;p=http%3A//icodeblog.com" style="left: 0pt; position: absolute; top: 0pt;" vspace="0" frameborder="0" height="60" scrolling="no" width="468"&gt;&lt;/iframe&gt;&lt;/ins&gt;&lt;/ins&gt;&lt;/div&gt;&lt;/div&gt;&lt;p style="text-align: left;"&gt;One new thing we see here is a private interface.  We declared it here because it’s specific to this object so it does not need to be declared in the .h file.  The 2 functions we will implement are createEditableCopyOfDatabaseIfNeeded and initializeDatabase.  Much of the code for these has already been written for us inside of Apple’s SQLBooks tutorial.  I will going through this code and explaining it the best that I can. Add the following code.&lt;/p&gt; &lt;p style="text-align: center;"&gt;&lt;a href="http://icodeblog.com/wp-content/uploads/2008/08/12-appdelegatem-2.png"&gt;&lt;img style="width: 652px; height: 209px;" class="size-full wp-image-269 aligncenter" title="12-appdelegatem-2" src="http://icodeblog.com/wp-content/uploads/2008/08/12-appdelegatem-2.png" alt="" /&gt;&lt;/a&gt;&lt;/p&gt; &lt;p style="text-align: left;"&gt;What this method is essentially doing is copying the database from your project folder to the documents folder on your iPhone.  This will only happen once as it first checks if the database already exists in the documents folder.  I’m not going to go through this line by line as it is fairly self explanitory.  Apple does a great job of naming functions and variables so that we can understand what is going on.  If I get enough requests in the comments, I’ll do a line-by-line writup of this function.&lt;/p&gt; &lt;p style="text-align: left;"&gt;The next function we will implement is &lt;strong&gt;initializeDatabase. &lt;/strong&gt;Add the following code:&lt;/p&gt; &lt;p style="text-align: center;"&gt;&lt;a href="http://icodeblog.com/wp-content/uploads/2008/08/13-appdelegatem-3.png"&gt;&lt;img style="width: 628px; height: 438px;" class="size-full wp-image-270 aligncenter" title="13-appdelegatem-3" src="http://icodeblog.com/wp-content/uploads/2008/08/13-appdelegatem-3.png" alt="" /&gt;&lt;/a&gt;&lt;/p&gt; &lt;p style="text-align: left;"&gt;That’s a lot of text! Don’t worry it’s mostly comments.  Let’s analyze this code…Some of it is very similar to the fruits example.&lt;/p&gt; &lt;p style="text-align: left;"&gt;The first line creates and initializes a &lt;strong&gt;NSMutableArray&lt;/strong&gt;.  We then go on to set this array to our object’s todos array and release the temporary object.&lt;/p&gt; &lt;p style="text-align: left;"&gt;The next 3 lines locate the database we created inside of the documents folder.  Following that, the &lt;strong&gt;sqlite3_open&lt;/strong&gt; line open’s the database so we can access its data.  If the database opens correctly, we then proceed to retrieve todo items.  The first line:&lt;/p&gt; &lt;p style="text-align: left;"&gt;&lt;code&gt;const char *sql = "SELECT pk FROM todo";&lt;/code&gt;&lt;/p&gt; &lt;p style="text-align: left;"&gt;is an SQL statement that we will use to get all of the primary keys from the database.  We then prepare the statement (as we did inside the &lt;strong&gt;todo.m&lt;/strong&gt; file) only this time there is no “?” in the statement.  That is because there is not condition for retrieving the primary keys.  We are simply saying “give me all of the primary keys in the database”.&lt;/p&gt; &lt;p style="text-align: left;"&gt;Now we see a &lt;strong&gt;while loop&lt;/strong&gt; that is stepping through the SQL results.  Every time we call &lt;strong&gt;sqlite3_step&lt;/strong&gt;, the next result gets retrieved.  The line:&lt;/p&gt; &lt;p style="text-align: left;"&gt;&lt;code&gt;int primaryKey = sqlite3_column_int(statement,0);&lt;/code&gt;&lt;/p&gt; &lt;p style="text-align: left;"&gt;retrieves the primary key from each result.  This is very similar to retrieving the text in the &lt;strong&gt;todo.m&lt;/strong&gt; class only  we use the &lt;strong&gt;sqlite3_column_int&lt;/strong&gt; method instead of the &lt;strong&gt;sqlite3_column_text&lt;/strong&gt; method.  This is done for obvious reasons.&lt;/p&gt; &lt;p style="text-align: left;"&gt;After we have the primary key, we create a new Todo object and call the &lt;strong&gt;initWithPrimaryKey&lt;/strong&gt; constructor that we created.  The primary key gets passed as well as a reference to the database.  This allows the Todo object to essentially “look itself up” in the database.  Finally, we add the newly created Todo object to our array of todos.&lt;/p&gt; &lt;p style="text-align: left;"&gt;The last statement &lt;strong&gt;sqlite3_finalize&lt;/strong&gt; clears the statement from memory and does some other cleanup.&lt;/p&gt; &lt;p style="text-align: left;"&gt;The last part of this tutorial is calling these functions to create and initialize the database.  So add the following code to applicationDidFinishLaunching:&lt;/p&gt; &lt;p style="text-align: center;"&gt;&lt;a href="http://icodeblog.com/wp-content/uploads/2008/08/14-appdelegatem-4.png"&gt;&lt;img class="size-full wp-image-271 aligncenter" title="14-appdelegatem-4" src="http://icodeblog.com/wp-content/uploads/2008/08/14-appdelegatem-4.png" alt="" height="131" width="425" /&gt;&lt;/a&gt;&lt;/p&gt; &lt;p style="text-align: left;"&gt;We are simply calling these functions.  You can now click &lt;strong&gt;Build and Go&lt;/strong&gt; but your application won’t display anything!  You might be quite frustrated that you completed this portion of the tutorial and have yet to see anything.  Well, stay tuned! I will have the next portion of this tutorial up soon.&lt;/p&gt; &lt;p style="text-align: left;"&gt;For you ambitious programmers you could move on.  If you notice, at this point we are in a similar situation as the fruit tutorial.  We have an Array of objects that will eventually populate a UITableView.&lt;/p&gt; &lt;p style="text-align: left;"&gt;This tutorial will be a 4 part series and I will show you how to use a few more controls.  We will be adding, editing, and deleting todo items.  If you have any questions, please leave them in the comments.  Also, if you get lost you can download the sample code &lt;a href="http://icodeblog.com/wp-content/uploads/2008/08/todo-part-1.zip"&gt;here&lt;/a&gt;&lt;/p&gt; &lt;p style="text-align: left;"&gt;Happy iCoding!&lt;/p&gt;&lt;p style="text-align: left;"&gt;original post can be found here&lt;/p&gt;&lt;p style="text-align: left;"&gt;thanks to brandon for such a great tutorial&lt;br /&gt;&lt;/p&gt;&lt;p style="text-align: left;"&gt;http://icodeblog.com/2008/08/19/iphone-programming-tutorial-creating-a-todo-list-using-sqlite-part-1/#init-db&lt;br /&gt;&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7660917028131688558-373333790273118684?l=jainmarket.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://jainmarket.blogspot.com/feeds/373333790273118684/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7660917028131688558&amp;postID=373333790273118684' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7660917028131688558/posts/default/373333790273118684'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7660917028131688558/posts/default/373333790273118684'/><link rel='alternate' type='text/html' href='http://jainmarket.blogspot.com/2009/05/creating-todo-list-using-sqlite-part-1.html' title='Creating a ToDo List Using SQLite Part 1'/><author><name>Rahul Vyas</name><uri>http://www.blogger.com/profile/08326955903115378266</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://bp1.blogger.com/_6C_XpG63jYw/SAgrxtkt56I/AAAAAAAAACc/pr7-vuTQS5w/S220/P1170634+(Small).JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7660917028131688558.post-1039346819990174124</id><published>2009-05-13T12:40:00.000+05:30</published><updated>2009-05-13T17:39:14.652+05:30</updated><title type='text'></title><content type='html'>http://dblog.com.au/iphone-development-tutorials/iphone-sdk-tutorial-reading-data-from-a-sqlite-database/&lt;br /&gt;&lt;br /&gt;http://www.iphonekicks.com/tags/SQLite&lt;br /&gt;&lt;br /&gt;http://www.iphonesdkwiki.com/Default.aspx?Page=SDK%20Tutorials&amp;amp;AspxAutoDetectCookieSupport=1&lt;br /&gt;&lt;br /&gt;http://www.iphonearch.com/topic/7/sqlite-wrapper/.&lt;br /&gt;&lt;br /&gt;http://www.mobileorchard.com/iphone-sqlite-tutorials-and-libraries/&lt;br /&gt;&lt;br /&gt;http://www.squidoo.com/sqlitehammer&lt;br /&gt;&lt;br /&gt;http://freshmeat.net/articles/sqlite-tutorial&lt;br /&gt;&lt;br /&gt;http://leefalin.com/blog/2008/10/02/iphone-sqlite-database-basics/&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7660917028131688558-1039346819990174124?l=jainmarket.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://jainmarket.blogspot.com/feeds/1039346819990174124/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7660917028131688558&amp;postID=1039346819990174124' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7660917028131688558/posts/default/1039346819990174124'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7660917028131688558/posts/default/1039346819990174124'/><link rel='alternate' type='text/html' href='http://jainmarket.blogspot.com/2009/05/httpdblog.html' title=''/><author><name>Rahul Vyas</name><uri>http://www.blogger.com/profile/08326955903115378266</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://bp1.blogger.com/_6C_XpG63jYw/SAgrxtkt56I/AAAAAAAAACc/pr7-vuTQS5w/S220/P1170634+(Small).JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7660917028131688558.post-8598485072654235342</id><published>2009-05-12T16:27:00.000+05:30</published><updated>2009-05-12T16:29:08.555+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='IPHONE'/><title type='text'>Custom button in UITableViewCell - indexPath</title><content type='html'>&lt;h2&gt;&lt;a href="http://www.71squared.co.uk/2008/12/custom-button-in-uitableviewcell-indexpath/" rel="bookmark" title="Custom button in UITableViewCell - indexPath"&gt;&lt;br /&gt;&lt;/a&gt;&lt;/h2&gt;     &lt;p&gt;&lt;br /&gt;&lt;/p&gt; &lt;p&gt;I am currently working on iPhone app number two when I came across a problem that it has taken me a while to sort out.  I wanted to place a button inside each UITableCell I am displaying.  I then wanted to call a method when the user pressed that button which would perform some action on the information related to the contents of that cell.&lt;/p&gt; &lt;p&gt;&lt;span id="more-106"&gt;&lt;/span&gt;For this to be useful I needed to be able to get the indexpath of the row in which the button was pressed.  It took me a while to work this out but I eventually came up with a solution which is really simple, in fact so simple I am angry I did not work it out sooner. Below is the line of code I am using in my button method to get the indexPath.&lt;/p&gt; &lt;p&gt;&lt;code&gt;&lt;br /&gt;NSIndexPath *indexPath = [self.tblView indexPathForCell:(UITableViewCell *)[sender superview]];&lt;/code&gt;&lt;/p&gt; &lt;p&gt;The method signature used was:&lt;/p&gt; &lt;p&gt;&lt;code&gt;&lt;br /&gt;- (void)buttonMethod:(UIButton *)sender&lt;br /&gt;&lt;/code&gt;&lt;/p&gt; &lt;p&gt;From this point on I was then able to access the section and row of the cell in which the button was pressed using:&lt;/p&gt; &lt;code&gt;&lt;br /&gt;NSInteger section = indexPath.section;&lt;br /&gt;NSInteger row = indexPath.row;&lt;br /&gt;&lt;br /&gt;//for getting cell&lt;br /&gt;UITableViewCell *retcell = (UITableViewCell *)[sender superview];&lt;br /&gt;&lt;br /&gt;for deleting cell&lt;br /&gt;switch(indexPath.row){&lt;br /&gt;            case 0:&lt;br /&gt;            [retcell removeFromSuperview];           &lt;br /&gt;            break;&lt;br /&gt;        case 1:&lt;br /&gt;            [retcell removeFromSuperview];           &lt;br /&gt;            break;&lt;br /&gt;        default:&lt;br /&gt;            break;&lt;br /&gt;&lt;br /&gt;&lt;/code&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7660917028131688558-8598485072654235342?l=jainmarket.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://jainmarket.blogspot.com/feeds/8598485072654235342/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7660917028131688558&amp;postID=8598485072654235342' title='7 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7660917028131688558/posts/default/8598485072654235342'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7660917028131688558/posts/default/8598485072654235342'/><link rel='alternate' type='text/html' href='http://jainmarket.blogspot.com/2009/05/custom-button-in-uitableviewcell.html' title='Custom button in UITableViewCell - indexPath'/><author><name>Rahul Vyas</name><uri>http://www.blogger.com/profile/08326955903115378266</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://bp1.blogger.com/_6C_XpG63jYw/SAgrxtkt56I/AAAAAAAAACc/pr7-vuTQS5w/S220/P1170634+(Small).JPG'/></author><thr:total>7</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7660917028131688558.post-5247424618837418563</id><published>2009-05-12T15:40:00.000+05:30</published><updated>2009-05-12T16:53:04.242+05:30</updated><title type='text'></title><content type='html'>http://blog.beetlebugsoftware.com/post/104154581/face-detection-iphone-source#disqus_thread&lt;br /&gt;&lt;br /&gt;http://iphonedevelopertips.com/&lt;br /&gt;&lt;br /&gt;http://cocoawithlove.com/&lt;br /&gt;&lt;br /&gt;http://www.fieryrobot.com/blog/&lt;br /&gt;&lt;br /&gt;http://www.iphoneflow.com/&lt;br /&gt;&lt;br /&gt;http://www.insanelymac.com/forum/index.php?showtopic=95195&lt;br /&gt;&lt;br /&gt;http://www.71squared.co.uk/2008/12/custom-button-in-uitableviewcell-indexpath/&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7660917028131688558-5247424618837418563?l=jainmarket.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://jainmarket.blogspot.com/feeds/5247424618837418563/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7660917028131688558&amp;postID=5247424618837418563' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7660917028131688558/posts/default/5247424618837418563'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7660917028131688558/posts/default/5247424618837418563'/><link rel='alternate' type='text/html' href='http://jainmarket.blogspot.com/2009/05/httpblog.html' title=''/><author><name>Rahul Vyas</name><uri>http://www.blogger.com/profile/08326955903115378266</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://bp1.blogger.com/_6C_XpG63jYw/SAgrxtkt56I/AAAAAAAAACc/pr7-vuTQS5w/S220/P1170634+(Small).JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7660917028131688558.post-7917458012318205431</id><published>2009-05-08T17:43:00.000+05:30</published><updated>2009-05-08T17:46:30.858+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='IPHONE'/><title type='text'>Displaying a password or text entry prompt on the iPhone</title><content type='html'>&lt;h2&gt;&lt;span class="arrow"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/h2&gt;        &lt;div class="entryinfo"&gt;     &lt;a href="http://junecloud.com/journal/iphone/"&gt;&lt;br /&gt;&lt;/a&gt;    &lt;/div&gt;              &lt;div class="image border"&gt;&lt;img alt="" src="http://junecloud.com/images/entries/20081028_7324.jpg" height="368" width="480" /&gt;&lt;/div&gt;       &lt;div class="entrytext"&gt;    &lt;div class="caption"&gt;Writing your own iPhone or iPod touch app, and wondering how to create an alert like this? Check out the sample code below.&lt;/div&gt;  &lt;p&gt;I needed to display a password prompt in &lt;a href="http://junecloud.com/software/iphone/delivery-status-touch.html"&gt;Delivery Status touch&lt;/a&gt; and quickly found that there was no ideal way to do it. There are some unsupported methods, but the workaround below—adding a UITextField as a subview of the alert—is the proper method for a third party app, according to Apple.&lt;/p&gt;  &lt;p&gt;Aside from the basic technique of adding a UITextField as a subview, there are two other things I struggled with. First, if the text given for the message was too long it would wrap to a second line and appear partially underneath the text field. I worked around this problem by adding my own UILabel subview. The custom label is a single line so you’ll get the standard ellipsis (…) if the text is too long. For the message text I just supply three blank lines, which makes the alert large enough to display the contents. It’s a clunky way to resize the alert, but it works.&lt;/p&gt;  &lt;p&gt;The other thing I struggled with was getting the text field to match what Apple uses. The standard beveled edge looks okay, but Apple’s own password prompts have a field that’s customized specifically for alerts. My solution was to insert an image, and display the text field, without a border, on top of it.&lt;br /&gt;&lt;/p&gt;  &lt;p&gt;Using those tricks, here’s the complete code I’m using to display a password prompt:&lt;/p&gt;  &lt;blockquote&gt;&lt;code&gt;UIAlertView *passwordAlert = [[UIAlertView alloc] initWithTitle:@“Server Password” message:@”\n\n\n”&lt;br /&gt;delegate:self cancelButtonTitle:NSLocalizedString(@“Cancel”,nil) otherButtonTitles:NSLocalizedString(@“OK”,nil), nil];&lt;br /&gt;&lt;br /&gt;UILabel *passwordLabel = [[UILabel alloc] initWithFrame:CGRectMake(12,40,260,25)];&lt;br /&gt;passwordLabel.font = [UIFont systemFontOfSize:16];&lt;br /&gt;passwordLabel.textColor = [UIColor whiteColor];&lt;br /&gt;passwordLabel.backgroundColor = [UIColor clearColor];&lt;br /&gt;passwordLabel.shadowColor = [UIColor blackColor];&lt;br /&gt;passwordLabel.shadowOffset = CGSizeMake(0,-1);&lt;br /&gt;passwordLabel.textAlignment = UITextAlignmentCenter;&lt;br /&gt;passwordLabel.text = @“Account Name”;&lt;br /&gt;[passwordAlert addSubview:passwordLabel];&lt;br /&gt;&lt;br /&gt;UIImageView *passwordImage = [[UIImageView alloc] initWithImage:[UIImage imageWithContentsOfFile:[[NSBundle mainBundle] pathForResource:@“passwordfield” ofType:@“png”]]];&lt;br /&gt;passwordImage.frame = CGRectMake(11,79,262,31);&lt;br /&gt;[passwordAlert addSubview:passwordImage];&lt;br /&gt;&lt;br /&gt;UITextField *passwordField = [[UITextField alloc] initWithFrame:CGRectMake(16,83,252,25)];&lt;br /&gt;passwordField.font = [UIFont systemFontOfSize:18];&lt;br /&gt;passwordField.backgroundColor = [UIColor whiteColor];&lt;br /&gt;passwordField.secureTextEntry = YES;&lt;br /&gt;passwordField.keyboardAppearance = UIKeyboardAppearanceAlert;&lt;br /&gt;passwordField.delegate = self;&lt;br /&gt;[passwordField becomeFirstResponder];&lt;br /&gt;[passwordAlert addSubview:passwordField];&lt;br /&gt;&lt;br /&gt;[passwordAlert setTransform:CGAffineTransformMakeTranslation(0,109)];&lt;br /&gt;[passwordAlert show];&lt;br /&gt;[passwordAlert release];&lt;br /&gt;[passwordField release];&lt;br /&gt;[passwordImage release];&lt;br /&gt;[passwordLabel release];&lt;/code&gt;&lt;/blockquote&gt;  &lt;p&gt;You can see the result of this code in the screenshot above. It can be customized fairly easily, if you need another type of text entry, more lines of text, or some other change. (Remove the secureTextEntry line or change the keyboardAppearance to customize the text entry field.)&lt;/p&gt;  &lt;p&gt;I spent quite a bit of time getting it as pixel-perfect as possible. The only real difference is that it’s a few pixels taller than Apple’s, because of the imprecise way I’m sizing the alert. I think it’s fair to say most people would never notice! I’d love to see a more simplified, official method for creating these alerts, but in the meantime I’m pretty pleased with this solution. If you have any suggestions for improvements, let me know in the comments!&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;the original post is here&lt;/p&gt;&lt;p&gt;http://junecloud.com/journal/code/displaying-a-password-or-text-entry-prompt-on-the-iphone.html&lt;br /&gt;&lt;/p&gt;   &lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7660917028131688558-7917458012318205431?l=jainmarket.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://jainmarket.blogspot.com/feeds/7917458012318205431/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7660917028131688558&amp;postID=7917458012318205431' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7660917028131688558/posts/default/7917458012318205431'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7660917028131688558/posts/default/7917458012318205431'/><link rel='alternate' type='text/html' href='http://jainmarket.blogspot.com/2009/05/displaying-password-or-text-entry.html' title='Displaying a password or text entry prompt on the iPhone'/><author><name>Rahul Vyas</name><uri>http://www.blogger.com/profile/08326955903115378266</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://bp1.blogger.com/_6C_XpG63jYw/SAgrxtkt56I/AAAAAAAAACc/pr7-vuTQS5w/S220/P1170634+(Small).JPG'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7660917028131688558.post-9209755951177252691</id><published>2009-05-02T13:11:00.000+05:30</published><updated>2009-05-02T13:22:39.509+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='IPHONE'/><title type='text'>Creating a custom Table View Cell programmatically</title><content type='html'>&lt;p&gt;Ohhk, quite a lot of things done but this one is something which I have used most often. Custom cells can sometimes greatly push ahead the usability of your application. In this post I am going to create a test project which will demonstrate how to create custom cells and use them appropriately to provide better usability. The application will finally look like this:&lt;/p&gt;   &lt;div&gt;&lt;a href="http://2.bp.blogspot.com/_pV2VnLyRiRE/SfcJL4OhSYI/AAAAAAAAATE/4debKHb4Aqw/s1600-h/screen-capture.jpg" onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}"&gt;&lt;img id="BLOGGER_PHOTO_ID_5329738783692769666" style="cursor: pointer; width: 211px; height: 400px;" src="http://2.bp.blogspot.com/_pV2VnLyRiRE/SfcJL4OhSYI/AAAAAAAAATE/4debKHb4Aqw/s400/screen-capture.jpg" alt="" border="0" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;span id="more-284"&gt;&lt;/span&gt;&lt;br /&gt;So to start open xcode and create a new project, chose the template as “Navigation Based” and name it as “CustomCellTestProject”. What template you chose does not matter, refer my previous posts to find how you can start working on any template. &lt;div&gt;First thing we will do is create a customCell. Right click on Classes and add a new UITableViewCell subclass. Name it as “CustomCell”. Now open CustomCell.h and add the following code:&lt;/div&gt;   &lt;p style="margin: 0px; font-family: Monaco; font-style: normal; font-variant: normal; font-weight: normal; font-size: 10px; line-height: normal; font-size-adjust: none; font-stretch: normal; color: rgb(196, 26, 22);"&gt;&lt;span style="color: rgb(100, 56, 32);"&gt;#import &lt;span style="color: rgb(255, 0, 0);"&gt;&lt;uikit/uikit.h&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt; &lt;p style="margin: 0px; font-family: Monaco; font-style: normal; font-variant: normal; font-weight: normal; font-size: 10px; line-height: normal; font-size-adjust: none; font-stretch: normal; min-height: 14px;"&gt; &lt;/p&gt; &lt;p style="margin: 0px; font-family: Monaco; font-style: normal; font-variant: normal; font-weight: normal; font-size: 10px; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;&lt;span style="color: rgb(170, 13, 145);"&gt;@interface&lt;/span&gt; CustomCell : UITableViewCell {&lt;/p&gt; &lt;p style="margin: 0px; font-family: Monaco; font-style: normal; font-variant: normal; font-weight: normal; font-size: 10px; line-height: normal; font-size-adjust: none; font-stretch: normal; color: rgb(63, 110, 116);"&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;&lt;span style="white-space: pre;"&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style="color: rgb(92, 38, 153);"&gt;UILabel&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; *&lt;/span&gt;primaryLabel&lt;span style="color: rgb(0, 0, 0);"&gt;;&lt;/span&gt;&lt;/p&gt; &lt;p style="margin: 0px; font-family: Monaco; font-style: normal; font-variant: normal; font-weight: normal; font-size: 10px; line-height: normal; font-size-adjust: none; font-stretch: normal; color: rgb(63, 110, 116);"&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;&lt;span style="white-space: pre;"&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style="color: rgb(92, 38, 153);"&gt;UILabel&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; *&lt;/span&gt;secondaryLabel&lt;span style="color: rgb(0, 0, 0);"&gt;;&lt;/span&gt;&lt;/p&gt; &lt;p style="margin: 0px; font-family: Monaco; font-style: normal; font-variant: normal; font-weight: normal; font-size: 10px; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;&lt;span style="white-space: pre;"&gt; &lt;/span&gt;&lt;span style="color: rgb(92, 38, 153);"&gt;UIImageView&lt;/span&gt; *myImageView;&lt;/p&gt; &lt;p style="margin: 0px; font-family: Monaco; font-style: normal; font-variant: normal; font-weight: normal; font-size: 10px; line-height: normal; font-size-adjust: none; font-stretch: normal; min-height: 14px;"&gt; &lt;/p&gt; &lt;p style="margin: 0px; font-family: Monaco; font-style: normal; font-variant: normal; font-weight: normal; font-size: 10px; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;}&lt;/p&gt; &lt;p style="margin: 0px; font-family: Monaco; font-style: normal; font-variant: normal; font-weight: normal; font-size: 10px; line-height: normal; font-size-adjust: none; font-stretch: normal; color: rgb(170, 13, 145);"&gt;@property&lt;span style="color: rgb(0, 0, 0);"&gt;(&lt;/span&gt;nonatomic&lt;span style="color: rgb(0, 0, 0);"&gt;,&lt;/span&gt;retain&lt;span style="color: rgb(0, 0, 0);"&gt;)&lt;/span&gt;&lt;span style="color: rgb(92, 38, 153);"&gt;UILabel&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; *&lt;/span&gt;&lt;span style="color: rgb(63, 110, 116);"&gt;primaryLabel&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;;&lt;/span&gt;&lt;/p&gt; &lt;p style="margin: 0px; font-family: Monaco; font-style: normal; font-variant: normal; font-weight: normal; font-size: 10px; line-height: normal; font-size-adjust: none; font-stretch: normal; color: rgb(170, 13, 145);"&gt;@property&lt;span style="color: rgb(0, 0, 0);"&gt;(&lt;/span&gt;nonatomic&lt;span style="color: rgb(0, 0, 0);"&gt;,&lt;/span&gt;retain&lt;span style="color: rgb(0, 0, 0);"&gt;)&lt;/span&gt;&lt;span style="color: rgb(92, 38, 153);"&gt;UILabel&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; *&lt;/span&gt;&lt;span style="color: rgb(63, 110, 116);"&gt;secondaryLabel&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;;&lt;/span&gt;&lt;/p&gt; &lt;p style="margin: 0px; font-family: Monaco; font-style: normal; font-variant: normal; font-weight: normal; font-size: 10px; line-height: normal; font-size-adjust: none; font-stretch: normal; color: rgb(170, 13, 145);"&gt;@property&lt;span style="color: rgb(0, 0, 0);"&gt;(&lt;/span&gt;nonatomic&lt;span style="color: rgb(0, 0, 0);"&gt;,&lt;/span&gt;retain&lt;span style="color: rgb(0, 0, 0);"&gt;)&lt;/span&gt;&lt;span style="color: rgb(92, 38, 153);"&gt;UIImageView&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; *myImageView;&lt;/span&gt;&lt;/p&gt; &lt;p style="margin: 0px; font-family: Monaco; font-style: normal; font-variant: normal; font-weight: normal; font-size: 10px; line-height: normal; font-size-adjust: none; font-stretch: normal; color: rgb(170, 13, 145);"&gt;@end&lt;/p&gt; &lt;div&gt;&lt;span style="color: rgb(170, 13, 145); font-family: Monaco; font-size: 10px;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;div&gt;We create the three elements and added them to the contentView of our cell.&lt;br /&gt;synthesize all the three elements in CustomCell.m as we are going to access these elements from other classes.&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;  &lt;div&gt; &lt;p style="margin: 0px; font-family: Monaco; font-style: normal; font-variant: normal; font-weight: normal; font-size: 10px; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;&lt;span style="color: rgb(170, 13, 145);"&gt;@synthesize&lt;/span&gt; primaryLabel,secondaryLabel,myImageView;&lt;/p&gt;&lt;/div&gt;&lt;br /&gt;&lt;/div&gt; &lt;div&gt;Here we have simply added a primary label to display the primary text, a secondary label and an imageView. These elements will be created and added into the content view of our custom cell. So open CustomCell.m and add the following code&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;  &lt;div&gt; &lt;p style="margin: 0px; font-family: Monaco; font-style: normal; font-variant: normal; font-weight: normal; font-size: 10px; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;- (&lt;span style="color: rgb(170, 13, 145);"&gt;id&lt;/span&gt;)initWithFrame:(&lt;span style="color: rgb(92, 38, 153);"&gt;CGRect&lt;/span&gt;)frame reuseIdentifier:(&lt;span style="color: rgb(92, 38, 153);"&gt;NSString&lt;/span&gt; *)reuseIdentifier {&lt;/p&gt; &lt;p style="margin: 0px; font-family: Monaco; font-style: normal; font-variant: normal; font-weight: normal; font-size: 10px; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;&lt;span style="color: rgb(170, 13, 145);"&gt;if&lt;/span&gt; (&lt;span style="color: rgb(170, 13, 145);"&gt;self&lt;/span&gt; = [&lt;span style="color: rgb(170, 13, 145);"&gt;super&lt;/span&gt; &lt;span style="color: rgb(46, 13, 110);"&gt;initWithFrame&lt;/span&gt;:frame &lt;span style="color: rgb(46, 13, 110);"&gt;reuseIdentifier&lt;/span&gt;:reuseIdentifier]) {&lt;/p&gt; &lt;p style="margin: 0px; font-family: Monaco; font-style: normal; font-variant: normal; font-weight: normal; font-size: 10px; line-height: normal; font-size-adjust: none; font-stretch: normal; color: rgb(0, 116, 0);"&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;// Initialization code&lt;/p&gt; &lt;p style="margin: 0px; font-family: Monaco; font-style: normal; font-variant: normal; font-weight: normal; font-size: 10px; line-height: normal; font-size-adjust: none; font-stretch: normal; color: rgb(63, 110, 116);"&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;&lt;span style="white-space: pre;"&gt; &lt;/span&gt;&lt;/span&gt;primaryLabel&lt;span style="color: rgb(0, 0, 0);"&gt; = [[&lt;/span&gt;&lt;span style="color: rgb(92, 38, 153);"&gt;UILabel&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(46, 13, 110);"&gt;alloc&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;]&lt;/span&gt;&lt;span style="color: rgb(46, 13, 110);"&gt;init&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;];&lt;/span&gt;&lt;/p&gt; &lt;p style="margin: 0px; font-family: Monaco; font-style: normal; font-variant: normal; font-weight: normal; font-size: 10px; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;&lt;span style="white-space: pre;"&gt; &lt;/span&gt;&lt;span style="color: rgb(63, 110, 116);"&gt;primaryLabel&lt;/span&gt;.textAlignment = &lt;span style="color: rgb(46, 13, 110);"&gt;UITextAlignmentLeft&lt;/span&gt;;&lt;/p&gt; &lt;p style="margin: 0px; font-family: Monaco; font-style: normal; font-variant: normal; font-weight: normal; font-size: 10px; line-height: normal; font-size-adjust: none; font-stretch: normal; color: rgb(46, 13, 110);"&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;&lt;span style="white-space: pre;"&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style="color: rgb(63, 110, 116);"&gt;primaryLabel&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;.font = [&lt;/span&gt;&lt;span style="color: rgb(92, 38, 153);"&gt;UIFont&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;systemFontOfSize&lt;span style="color: rgb(0, 0, 0);"&gt;:&lt;/span&gt;&lt;span style="color: rgb(28, 0, 207);"&gt;14&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;];&lt;/span&gt;&lt;/p&gt; &lt;p style="margin: 0px; font-family: Monaco; font-style: normal; font-variant: normal; font-weight: normal; font-size: 10px; line-height: normal; font-size-adjust: none; font-stretch: normal; color: rgb(63, 110, 116);"&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;&lt;span style="white-space: pre;"&gt; &lt;/span&gt;&lt;/span&gt;secondaryLabel&lt;span style="color: rgb(0, 0, 0);"&gt; = [[&lt;/span&gt;&lt;span style="color: rgb(92, 38, 153);"&gt;UILabel&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(46, 13, 110);"&gt;alloc&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;]&lt;/span&gt;&lt;span style="color: rgb(46, 13, 110);"&gt;init&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;];&lt;/span&gt;&lt;/p&gt; &lt;p style="margin: 0px; font-family: Monaco; font-style: normal; font-variant: normal; font-weight: normal; font-size: 10px; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;&lt;span style="white-space: pre;"&gt; &lt;/span&gt;&lt;span style="color: rgb(63, 110, 116);"&gt;secondaryLabel&lt;/span&gt;.textAlignment = &lt;span style="color: rgb(46, 13, 110);"&gt;UITextAlignmentLeft&lt;/span&gt;;&lt;/p&gt; &lt;p style="margin: 0px; font-family: Monaco; font-style: normal; font-variant: normal; font-weight: normal; font-size: 10px; line-height: normal; font-size-adjust: none; font-stretch: normal; color: rgb(46, 13, 110);"&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;&lt;span style="white-space: pre;"&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style="color: rgb(63, 110, 116);"&gt;secondaryLabel&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;.font = [&lt;/span&gt;&lt;span style="color: rgb(92, 38, 153);"&gt;UIFont&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;systemFontOfSize&lt;span style="color: rgb(0, 0, 0);"&gt;:&lt;/span&gt;&lt;span style="color: rgb(28, 0, 207);"&gt;8&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;];&lt;/span&gt;&lt;/p&gt; &lt;p style="margin: 0px; font-family: Monaco; font-style: normal; font-variant: normal; font-weight: normal; font-size: 10px; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;&lt;span style="white-space: pre;"&gt; &lt;/span&gt;&lt;span style="color: rgb(63, 110, 116);"&gt;myImageView&lt;/span&gt; = [[&lt;span style="color: rgb(92, 38, 153);"&gt;UIImageView&lt;/span&gt; &lt;span style="color: rgb(46, 13, 110);"&gt;alloc&lt;/span&gt;]&lt;span style="color: rgb(46, 13, 110);"&gt;init&lt;/span&gt;];&lt;/p&gt; &lt;p style="margin: 0px; font-family: Monaco; font-style: normal; font-variant: normal; font-weight: normal; font-size: 10px; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;&lt;span style="white-space: pre;"&gt; &lt;/span&gt;[&lt;span style="color: rgb(170, 13, 145);"&gt;self&lt;/span&gt;.contentView &lt;span style="color: rgb(46, 13, 110);"&gt;addSubview&lt;/span&gt;:&lt;span style="color: rgb(63, 110, 116);"&gt;primaryLabel&lt;/span&gt;];&lt;/p&gt; &lt;p style="margin: 0px; font-family: Monaco; font-style: normal; font-variant: normal; font-weight: normal; font-size: 10px; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;&lt;span style="white-space: pre;"&gt; &lt;/span&gt;[&lt;span style="color: rgb(170, 13, 145);"&gt;self&lt;/span&gt;.contentView &lt;span style="color: rgb(46, 13, 110);"&gt;addSubview&lt;/span&gt;:&lt;span style="color: rgb(63, 110, 116);"&gt;secondaryLabel&lt;/span&gt;];&lt;/p&gt; &lt;p style="margin: 0px; font-family: Monaco; font-style: normal; font-variant: normal; font-weight: normal; font-size: 10px; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;&lt;span style="white-space: pre;"&gt; &lt;/span&gt;[&lt;span style="color: rgb(170, 13, 145);"&gt;self&lt;/span&gt;.contentView &lt;span style="color: rgb(46, 13, 110);"&gt;addSubview&lt;/span&gt;:&lt;span style="color: rgb(63, 110, 116);"&gt;myImageView&lt;/span&gt;];&lt;/p&gt; &lt;p style="margin: 0px; font-family: Monaco; font-style: normal; font-variant: normal; font-weight: normal; font-size: 10px; line-height: normal; font-size-adjust: none; font-stretch: normal; min-height: 14px;"&gt;&lt;span style="white-space: pre;"&gt; &lt;/span&gt;&lt;/p&gt; &lt;p style="margin: 0px; font-family: Monaco; font-style: normal; font-variant: normal; font-weight: normal; font-size: 10px; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;}&lt;/p&gt; &lt;p style="margin: 0px; font-family: Monaco; font-style: normal; font-variant: normal; font-weight: normal; font-size: 10px; line-height: normal; font-size-adjust: none; font-stretch: normal; color: rgb(170, 13, 145);"&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;return&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;self&lt;span style="color: rgb(0, 0, 0);"&gt;;&lt;/span&gt;&lt;/p&gt; &lt;p style="margin: 0px; font-family: Monaco; font-style: normal; font-variant: normal; font-weight: normal; font-size: 10px; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;}&lt;/p&gt; &lt;div&gt;&lt;span style="font-family: Monaco; font-size: 10px;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt; &lt;/div&gt;&lt;br /&gt;&lt;div&gt;&lt;p style="margin: 0px; font-family: Monaco; font-style: normal; font-variant: normal; font-weight: normal; font-size: 10px; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt; &lt;/p&gt; &lt;/div&gt; &lt;div&gt;Now, we have already added the UI elements into our cell but you must have noticed, we have not yet defined how these elements will appear inside cell. Go ahead and add the following code for that:&lt;/div&gt;  &lt;div&gt; &lt;p style="margin: 0px; font-family: Monaco; font-style: normal; font-variant: normal; font-weight: normal; font-size: 10px; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;- (&lt;span style="color: rgb(170, 13, 145);"&gt;void&lt;/span&gt;)layoutSubviews {&lt;/p&gt; &lt;p style="margin: 0px; font-family: Monaco; font-style: normal; font-variant: normal; font-weight: normal; font-size: 10px; line-height: normal; font-size-adjust: none; font-stretch: normal; color: rgb(46, 13, 110);"&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; [&lt;/span&gt;&lt;span style="color: rgb(170, 13, 145);"&gt;super&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;layoutSubviews&lt;span style="color: rgb(0, 0, 0);"&gt;];&lt;/span&gt;&lt;/p&gt; &lt;p style="margin: 0px; font-family: Monaco; font-style: normal; font-variant: normal; font-weight: normal; font-size: 10px; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;&lt;span style="white-space: pre;"&gt; &lt;/span&gt;&lt;span style="color: rgb(92, 38, 153);"&gt;CGRect&lt;/span&gt; contentRect = &lt;span style="color: rgb(170, 13, 145);"&gt;self&lt;/span&gt;.contentView.bounds;&lt;/p&gt; &lt;p style="margin: 0px; font-family: Monaco; font-style: normal; font-variant: normal; font-weight: normal; font-size: 10px; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;&lt;span style="white-space: pre;"&gt; &lt;/span&gt;&lt;span style="color: rgb(92, 38, 153);"&gt;CGFloat&lt;/span&gt; boundsX = contentRect.&lt;span style="color: rgb(92, 38, 153);"&gt;origin&lt;/span&gt;.&lt;span style="color: rgb(92, 38, 153);"&gt;x&lt;/span&gt;;&lt;/p&gt; &lt;p style="margin: 0px; font-family: Monaco; font-style: normal; font-variant: normal; font-weight: normal; font-size: 10px; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;&lt;span style="white-space: pre;"&gt; &lt;/span&gt;&lt;span style="color: rgb(92, 38, 153);"&gt;CGRect&lt;/span&gt; frame;&lt;/p&gt; &lt;p style="margin: 0px; font-family: Monaco; font-style: normal; font-variant: normal; font-weight: normal; font-size: 10px; line-height: normal; font-size-adjust: none; font-stretch: normal; min-height: 14px;"&gt; &lt;/p&gt; &lt;p style="margin: 0px; font-family: Monaco; font-style: normal; font-variant: normal; font-weight: normal; font-size: 10px; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;&lt;span style="white-space: pre;"&gt; &lt;/span&gt;frame= &lt;span style="color: rgb(46, 13, 110);"&gt;CGRectMake&lt;/span&gt;(boundsX+&lt;span style="color: rgb(28, 0, 207);"&gt;10&lt;/span&gt; ,&lt;span style="color: rgb(28, 0, 207);"&gt;0&lt;/span&gt;, &lt;span style="color: rgb(28, 0, 207);"&gt;50&lt;/span&gt;, &lt;span style="color: rgb(28, 0, 207);"&gt;50&lt;/span&gt;);&lt;/p&gt; &lt;p style="margin: 0px; font-family: Monaco; font-style: normal; font-variant: normal; font-weight: normal; font-size: 10px; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;&lt;span style="white-space: pre;"&gt; &lt;/span&gt;&lt;span style="color: rgb(63, 110, 116);"&gt;myImageView&lt;/span&gt;.frame = frame;&lt;/p&gt; &lt;p style="margin: 0px; font-family: Monaco; font-style: normal; font-variant: normal; font-weight: normal; font-size: 10px; line-height: normal; font-size-adjust: none; font-stretch: normal; min-height: 14px;"&gt;&lt;span style="white-space: pre;"&gt; &lt;/span&gt;&lt;/p&gt; &lt;p style="margin: 0px; font-family: Monaco; font-style: normal; font-variant: normal; font-weight: normal; font-size: 10px; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;&lt;span style="white-space: pre;"&gt; &lt;/span&gt;frame= &lt;span style="color: rgb(46, 13, 110);"&gt;CGRectMake&lt;/span&gt;(boundsX+&lt;span style="color: rgb(28, 0, 207);"&gt;70&lt;/span&gt; ,&lt;span style="color: rgb(28, 0, 207);"&gt;5&lt;/span&gt;, &lt;span style="color: rgb(28, 0, 207);"&gt;200&lt;/span&gt;, &lt;span style="color: rgb(28, 0, 207);"&gt;25&lt;/span&gt;);&lt;/p&gt; &lt;p style="margin: 0px; font-family: Monaco; font-style: normal; font-variant: normal; font-weight: normal; font-size: 10px; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;&lt;span style="white-space: pre;"&gt; &lt;/span&gt;&lt;span style="color: rgb(63, 110, 116);"&gt;primaryLabel&lt;/span&gt;.frame = frame;&lt;/p&gt; &lt;p style="margin: 0px; font-family: Monaco; font-style: normal; font-variant: normal; font-weight: normal; font-size: 10px; line-height: normal; font-size-adjust: none; font-stretch: normal; min-height: 14px;"&gt;&lt;span style="white-space: pre;"&gt; &lt;/span&gt;&lt;/p&gt; &lt;p style="margin: 0px; font-family: Monaco; font-style: normal; font-variant: normal; font-weight: normal; font-size: 10px; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;&lt;span style="white-space: pre;"&gt; &lt;/span&gt;frame= &lt;span style="color: rgb(46, 13, 110);"&gt;CGRectMake&lt;/span&gt;(boundsX+&lt;span style="color: rgb(28, 0, 207);"&gt;70&lt;/span&gt; ,&lt;span style="color: rgb(28, 0, 207);"&gt;30&lt;/span&gt;, &lt;span style="color: rgb(28, 0, 207);"&gt;100&lt;/span&gt;, &lt;span style="color: rgb(28, 0, 207);"&gt;15&lt;/span&gt;);&lt;/p&gt; &lt;p style="margin: 0px; font-family: Monaco; font-style: normal; font-variant: normal; font-weight: normal; font-size: 10px; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;&lt;span style="white-space: pre;"&gt; &lt;/span&gt;&lt;span style="color: rgb(63, 110, 116);"&gt;secondaryLabel&lt;/span&gt;.frame = frame;&lt;/p&gt; &lt;p style="margin: 0px; font-family: Monaco; font-style: normal; font-variant: normal; font-weight: normal; font-size: 10px; line-height: normal; font-size-adjust: none; font-stretch: normal; min-height: 14px;"&gt; &lt;/p&gt; &lt;p style="margin: 0px; font-family: Monaco; font-style: normal; font-variant: normal; font-weight: normal; font-size: 10px; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;}&lt;/p&gt; &lt;div&gt;&lt;span style="font-family: Monaco; font-size: 10px;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt; &lt;/div&gt; &lt;div&gt;You can do anything in this method to define the lay out of cell. I have simply assigned frames to all the elements.&lt;/div&gt; &lt;div&gt;You can also find a method in CustomCell.m&lt;/div&gt;  &lt;div&gt; &lt;p style="margin: 0px; font-family: Monaco; font-style: normal; font-variant: normal; font-weight: normal; font-size: 10px; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;- (&lt;span style="color: rgb(170, 13, 145);"&gt;void&lt;/span&gt;)setSelected:(&lt;span style="color: rgb(170, 13, 145);"&gt;BOOL&lt;/span&gt;)selected animated:(&lt;span style="color: rgb(170, 13, 145);"&gt;BOOL&lt;/span&gt;)animated {&lt;/p&gt; &lt;p style="margin: 0px; font-family: Monaco; font-style: normal; font-variant: normal; font-weight: normal; font-size: 10px; line-height: normal; font-size-adjust: none; font-stretch: normal; min-height: 14px;"&gt; &lt;/p&gt; &lt;p style="margin: 0px; font-family: Monaco; font-style: normal; font-variant: normal; font-weight: normal; font-size: 10px; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;[&lt;span style="color: rgb(170, 13, 145);"&gt;super&lt;/span&gt; &lt;span style="color: rgb(46, 13, 110);"&gt;setSelected&lt;/span&gt;:selected &lt;span style="color: rgb(46, 13, 110);"&gt;animated&lt;/span&gt;:animated];&lt;/p&gt; &lt;p style="margin: 0px; font-family: Monaco; font-style: normal; font-variant: normal; font-weight: normal; font-size: 10px; line-height: normal; font-size-adjust: none; font-stretch: normal; min-height: 14px;"&gt; &lt;/p&gt; &lt;p style="margin: 0px; font-family: Monaco; font-style: normal; font-variant: normal; font-weight: normal; font-size: 10px; line-height: normal; font-size-adjust: none; font-stretch: normal; color: rgb(0, 116, 0);"&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;// Configure the view for the selected state&lt;/p&gt; &lt;p style="margin: 0px; font-family: Monaco; font-style: normal; font-variant: normal; font-weight: normal; font-size: 10px; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;}&lt;/p&gt; &lt;/div&gt;  &lt;div&gt;This method can be used to define how your cell should react when it is selected. You can describe what should be the highlight color or may be you want to flash one of the labels anything of your choice. I am leaving this method as it is.&lt;/div&gt;  &lt;div&gt;We are done with creating our custom cell and now we have to use it. Open RootViewController.m and import CustomCell.h at the top.&lt;/div&gt; &lt;div&gt; &lt;p style="margin: 0px; font-family: Monaco; font-style: normal; font-variant: normal; font-weight: normal; font-size: 10px; line-height: normal; font-size-adjust: none; font-stretch: normal; color: rgb(196, 26, 22);"&gt;&lt;span style="color: rgb(100, 56, 32);"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/p&gt; &lt;p style="margin: 0px; font-family: Monaco; font-style: normal; font-variant: normal; font-weight: normal; font-size: 10px; line-height: normal; font-size-adjust: none; font-stretch: normal; color: rgb(196, 26, 22);"&gt;&lt;span style="color: rgb(100, 56, 32);"&gt;#import &lt;/span&gt;“CustomCell.h”&lt;/p&gt; &lt;/div&gt;  &lt;div&gt;I am going to create 5 cells here, you can just use your own logic of specifying number of cells and data. So change the following method to look like this:&lt;/div&gt;  &lt;div&gt; &lt;p style="margin: 0px; font-family: Monaco; font-style: normal; font-variant: normal; font-weight: normal; font-size: 10px; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;- (&lt;span style="color: rgb(92, 38, 153);"&gt;NSInteger&lt;/span&gt;)tableView:(&lt;span style="color: rgb(92, 38, 153);"&gt;UITableView&lt;/span&gt; *)tableView numberOfRowsInSection:(&lt;span style="color: rgb(92, 38, 153);"&gt;NSInteger&lt;/span&gt;)section {&lt;/p&gt; &lt;p style="margin: 0px; font-family: Monaco; font-style: normal; font-variant: normal; font-weight: normal; font-size: 10px; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;&lt;span style="color: rgb(170, 13, 145);"&gt;return&lt;/span&gt; &lt;span style="color: rgb(28, 0, 207);"&gt;5&lt;/span&gt;;&lt;/p&gt; &lt;p style="margin: 0px; font-family: Monaco; font-style: normal; font-variant: normal; font-weight: normal; font-size: 10px; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;}&lt;/p&gt; &lt;/div&gt;  &lt;div&gt;Now we are going to use our custom cell. If you look at the cellForRow method, you will find that a UItableViewCell has been created and re used. Now all we have to do is to replace this cell with our new cell. Change the code inside this method to look like this:&lt;/div&gt;  &lt;div&gt; &lt;p style="margin: 0px; font-family: Monaco; font-style: normal; font-variant: normal; font-weight: normal; font-size: 10px; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;- (&lt;span style="color: rgb(92, 38, 153);"&gt;UITableViewCell&lt;/span&gt; *)tableView:(&lt;span style="color: rgb(92, 38, 153);"&gt;UITableView&lt;/span&gt; *)tableView cellForRowAtIndexPath:(&lt;span style="color: rgb(92, 38, 153);"&gt;NSIndexPath&lt;/span&gt; *)indexPath {&lt;/p&gt; &lt;p style="margin: 0px; font-family: Monaco; font-style: normal; font-variant: normal; font-weight: normal; font-size: 10px; line-height: normal; font-size-adjust: none; font-stretch: normal; min-height: 14px;"&gt; &lt;/p&gt; &lt;p style="margin: 0px; font-family: Monaco; font-style: normal; font-variant: normal; font-weight: normal; font-size: 10px; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;&lt;span style="color: rgb(170, 13, 145);"&gt;static&lt;/span&gt; &lt;span style="color: rgb(92, 38, 153);"&gt;NSString&lt;/span&gt; *CellIdentifier = &lt;span style="color: rgb(196, 26, 22);"&gt;@”Cell”&lt;/span&gt;;&lt;/p&gt; &lt;p style="margin: 0px; font-family: Monaco; font-style: normal; font-variant: normal; font-weight: normal; font-size: 10px; line-height: normal; font-size-adjust: none; font-stretch: normal; min-height: 14px;"&gt; &lt;/p&gt; &lt;p style="margin: 0px; font-family: Monaco; font-style: normal; font-variant: normal; font-weight: normal; font-size: 10px; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;&lt;span style="color: rgb(63, 110, 116);"&gt;CustomCell&lt;/span&gt; *cell = [tableView &lt;span style="color: rgb(46, 13, 110);"&gt;dequeueReusableCellWithIdentifier&lt;/span&gt;:CellIdentifier];&lt;/p&gt; &lt;p style="margin: 0px; font-family: Monaco; font-style: normal; font-variant: normal; font-weight: normal; font-size: 10px; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;&lt;span style="color: rgb(170, 13, 145);"&gt;if&lt;/span&gt; (cell == &lt;span style="color: rgb(170, 13, 145);"&gt;nil&lt;/span&gt;) {&lt;/p&gt; &lt;p style="margin: 0px; font-family: Monaco; font-style: normal; font-variant: normal; font-weight: normal; font-size: 10px; line-height: normal; font-size-adjust: none; font-stretch: normal; color: rgb(46, 13, 110);"&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; cell = [[[&lt;/span&gt;&lt;span style="color: rgb(63, 110, 116);"&gt;CustomCell&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;alloc&lt;span style="color: rgb(0, 0, 0);"&gt;] &lt;/span&gt;initWithFrame&lt;span style="color: rgb(0, 0, 0);"&gt;:&lt;/span&gt;&lt;span style="color: rgb(92, 38, 153);"&gt;CGRectZero&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;reuseIdentifier&lt;span style="color: rgb(0, 0, 0);"&gt;:CellIdentifier] &lt;/span&gt;autorelease&lt;span style="color: rgb(0, 0, 0);"&gt;];&lt;/span&gt;&lt;/p&gt; &lt;p style="margin: 0px; font-family: Monaco; font-style: normal; font-variant: normal; font-weight: normal; font-size: 10px; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;}&lt;/p&gt; &lt;p style="margin: 0px; font-family: Monaco; font-style: normal; font-variant: normal; font-weight: normal; font-size: 10px; line-height: normal; font-size-adjust: none; font-stretch: normal; min-height: 14px;"&gt;&lt;span style="white-space: pre;"&gt; &lt;/span&gt;&lt;/p&gt; &lt;p style="margin: 0px; font-family: Monaco; font-style: normal; font-variant: normal; font-weight: normal; font-size: 10px; line-height: normal; font-size-adjust: none; font-stretch: normal; min-height: 14px;"&gt; &lt;/p&gt; &lt;p style="margin: 0px; font-family: Monaco; font-style: normal; font-variant: normal; font-weight: normal; font-size: 10px; line-height: normal; font-size-adjust: none; font-stretch: normal; color: rgb(0, 116, 0);"&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;// Set up the cell…&lt;/p&gt; &lt;p style="margin: 0px; font-family: Monaco; font-style: normal; font-variant: normal; font-weight: normal; font-size: 10px; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;&lt;span style="white-space: pre;"&gt; &lt;/span&gt;&lt;span style="color: rgb(170, 13, 145);"&gt;switch&lt;/span&gt; (indexPath.row) {&lt;/p&gt; &lt;p style="margin: 0px; font-family: Monaco; font-style: normal; font-variant: normal; font-weight: normal; font-size: 10px; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;&lt;span style="white-space: pre;"&gt; &lt;/span&gt;&lt;span style="color: rgb(170, 13, 145);"&gt;case&lt;/span&gt; &lt;span style="color: rgb(28, 0, 207);"&gt;0&lt;/span&gt;:&lt;/p&gt; &lt;p style="margin: 0px; font-family: Monaco; font-style: normal; font-variant: normal; font-weight: normal; font-size: 10px; line-height: normal; font-size-adjust: none; font-stretch: normal; color: rgb(196, 26, 22);"&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;&lt;span style="white-space: pre;"&gt; &lt;/span&gt;cell.&lt;/span&gt;&lt;span style="color: rgb(63, 110, 116);"&gt;primaryLabel&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;.&lt;/span&gt;&lt;span style="color: rgb(92, 38, 153);"&gt;text&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; = &lt;/span&gt;@"Meeting on iPhone Development"&lt;span style="color: rgb(0, 0, 0);"&gt;;&lt;/span&gt;&lt;/p&gt; &lt;p style="margin: 0px; font-family: Monaco; font-style: normal; font-variant: normal; font-weight: normal; font-size: 10px; line-height: normal; font-size-adjust: none; font-stretch: normal; color: rgb(63, 110, 116);"&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;&lt;span style="white-space: pre;"&gt; &lt;/span&gt;cell.&lt;/span&gt;secondaryLabel&lt;span style="color: rgb(0, 0, 0);"&gt;.&lt;/span&gt;&lt;span style="color: rgb(92, 38, 153);"&gt;text&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; = &lt;/span&gt;&lt;span style="color: rgb(196, 26, 22);"&gt;@"Sat 10:30"&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;;&lt;/span&gt;&lt;/p&gt; &lt;p style="margin: 0px; font-family: Monaco; font-style: normal; font-variant: normal; font-weight: normal; font-size: 10px; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;&lt;span style="white-space: pre;"&gt; &lt;/span&gt;cell.&lt;span style="color: rgb(63, 110, 116);"&gt;myImageView&lt;/span&gt;.image = [&lt;span style="color: rgb(92, 38, 153);"&gt;UIImage&lt;/span&gt; &lt;span style="color: rgb(46, 13, 110);"&gt;imageNamed&lt;/span&gt;:&lt;span style="color: rgb(196, 26, 22);"&gt;@"meeting_color.png"&lt;/span&gt;];&lt;/p&gt; &lt;p style="margin: 0px; font-family: Monaco; font-style: normal; font-variant: normal; font-weight: normal; font-size: 10px; line-height: normal; font-size-adjust: none; font-stretch: normal; color: rgb(170, 13, 145);"&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;&lt;span style="white-space: pre;"&gt; &lt;/span&gt;&lt;/span&gt;break&lt;span style="color: rgb(0, 0, 0);"&gt;;&lt;/span&gt;&lt;/p&gt; &lt;p style="margin: 0px; font-family: Monaco; font-style: normal; font-variant: normal; font-weight: normal; font-size: 10px; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;&lt;span style="white-space: pre;"&gt; &lt;/span&gt;&lt;span style="color: rgb(170, 13, 145);"&gt;case&lt;/span&gt; &lt;span style="color: rgb(28, 0, 207);"&gt;1&lt;/span&gt;:&lt;/p&gt; &lt;p style="margin: 0px; font-family: Monaco; font-style: normal; font-variant: normal; font-weight: normal; font-size: 10px; line-height: normal; font-size-adjust: none; font-stretch: normal; color: rgb(196, 26, 22);"&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;&lt;span style="white-space: pre;"&gt; &lt;/span&gt;cell.&lt;/span&gt;&lt;span style="color: rgb(63, 110, 116);"&gt;primaryLabel&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;.&lt;/span&gt;&lt;span style="color: rgb(92, 38, 153);"&gt;text&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; = &lt;/span&gt;@"Call With Client"&lt;span style="color: rgb(0, 0, 0);"&gt;;&lt;/span&gt;&lt;/p&gt; &lt;p style="margin: 0px; font-family: Monaco; font-style: normal; font-variant: normal; font-weight: normal; font-size: 10px; line-height: normal; font-size-adjust: none; font-stretch: normal; color: rgb(63, 110, 116);"&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;&lt;span style="white-space: pre;"&gt; &lt;/span&gt;cell.&lt;/span&gt;secondaryLabel&lt;span style="color: rgb(0, 0, 0);"&gt;.&lt;/span&gt;&lt;span style="color: rgb(92, 38, 153);"&gt;text&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; = &lt;/span&gt;&lt;span style="color: rgb(196, 26, 22);"&gt;@"Planned"&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;;&lt;/span&gt;&lt;/p&gt; &lt;p style="margin: 0px; font-family: Monaco; font-style: normal; font-variant: normal; font-weight: normal; font-size: 10px; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;&lt;span style="white-space: pre;"&gt; &lt;/span&gt;cell.&lt;span style="color: rgb(63, 110, 116);"&gt;myImageView&lt;/span&gt;.image = [&lt;span style="color: rgb(92, 38, 153);"&gt;UIImage&lt;/span&gt; &lt;span style="color: rgb(46, 13, 110);"&gt;imageNamed&lt;/span&gt;:&lt;span style="color: rgb(196, 26, 22);"&gt;@"call_color.png"&lt;/span&gt;];&lt;/p&gt; &lt;p style="margin: 0px; font-family: Monaco; font-style: normal; font-variant: normal; font-weight: normal; font-size: 10px; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;&lt;span style="white-space: pre;"&gt; &lt;/span&gt;&lt;span style="color: rgb(170, 13, 145);"&gt;break&lt;/span&gt;;&lt;/p&gt; &lt;p style="margin: 0px; font-family: Monaco; font-style: normal; font-variant: normal; font-weight: normal; font-size: 10px; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;&lt;span style="white-space: pre;"&gt; &lt;/span&gt;&lt;span style="color: rgb(170, 13, 145);"&gt;case&lt;/span&gt; &lt;span style="color: rgb(28, 0, 207);"&gt;2&lt;/span&gt;:&lt;/p&gt; &lt;p style="margin: 0px; font-family: Monaco; font-style: normal; font-variant: normal; font-weight: normal; font-size: 10px; line-height: normal; font-size-adjust: none; font-stretch: normal; color: rgb(196, 26, 22);"&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;&lt;span style="white-space: pre;"&gt; &lt;/span&gt;cell.&lt;/span&gt;&lt;span style="color: rgb(63, 110, 116);"&gt;primaryLabel&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;.&lt;/span&gt;&lt;span style="color: rgb(92, 38, 153);"&gt;text&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; = &lt;/span&gt;@"Appointment with Joey"&lt;span style="color: rgb(0, 0, 0);"&gt;;&lt;/span&gt;&lt;/p&gt; &lt;p style="margin: 0px; font-family: Monaco; font-style: normal; font-variant: normal; font-weight: normal; font-size: 10px; line-height: normal; font-size-adjust: none; font-stretch: normal; color: rgb(63, 110, 116);"&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;&lt;span style="white-space: pre;"&gt; &lt;/span&gt;cell.&lt;/span&gt;secondaryLabel&lt;span style="color: rgb(0, 0, 0);"&gt;.&lt;/span&gt;&lt;span style="color: rgb(92, 38, 153);"&gt;text&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; = &lt;/span&gt;&lt;span style="color: rgb(196, 26, 22);"&gt;@"2 Hours"&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;;&lt;/span&gt;&lt;/p&gt; &lt;p style="margin: 0px; font-family: Monaco; font-style: normal; font-variant: normal; font-weight: normal; font-size: 10px; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;&lt;span style="white-space: pre;"&gt; &lt;/span&gt;cell.&lt;span style="color: rgb(63, 110, 116);"&gt;myImageView&lt;/span&gt;.image = [&lt;span style="color: rgb(92, 38, 153);"&gt;UIImage&lt;/span&gt; &lt;span style="color: rgb(46, 13, 110);"&gt;imageNamed&lt;/span&gt;:&lt;span style="color: rgb(196, 26, 22);"&gt;@"calendar_color.png"&lt;/span&gt;];&lt;/p&gt; &lt;p style="margin: 0px; font-family: Monaco; font-style: normal; font-variant: normal; font-weight: normal; font-size: 10px; line-height: normal; font-size-adjust: none; font-stretch: normal; color: rgb(170, 13, 145);"&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;&lt;span style="white-space: pre;"&gt; &lt;/span&gt;&lt;/span&gt;break&lt;span style="color: rgb(0, 0, 0);"&gt;;&lt;/span&gt;&lt;/p&gt; &lt;p style="margin: 0px; font-family: Monaco; font-style: normal; font-variant: normal; font-weight: normal; font-size: 10px; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;&lt;span style="white-space: pre;"&gt; &lt;/span&gt;&lt;span style="color: rgb(170, 13, 145);"&gt;case&lt;/span&gt; &lt;span style="color: rgb(28, 0, 207);"&gt;3&lt;/span&gt;:&lt;/p&gt; &lt;p style="margin: 0px; font-family: Monaco; font-style: normal; font-variant: normal; font-weight: normal; font-size: 10px; line-height: normal; font-size-adjust: none; font-stretch: normal; color: rgb(196, 26, 22);"&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;&lt;span style="white-space: pre;"&gt; &lt;/span&gt;cell.&lt;/span&gt;&lt;span style="color: rgb(63, 110, 116);"&gt;primaryLabel&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;.&lt;/span&gt;&lt;span style="color: rgb(92, 38, 153);"&gt;text&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; = &lt;/span&gt;@"Call With Client"&lt;span style="color: rgb(0, 0, 0);"&gt;;&lt;/span&gt;&lt;/p&gt; &lt;p style="margin: 0px; font-family: Monaco; font-style: normal; font-variant: normal; font-weight: normal; font-size: 10px; line-height: normal; font-size-adjust: none; font-stretch: normal; color: rgb(63, 110, 116);"&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;&lt;span style="white-space: pre;"&gt; &lt;/span&gt;cell.&lt;/span&gt;secondaryLabel&lt;span style="color: rgb(0, 0, 0);"&gt;.&lt;/span&gt;&lt;span style="color: rgb(92, 38, 153);"&gt;text&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; = &lt;/span&gt;&lt;span style="color: rgb(196, 26, 22);"&gt;@"Planned"&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;;&lt;/span&gt;&lt;/p&gt; &lt;p style="margin: 0px; font-family: Monaco; font-style: normal; font-variant: normal; font-weight: normal; font-size: 10px; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;&lt;span style="white-space: pre;"&gt; &lt;/span&gt;cell.&lt;span style="color: rgb(63, 110, 116);"&gt;myImageView&lt;/span&gt;.image = [&lt;span style="color: rgb(92, 38, 153);"&gt;UIImage&lt;/span&gt; &lt;span style="color: rgb(46, 13, 110);"&gt;imageNamed&lt;/span&gt;:&lt;span style="color: rgb(196, 26, 22);"&gt;@"call_color.png"&lt;/span&gt;];&lt;/p&gt; &lt;p style="margin: 0px; font-family: Monaco; font-style: normal; font-variant: normal; font-weight: normal; font-size: 10px; line-height: normal; font-size-adjust: none; font-stretch: normal; color: rgb(170, 13, 145);"&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;&lt;span style="white-space: pre;"&gt; &lt;/span&gt;&lt;/span&gt;break&lt;span style="color: rgb(0, 0, 0);"&gt;;&lt;/span&gt;&lt;/p&gt; &lt;p style="margin: 0px; font-family: Monaco; font-style: normal; font-variant: normal; font-weight: normal; font-size: 10px; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;&lt;span style="white-space: pre;"&gt; &lt;/span&gt;&lt;span style="color: rgb(170, 13, 145);"&gt;case&lt;/span&gt; &lt;span style="color: rgb(28, 0, 207);"&gt;4&lt;/span&gt;:&lt;/p&gt; &lt;p style="margin: 0px; font-family: Monaco; font-style: normal; font-variant: normal; font-weight: normal; font-size: 10px; line-height: normal; font-size-adjust: none; font-stretch: normal; color: rgb(196, 26, 22);"&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;&lt;span style="white-space: pre;"&gt; &lt;/span&gt;cell.&lt;/span&gt;&lt;span style="color: rgb(63, 110, 116);"&gt;primaryLabel&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;.&lt;/span&gt;&lt;span style="color: rgb(92, 38, 153);"&gt;text&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; = &lt;/span&gt;@"Appointment with Joey"&lt;span style="color: rgb(0, 0, 0);"&gt;;&lt;/span&gt;&lt;/p&gt; &lt;p style="margin: 0px; font-family: Monaco; font-style: normal; font-variant: normal; font-weight: normal; font-size: 10px; line-height: normal; font-size-adjust: none; font-stretch: normal; color: rgb(63, 110, 116);"&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;&lt;span style="white-space: pre;"&gt; &lt;/span&gt;cell.&lt;/span&gt;secondaryLabel&lt;span style="color: rgb(0, 0, 0);"&gt;.&lt;/span&gt;&lt;span style="color: rgb(92, 38, 153);"&gt;text&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; = &lt;/span&gt;&lt;span style="color: rgb(196, 26, 22);"&gt;@"2 Hours"&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;;&lt;/span&gt;&lt;/p&gt; &lt;p style="margin: 0px; font-family: Monaco; font-style: normal; font-variant: normal; font-weight: normal; font-size: 10px; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;&lt;span style="white-space: pre;"&gt; &lt;/span&gt;cell.&lt;span style="color: rgb(63, 110, 116);"&gt;myImageView&lt;/span&gt;.image = [&lt;span style="color: rgb(92, 38, 153);"&gt;UIImage&lt;/span&gt; &lt;span style="color: rgb(46, 13, 110);"&gt;imageNamed&lt;/span&gt;:&lt;span style="color: rgb(196, 26, 22);"&gt;@"calendar_color.png"&lt;/span&gt;];&lt;/p&gt; &lt;p style="margin: 0px; font-family: Monaco; font-style: normal; font-variant: normal; font-weight: normal; font-size: 10px; line-height: normal; font-size-adjust: none; font-stretch: normal; color: rgb(170, 13, 145);"&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;&lt;span style="white-space: pre;"&gt; &lt;/span&gt;&lt;/span&gt;break&lt;span style="color: rgb(0, 0, 0);"&gt;;&lt;/span&gt;&lt;/p&gt; &lt;p style="margin: 0px; font-family: Monaco; font-style: normal; font-variant: normal; font-weight: normal; font-size: 10px; line-height: normal; font-size-adjust: none; font-stretch: normal; color: rgb(170, 13, 145);"&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;&lt;span style="white-space: pre;"&gt; &lt;/span&gt;&lt;/span&gt;default&lt;span style="color: rgb(0, 0, 0);"&gt;:&lt;/span&gt;&lt;/p&gt; &lt;p style="margin: 0px; font-family: Monaco; font-style: normal; font-variant: normal; font-weight: normal; font-size: 10px; line-height: normal; font-size-adjust: none; font-stretch: normal; color: rgb(170, 13, 145);"&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;&lt;span style="white-space: pre;"&gt; &lt;/span&gt;&lt;/span&gt;break&lt;span style="color: rgb(0, 0, 0);"&gt;;&lt;/span&gt;&lt;/p&gt; &lt;p style="margin: 0px; font-family: Monaco; font-style: normal; font-variant: normal; font-weight: normal; font-size: 10px; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;&lt;span style="white-space: pre;"&gt; &lt;/span&gt;}&lt;/p&gt; &lt;p style="margin: 0px; font-family: Monaco; font-style: normal; font-variant: normal; font-weight: normal; font-size: 10px; line-height: normal; font-size-adjust: none; font-stretch: normal; min-height: 14px;"&gt;&lt;span style="white-space: pre;"&gt; &lt;/span&gt;&lt;/p&gt; &lt;p style="margin: 0px; font-family: Monaco; font-style: normal; font-variant: normal; font-weight: normal; font-size: 10px; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;&lt;span style="color: rgb(170, 13, 145);"&gt;return&lt;/span&gt; cell;&lt;/p&gt; &lt;p style="margin: 0px; font-family: Monaco; font-style: normal; font-variant: normal; font-weight: normal; font-size: 10px; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;}&lt;/p&gt; &lt;div&gt;&lt;span style="font-family: Monaco; font-size: 10px;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt; &lt;/div&gt; &lt;div&gt;I have added some dummy data. You can use your data source to provide data for primaryLabel and secondaryLabel. Please note that I have used three images here. You can use any image of your choice. All you need to to do is copy the images and paste it into your project root folder (which in this case is CustomCellTestProject folder). After pasting the files, in xcode right click on Resources (or any group), select Add &gt;&gt; ExistingFiles and then select all the images you want to add in you project. Once added you can simply use them by their names.&lt;/div&gt;  &lt;div&gt;Thats it, go ahead and run the project. You will find something wrong when you compare you simulator screen with mine. If you noticed in the CustomCell.m, I have given some frames to the UI elements. You need to make sure that the height of your cell large enough to accomodate all the elements. So add this following code and you fixed the issue:&lt;/div&gt;  &lt;div&gt; &lt;p style="margin: 0px; font-family: Monaco; font-style: normal; font-variant: normal; font-weight: normal; font-size: 10px; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;- (&lt;span style="color: rgb(92, 38, 153);"&gt;CGFloat&lt;/span&gt;)tableView:(&lt;span style="color: rgb(92, 38, 153);"&gt;UITableView&lt;/span&gt; *)tableView heightForRowAtIndexPath:(&lt;span style="color: rgb(92, 38, 153);"&gt;NSIndexPath&lt;/span&gt; *)indexPath&lt;/p&gt; &lt;p style="margin: 0px; font-family: Monaco; font-style: normal; font-variant: normal; font-weight: normal; font-size: 10px; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;{&lt;/p&gt; &lt;p style="margin: 0px; font-family: Monaco; font-style: normal; font-variant: normal; font-weight: normal; font-size: 10px; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;&lt;span style="white-space: pre;"&gt; &lt;/span&gt;&lt;/span&gt;return&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(28, 0, 207);"&gt;50&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;;&lt;/span&gt;&lt;/p&gt; &lt;p style="margin: 0px; font-family: Monaco; font-style: normal; font-variant: normal; font-weight: normal; font-size: 10px; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;}&lt;/p&gt;&lt;p style="margin: 0px; font-family: Monaco; font-style: normal; font-variant: normal; font-weight: normal; font-size: 10px; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;&lt;br /&gt;&lt;/p&gt;&lt;p style="margin: 0px; font-family: Monaco; font-style: normal; font-variant: normal; font-weight: normal; font-size: 10px; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;this is not my post the original post is here&lt;/p&gt;&lt;p style="margin: 0px; font-family: Monaco; font-style: normal; font-variant: normal; font-weight: normal; font-size: 10px; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;&lt;br /&gt;&lt;/p&gt;&lt;p style="margin: 0px; font-family: Monaco; font-style: normal; font-variant: normal; font-weight: normal; font-size: 10px; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;http://blog.webscale.co.in/?p=284&lt;br /&gt;&lt;/p&gt;  &lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7660917028131688558-9209755951177252691?l=jainmarket.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://jainmarket.blogspot.com/feeds/9209755951177252691/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7660917028131688558&amp;postID=9209755951177252691' title='10 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7660917028131688558/posts/default/9209755951177252691'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7660917028131688558/posts/default/9209755951177252691'/><link rel='alternate' type='text/html' href='http://jainmarket.blogspot.com/2009/05/creating-custom-table-view-cell.html' title='Creating a custom Table View Cell programmatically'/><author><name>Rahul Vyas</name><uri>http://www.blogger.com/profile/08326955903115378266</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://bp1.blogger.com/_6C_XpG63jYw/SAgrxtkt56I/AAAAAAAAACc/pr7-vuTQS5w/S220/P1170634+(Small).JPG'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://2.bp.blogspot.com/_pV2VnLyRiRE/SfcJL4OhSYI/AAAAAAAAATE/4debKHb4Aqw/s72-c/screen-capture.jpg' height='72' width='72'/><thr:total>10</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7660917028131688558.post-3873728088030383537</id><published>2009-05-02T12:51:00.000+05:30</published><updated>2009-05-02T12:54:57.559+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='IPHONE'/><title type='text'>Custom UITableViewCell in IB</title><content type='html'>&lt;h3&gt;Creating the project&lt;/h3&gt; &lt;p&gt;Create a new project with the “View-based Application” template and call it customTableCell.&lt;/p&gt; &lt;h3&gt;Setting up the view controller&lt;/h3&gt; &lt;p&gt;Open customTableCellViewController.h and add two IB outlets which we will use to reference to the custom UITableViewCell objects which we will create later. Also, we are going to be using this as a table view delegate and data source so we should state that this class will conform to these protocols. Your customTableCellViewController.h should look like this after editing:&lt;/p&gt;  &lt;div class="wp_syntax"&gt;&lt;div class="code"&gt;&lt;pre class="objc" style="font-family: monospace;"&gt;&lt;span style="color: rgb(110, 55, 26);"&gt;#import &lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(166, 19, 144);"&gt;@interface&lt;/span&gt; customTableCellViewController &lt;span style="color: rgb(0, 34, 0);"&gt;:&lt;/span&gt; UIViewController  &lt;span style="color: rgb(0, 34, 0);"&gt;{&lt;/span&gt;&lt;br /&gt; IBOutlet UITableViewCell &lt;span style="color: rgb(0, 34, 0);"&gt;*&lt;/span&gt;cellOne;&lt;br /&gt; IBOutlet UITableViewCell &lt;span style="color: rgb(0, 34, 0);"&gt;*&lt;/span&gt;cellTwo;&lt;br /&gt;&lt;span style="color: rgb(0, 34, 0);"&gt;}&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(166, 19, 144);"&gt;@property&lt;/span&gt; &lt;span style="color: rgb(0, 34, 0);"&gt;(&lt;/span&gt;nonatomic, retain&lt;span style="color: rgb(0, 34, 0);"&gt;)&lt;/span&gt; IBOutlet UITableViewCell &lt;span style="color: rgb(0, 34, 0);"&gt;*&lt;/span&gt;cellOne;&lt;br /&gt;&lt;span style="color: rgb(166, 19, 144);"&gt;@property&lt;/span&gt; &lt;span style="color: rgb(0, 34, 0);"&gt;(&lt;/span&gt;nonatomic, retain&lt;span style="color: rgb(0, 34, 0);"&gt;)&lt;/span&gt; IBOutlet UITableViewCell &lt;span style="color: rgb(0, 34, 0);"&gt;*&lt;/span&gt;cellTwo;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(166, 19, 144);"&gt;@end&lt;/span&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;  &lt;h3&gt;Adding the items in Interface Builder&lt;/h3&gt; &lt;p&gt;Open customTableCellViewController.xib in IB and drop in a Table View (not a Table View Controller), making it fill the view.&lt;/p&gt; &lt;p&gt;Set the the table view properties to Style -&gt; Grouped.&lt;/p&gt; &lt;p&gt;Link the delegate and dataSource outlets of the table view to “File’s Owner” as illustrated by this screenshot:&lt;/p&gt; &lt;p&gt;&lt;img style="width: 561px; height: 364px;" class="ngg-singlepic ngg-none" src="http://iphone.galloway.me.uk/wp-content/gallery/tutorial-custom-uitableviewcell/ib-tableview-links.png" alt="ib-tableview-links.png" /&gt;&lt;/p&gt; &lt;p&gt;Add two Table View Cell items in IB to your customTableCellViewController.xib file. Then, open each table view cell item and drop something different onto each one of them so you will tell them apart.&lt;/p&gt; &lt;p&gt;Now we need to link these table view cells to the IB outlets we created earlier. To do this, right click on “File’s Owner” and link cellOne and cellTwo outlets to the table view cells you have just created. You should then have something which looks like this:&lt;/p&gt; &lt;p&gt;&lt;img class="ngg-singlepic ngg-none" src="http://iphone.galloway.me.uk/wp-content/gallery/tutorial-custom-uitableviewcell/ib-cell-links.png" alt="ib-cell-links.png" /&gt;&lt;/p&gt; &lt;p&gt;Save and close customTableCellViewController.xib.&lt;/p&gt; &lt;h3&gt;Controller Code&lt;/h3&gt; &lt;p&gt;Open customTableViewController.m&lt;/p&gt; &lt;p&gt;We will need to implement three functions, namely &lt;em&gt;tableView:cellForRowAtIndexPath:&lt;/em&gt;, &lt;em&gt;numberOfSectionsInTableView:&lt;/em&gt; and &lt;em&gt;tableView:numberOfRowsInSection:&lt;/em&gt; which are the usual data source protocol functions which we need to implement. The three functions are outlined below.&lt;/p&gt; &lt;p&gt;&lt;em&gt;tableView:cellForRowAtIndexPath:&lt;/em&gt;&lt;/p&gt;  &lt;div class="wp_syntax"&gt;&lt;div class="code"&gt;&lt;pre class="objc" style="font-family: monospace;"&gt;&lt;span style="color: rgb(0, 34, 0);"&gt;-&lt;/span&gt; &lt;span style="color: rgb(0, 34, 0);"&gt;(&lt;/span&gt;UITableViewCell &lt;span style="color: rgb(0, 34, 0);"&gt;*&lt;/span&gt;&lt;span style="color: rgb(0, 34, 0);"&gt;)&lt;/span&gt;tableView&lt;span style="color: rgb(0, 34, 0);"&gt;:&lt;/span&gt;&lt;span style="color: rgb(0, 34, 0);"&gt;(&lt;/span&gt;UITableView &lt;span style="color: rgb(0, 34, 0);"&gt;*&lt;/span&gt;&lt;span style="color: rgb(0, 34, 0);"&gt;)&lt;/span&gt;tableView cellForRowAtIndexPath&lt;span style="color: rgb(0, 34, 0);"&gt;:&lt;/span&gt;&lt;span style="color: rgb(0, 34, 0);"&gt;(&lt;/span&gt;&lt;span style="color: rgb(64, 0, 128);"&gt;NSIndexPath&lt;/span&gt; &lt;span style="color: rgb(0, 34, 0);"&gt;*&lt;/span&gt;&lt;span style="color: rgb(0, 34, 0);"&gt;)&lt;/span&gt;indexPath &lt;span style="color: rgb(0, 34, 0);"&gt;{&lt;/span&gt;&lt;br /&gt; &lt;span style="color: rgb(166, 19, 144);"&gt;if&lt;/span&gt;&lt;span style="color: rgb(0, 34, 0);"&gt;(&lt;/span&gt;&lt;span style="color: rgb(0, 34, 0);"&gt;[&lt;/span&gt;indexPath row&lt;span style="color: rgb(0, 34, 0);"&gt;]&lt;/span&gt; &lt;span style="color: rgb(0, 34, 0);"&gt;==&lt;/span&gt; &lt;span style="color: rgb(36, 0, 217);"&gt;0&lt;/span&gt;&lt;span style="color: rgb(0, 34, 0);"&gt;)&lt;/span&gt; &lt;span style="color: rgb(166, 19, 144);"&gt;return&lt;/span&gt; cellOne;&lt;br /&gt; &lt;span style="color: rgb(166, 19, 144);"&gt;if&lt;/span&gt;&lt;span style="color: rgb(0, 34, 0);"&gt;(&lt;/span&gt;&lt;span style="color: rgb(0, 34, 0);"&gt;[&lt;/span&gt;indexPath row&lt;span style="color: rgb(0, 34, 0);"&gt;]&lt;/span&gt; &lt;span style="color: rgb(0, 34, 0);"&gt;==&lt;/span&gt; &lt;span style="color: rgb(36, 0, 217);"&gt;1&lt;/span&gt;&lt;span style="color: rgb(0, 34, 0);"&gt;)&lt;/span&gt; &lt;span style="color: rgb(166, 19, 144);"&gt;return&lt;/span&gt; cellTwo;&lt;br /&gt; &lt;span style="color: rgb(166, 19, 144);"&gt;return&lt;/span&gt; &lt;span style="color: rgb(166, 19, 144);"&gt;nil&lt;/span&gt;;&lt;br /&gt;&lt;span style="color: rgb(0, 34, 0);"&gt;}&lt;/span&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;  &lt;p&gt;&lt;em&gt;numberOfSectionsInTableView:&lt;/em&gt;&lt;/p&gt;  &lt;div class="wp_syntax"&gt;&lt;div class="code"&gt;&lt;pre class="objc" style="font-family: monospace;"&gt;&lt;span style="color: rgb(0, 34, 0);"&gt;-&lt;/span&gt; &lt;span style="color: rgb(0, 34, 0);"&gt;(&lt;/span&gt;NSInteger&lt;span style="color: rgb(0, 34, 0);"&gt;)&lt;/span&gt;numberOfSectionsInTableView&lt;span style="color: rgb(0, 34, 0);"&gt;:&lt;/span&gt;&lt;span style="color: rgb(0, 34, 0);"&gt;(&lt;/span&gt;UITableView &lt;span style="color: rgb(0, 34, 0);"&gt;*&lt;/span&gt;&lt;span style="color: rgb(0, 34, 0);"&gt;)&lt;/span&gt;tableView &lt;span style="color: rgb(0, 34, 0);"&gt;{&lt;/span&gt;&lt;br /&gt; &lt;span style="color: rgb(166, 19, 144);"&gt;return&lt;/span&gt; &lt;span style="color: rgb(36, 0, 217);"&gt;1&lt;/span&gt;;&lt;br /&gt;&lt;span style="color: rgb(0, 34, 0);"&gt;}&lt;/span&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;  &lt;p&gt;&lt;em&gt;tableView:numberOfRowsInSection:&lt;/em&gt;&lt;/p&gt;  &lt;div class="wp_syntax"&gt;&lt;div class="code"&gt;&lt;pre class="objc" style="font-family: monospace;"&gt;&lt;span style="color: rgb(0, 34, 0);"&gt;-&lt;/span&gt; &lt;span style="color: rgb(0, 34, 0);"&gt;(&lt;/span&gt;NSInteger&lt;span style="color: rgb(0, 34, 0);"&gt;)&lt;/span&gt;tableView&lt;span style="color: rgb(0, 34, 0);"&gt;:&lt;/span&gt;&lt;span style="color: rgb(0, 34, 0);"&gt;(&lt;/span&gt;UITableView &lt;span style="color: rgb(0, 34, 0);"&gt;*&lt;/span&gt;&lt;span style="color: rgb(0, 34, 0);"&gt;)&lt;/span&gt;tableView numberOfRowsInSection&lt;span style="color: rgb(0, 34, 0);"&gt;:&lt;/span&gt;&lt;span style="color: rgb(0, 34, 0);"&gt;(&lt;/span&gt;NSInteger&lt;span style="color: rgb(0, 34, 0);"&gt;)&lt;/span&gt;section &lt;span style="color: rgb(0, 34, 0);"&gt;{&lt;/span&gt;&lt;br /&gt; &lt;span style="color: rgb(166, 19, 144);"&gt;return&lt;/span&gt; &lt;span style="color: rgb(36, 0, 217);"&gt;2&lt;/span&gt;;&lt;br /&gt;&lt;span style="color: rgb(0, 34, 0);"&gt;}&lt;/span&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;  &lt;p&gt;These functions tell the table view to display 1 section, with 2 cells and when the table view asks for each cell, the custom UITableViewCell objects are returned.&lt;/p&gt; &lt;h3&gt;And that’s it!&lt;/h3&gt; &lt;p&gt;If you now build and run the application then you will notice that your custom cells are being shown - brilliant! Now you can do something fun with the custom cells! For instance you could put a text box or a slider in it and then bind actions of it to a function in your view controller to act upon the user’s input.&lt;/p&gt; &lt;p&gt;Go play!&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7660917028131688558-3873728088030383537?l=jainmarket.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://jainmarket.blogspot.com/feeds/3873728088030383537/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7660917028131688558&amp;postID=3873728088030383537' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7660917028131688558/posts/default/3873728088030383537'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7660917028131688558/posts/default/3873728088030383537'/><link rel='alternate' type='text/html' href='http://jainmarket.blogspot.com/2009/05/custom-uitableviewcell-in-ib.html' title='Custom UITableViewCell in IB'/><author><name>Rahul Vyas</name><uri>http://www.blogger.com/profile/08326955903115378266</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://bp1.blogger.com/_6C_XpG63jYw/SAgrxtkt56I/AAAAAAAAACc/pr7-vuTQS5w/S220/P1170634+(Small).JPG'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7660917028131688558.post-7846828825709127248</id><published>2009-05-02T11:43:00.000+05:30</published><updated>2009-05-08T17:26:39.962+05:30</updated><title type='text'></title><content type='html'>http://ericasadun.com/&lt;br /&gt;&lt;br /&gt;http://steaps.techaos.com/2009/03/01/tutorial-scrolling-an-object-into-view/&lt;br /&gt;&lt;br /&gt;http://www.ipodtouchfans.com/forums/archive/index.php/t-102782.html&lt;br /&gt;http://twilloapp.blogspot.com/&lt;br /&gt;http://blog.mcilvena.com/2009/01/xcode-starting-point-for-iphone-hand-coders/&lt;br /&gt;http://vimeo.com/3363949&lt;br /&gt;http://iphonedevelopertips.com/xcode/real-men-dont-use-interface-builder.html&lt;br /&gt;&lt;br /&gt;http://www.ipodtouchfans.com/forums/archive/index.php/f-55.html&lt;br /&gt;http://forums.macrumors.com/archive/index.php/f-135-p-6.html&lt;br /&gt;http://blogs.remobjects.com/blogs/mh/2009/04/11/p271&lt;br /&gt;http://www.ipodtouchfans.com/forums/archive/index.php?t-58898.html&lt;br /&gt;http://www.servin.com/iphone/NSObject.html&lt;br /&gt;http://weblog.bignerdranch.com/?p=56&lt;br /&gt;http://www.insanelymac.com/forum/index.php?showtopic=96104&amp;amp;st=40&lt;br /&gt;&lt;br /&gt;http://ihatetheiphonesdk.blogspot.com/2008/04/reason-2-interface-builder-is-buggy-and.html&lt;br /&gt;&lt;br /&gt;http://kwigbo.com/wp/2009/02/27/custom-uitableviewcell-in-interface-builder/&lt;br /&gt;&lt;br /&gt;http://iphone.galloway.me.uk/iphone-sdktutorials/custom-uitableviewcell/&lt;br /&gt;&lt;br /&gt;http://iphone.zcentric.com/2008/08/05/custom-uitableviewcell/&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7660917028131688558-7846828825709127248?l=jainmarket.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://jainmarket.blogspot.com/feeds/7846828825709127248/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7660917028131688558&amp;postID=7846828825709127248' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7660917028131688558/posts/default/7846828825709127248'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7660917028131688558/posts/default/7846828825709127248'/><link rel='alternate' type='text/html' href='http://jainmarket.blogspot.com/2009/05/httpkwigbo.html' title=''/><author><name>Rahul Vyas</name><uri>http://www.blogger.com/profile/08326955903115378266</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://bp1.blogger.com/_6C_XpG63jYw/SAgrxtkt56I/AAAAAAAAACc/pr7-vuTQS5w/S220/P1170634+(Small).JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7660917028131688558.post-7172814277902922505</id><published>2009-05-01T08:38:00.000+05:30</published><updated>2009-05-01T08:45:42.480+05:30</updated><title type='text'></title><content type='html'>&lt;div class="wp_syntax"&gt;&lt;div class="code"&gt;&lt;pre class="cpp" style="font-family: monospace;"&gt;&lt;span style="color: rgb(102, 102, 102);"&gt;// This will get a random number between 0 and 9&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;int&lt;/span&gt; ranX &lt;span style="color: rgb(0, 0, 128);"&gt;=&lt;/span&gt; arc4random&lt;span style="color: rgb(0, 128, 0);"&gt;(&lt;/span&gt;&lt;span style="color: rgb(0, 128, 0);"&gt;)&lt;/span&gt; &lt;span style="color: rgb(0, 0, 64);"&gt;%&lt;/span&gt; &lt;span style="color: rgb(0, 0, 221);"&gt;10&lt;/span&gt;&lt;span style="color: rgb(0, 128, 128);"&gt;;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;/pre&gt;&lt;h2&gt;&lt;a class="title" href="http://kwigbo.com/wp/2009/03/31/cocos2d-rectangle-rectangle-collision-detection/" rel="bookmark"&gt;Cocos2d Rectangle Rectangle Collision Detection&lt;/a&gt;&lt;span class="date"&gt;&lt;/span&gt;&lt;br /&gt;&lt;/h2&gt;              &lt;div class="wp_syntax"&gt;&lt;div class="code"&gt;&lt;pre class="cpp" style="font-family: monospace;"&gt;&lt;span style="color: rgb(0, 0, 64);"&gt;-&lt;/span&gt; &lt;span style="color: rgb(0, 128, 0);"&gt;(&lt;/span&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;BOOL&lt;/span&gt;&lt;span style="color: rgb(0, 128, 0);"&gt;)&lt;/span&gt; rect&lt;span style="color: rgb(0, 128, 128);"&gt;:&lt;/span&gt;&lt;span style="color: rgb(0, 128, 0);"&gt;(&lt;/span&gt;CGRect&lt;span style="color: rgb(0, 128, 0);"&gt;)&lt;/span&gt; rect collisionWithRect&lt;span style="color: rgb(0, 128, 128);"&gt;:&lt;/span&gt;&lt;span style="color: rgb(0, 128, 0);"&gt;(&lt;/span&gt;CGRect&lt;span style="color: rgb(0, 128, 0);"&gt;)&lt;/span&gt; rectTwo&lt;br /&gt;&lt;span style="color: rgb(0, 128, 0);"&gt;{&lt;/span&gt;&lt;br /&gt; &lt;span style="color: rgb(0, 0, 255);"&gt;float&lt;/span&gt; rect_x1 &lt;span style="color: rgb(0, 0, 128);"&gt;=&lt;/span&gt; rect.&lt;span style="color: rgb(0, 119, 136);"&gt;origin&lt;/span&gt;.&lt;span style="color: rgb(0, 119, 136);"&gt;x&lt;/span&gt;&lt;span style="color: rgb(0, 128, 128);"&gt;;&lt;/span&gt;&lt;br /&gt; &lt;span style="color: rgb(0, 0, 255);"&gt;float&lt;/span&gt; rect_x2 &lt;span style="color: rgb(0, 0, 128);"&gt;=&lt;/span&gt; rect_x1&lt;span style="color: rgb(0, 0, 64);"&gt;+&lt;/span&gt;rect.&lt;span style="color: rgb(0, 119, 136);"&gt;size&lt;/span&gt;.&lt;span style="color: rgb(0, 119, 136);"&gt;width&lt;/span&gt;&lt;span style="color: rgb(0, 128, 128);"&gt;;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt; &lt;span style="color: rgb(0, 0, 255);"&gt;float&lt;/span&gt; rect_y1 &lt;span style="color: rgb(0, 0, 128);"&gt;=&lt;/span&gt; rect.&lt;span style="color: rgb(0, 119, 136);"&gt;origin&lt;/span&gt;.&lt;span style="color: rgb(0, 119, 136);"&gt;y&lt;/span&gt;&lt;span style="color: rgb(0, 128, 128);"&gt;;&lt;/span&gt;&lt;br /&gt; &lt;span style="color: rgb(0, 0, 255);"&gt;float&lt;/span&gt; rect_y2 &lt;span style="color: rgb(0, 0, 128);"&gt;=&lt;/span&gt; rect_y1&lt;span style="color: rgb(0, 0, 64);"&gt;+&lt;/span&gt;rect.&lt;span style="color: rgb(0, 119, 136);"&gt;size&lt;/span&gt;.&lt;span style="color: rgb(0, 119, 136);"&gt;height&lt;/span&gt;&lt;span style="color: rgb(0, 128, 128);"&gt;;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt; &lt;span style="color: rgb(0, 0, 255);"&gt;float&lt;/span&gt; rect2_x1 &lt;span style="color: rgb(0, 0, 128);"&gt;=&lt;/span&gt; rectTwo.&lt;span style="color: rgb(0, 119, 136);"&gt;origin&lt;/span&gt;.&lt;span style="color: rgb(0, 119, 136);"&gt;x&lt;/span&gt;&lt;span style="color: rgb(0, 128, 128);"&gt;;&lt;/span&gt;&lt;br /&gt; &lt;span style="color: rgb(0, 0, 255);"&gt;float&lt;/span&gt; rect2_x2 &lt;span style="color: rgb(0, 0, 128);"&gt;=&lt;/span&gt; rect2_x1&lt;span style="color: rgb(0, 0, 64);"&gt;+&lt;/span&gt;rectTwo.&lt;span style="color: rgb(0, 119, 136);"&gt;size&lt;/span&gt;.&lt;span style="color: rgb(0, 119, 136);"&gt;width&lt;/span&gt;&lt;span style="color: rgb(0, 128, 128);"&gt;;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt; &lt;span style="color: rgb(0, 0, 255);"&gt;float&lt;/span&gt; rect2_y1 &lt;span style="color: rgb(0, 0, 128);"&gt;=&lt;/span&gt; rectTwo.&lt;span style="color: rgb(0, 119, 136);"&gt;origin&lt;/span&gt;.&lt;span style="color: rgb(0, 119, 136);"&gt;y&lt;/span&gt;&lt;span style="color: rgb(0, 128, 128);"&gt;;&lt;/span&gt;&lt;br /&gt; &lt;span style="color: rgb(0, 0, 255);"&gt;float&lt;/span&gt; rect2_y2 &lt;span style="color: rgb(0, 0, 128);"&gt;=&lt;/span&gt; rect2_y1&lt;span style="color: rgb(0, 0, 64);"&gt;+&lt;/span&gt;rectTwo.&lt;span style="color: rgb(0, 119, 136);"&gt;size&lt;/span&gt;.&lt;span style="color: rgb(0, 119, 136);"&gt;height&lt;/span&gt;&lt;span style="color: rgb(0, 128, 128);"&gt;;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt; &lt;span style="color: rgb(0, 0, 255);"&gt;if&lt;/span&gt;&lt;span style="color: rgb(0, 128, 0);"&gt;(&lt;/span&gt;&lt;span style="color: rgb(0, 128, 0);"&gt;(&lt;/span&gt;rect_x2 &lt;span style="color: rgb(0, 0, 128);"&gt;&gt;&lt;/span&gt; rect2_x1 &lt;span style="color: rgb(0, 0, 64);"&gt;&amp;amp;&amp;amp;&lt;/span&gt; rect_x1 &lt;span style="color: rgb(0, 0, 128);"&gt;&lt;&lt;/span&gt; rect2_x2&lt;span style="color: rgb(0, 128, 0);"&gt;)&lt;/span&gt; &lt;span style="color: rgb(0, 0, 64);"&gt;&amp;amp;&amp;amp;&lt;/span&gt;&lt;span style="color: rgb(0, 128, 0);"&gt;(&lt;/span&gt;rect_y2 &lt;span style="color: rgb(0, 0, 128);"&gt;&gt;&lt;/span&gt; rect2_y1 &lt;span style="color: rgb(0, 0, 64);"&gt;&amp;amp;&amp;amp;&lt;/span&gt; rect_y1 &lt;span style="color: rgb(0, 0, 128);"&gt;&lt;&lt;/span&gt; rect2_y2&lt;span style="color: rgb(0, 128, 0);"&gt;)&lt;/span&gt;&lt;span style="color: rgb(0, 128, 0);"&gt;)&lt;/span&gt;&lt;br /&gt;  &lt;span style="color: rgb(0, 0, 255);"&gt;return&lt;/span&gt; YES&lt;span style="color: rgb(0, 128, 128);"&gt;;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt; &lt;span style="color: rgb(0, 0, 255);"&gt;return&lt;/span&gt; NO&lt;span style="color: rgb(0, 128, 128);"&gt;;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 128, 0);"&gt;}&lt;/span&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;           &lt;h2&gt;&lt;a class="title" href="http://kwigbo.com/wp/2009/04/03/iphone-sdk-show-activity-indicator-in-the-status-bar/" rel="bookmark"&gt;iPhone SDK Show Activity Indicator in the Status Bar&lt;/a&gt;&lt;/h2&gt;              &lt;div class="wp_syntax"&gt;&lt;div class="code"&gt;&lt;pre class="cpp" style="font-family: monospace;"&gt;&lt;span style="color: rgb(0, 128, 0);"&gt;[&lt;/span&gt;UIApplication sharedApplication&lt;span style="color: rgb(0, 128, 0);"&gt;]&lt;/span&gt;.&lt;span style="color: rgb(0, 119, 136);"&gt;networkActivityIndicatorVisible&lt;/span&gt; &lt;span style="color: rgb(0, 0, 128);"&gt;=&lt;/span&gt; YES&lt;span style="color: rgb(0, 128, 128);"&gt;;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 128, 0);"&gt;[&lt;/span&gt;UIApplication sharedApplication&lt;span style="color: rgb(0, 128, 0);"&gt;]&lt;/span&gt;.&lt;span style="color: rgb(0, 119, 136);"&gt;networkActivityIndicatorVisible&lt;/span&gt; &lt;span style="color: rgb(0, 0, 128);"&gt;=&lt;/span&gt; NO&lt;span style="color: rgb(0, 128, 128);"&gt;;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;/pre&gt;&lt;h2&gt;&lt;a class="title" href="http://kwigbo.com/wp/2009/04/07/iphone-sdk-dismiss-the-keyboard/" rel="bookmark"&gt;iPhone SDK dismiss the keyboard&lt;/a&gt;&lt;/h2&gt;             &lt;p&gt;&lt;strong&gt;Q:&lt;/strong&gt; How do you remove the keyboard when the Return/Done button is pressed?&lt;br /&gt;&lt;strong&gt;A:&lt;/strong&gt; Set the delegate on the text field that will bring up the keyboard. Add the following selector to the object that you set to be the delegate.&lt;/p&gt;  &lt;div class="wp_syntax"&gt;&lt;div class="code"&gt;&lt;pre class="cpp" style="font-family: monospace;"&gt;&lt;span style="color: rgb(0, 0, 64);"&gt;-&lt;/span&gt; &lt;span style="color: rgb(0, 128, 0);"&gt;(&lt;/span&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;BOOL&lt;/span&gt;&lt;span style="color: rgb(0, 128, 0);"&gt;)&lt;/span&gt; textFieldShouldReturn&lt;span style="color: rgb(0, 128, 128);"&gt;:&lt;/span&gt;&lt;span style="color: rgb(0, 128, 0);"&gt;(&lt;/span&gt;UITextField &lt;span style="color: rgb(0, 0, 64);"&gt;*&lt;/span&gt;&lt;span style="color: rgb(0, 128, 0);"&gt;)&lt;/span&gt; textField&lt;br /&gt;&lt;span style="color: rgb(0, 128, 0);"&gt;{&lt;/span&gt; &lt;br /&gt; &lt;span style="color: rgb(0, 128, 0);"&gt;[&lt;/span&gt;textField resignFirstResponder&lt;span style="color: rgb(0, 128, 0);"&gt;]&lt;/span&gt;&lt;span style="color: rgb(0, 128, 128);"&gt;;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt; &lt;span style="color: rgb(0, 0, 255);"&gt;return&lt;/span&gt; YES&lt;span style="color: rgb(0, 128, 128);"&gt;;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 128, 0);"&gt;}&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;/pre&gt;&lt;h2&gt;&lt;a class="title" href="http://kwigbo.com/wp/2009/04/16/iphone-sdk-load-text-file-into-nsstring/" rel="bookmark"&gt;iPhone SDK Load Text File Into NSString&lt;/a&gt;&lt;span class="date"&gt;&lt;/span&gt;&lt;br /&gt;&lt;/h2&gt;              &lt;div class="wp_syntax"&gt;&lt;div class="code"&gt;&lt;pre class="cpp" style="font-family: monospace;"&gt;NSString &lt;span style="color: rgb(0, 0, 64);"&gt;*&lt;/span&gt;path &lt;span style="color: rgb(0, 0, 128);"&gt;=&lt;/span&gt; &lt;span style="color: rgb(0, 128, 0);"&gt;[&lt;/span&gt;&lt;span style="color: rgb(0, 128, 0);"&gt;[&lt;/span&gt;NSBundle mainBundle&lt;span style="color: rgb(0, 128, 0);"&gt;]&lt;/span&gt; pathForResource&lt;span style="color: rgb(0, 128, 128);"&gt;:&lt;/span&gt;@&lt;span style="color: rgb(255, 0, 0);"&gt;"file"&lt;/span&gt; ofType&lt;span style="color: rgb(0, 128, 128);"&gt;:&lt;/span&gt;@&lt;span style="color: rgb(255, 0, 0);"&gt;"txt"&lt;/span&gt;&lt;span style="color: rgb(0, 128, 0);"&gt;]&lt;/span&gt;&lt;span style="color: rgb(0, 128, 128);"&gt;;&lt;/span&gt; &lt;br /&gt;NSString &lt;span style="color: rgb(0, 0, 64);"&gt;*&lt;/span&gt;fileText &lt;span style="color: rgb(0, 0, 128);"&gt;=&lt;/span&gt; &lt;span style="color: rgb(0, 128, 0);"&gt;[&lt;/span&gt;NSString stringWithContentsOfFile&lt;span style="color: rgb(0, 128, 128);"&gt;:&lt;/span&gt;path&lt;span style="color: rgb(0, 128, 0);"&gt;]&lt;/span&gt;&lt;span style="color: rgb(0, 128, 128);"&gt;;&lt;/span&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;&lt;pre class="cpp" style="font-family: monospace;"&gt;&lt;br /&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;&lt;pre class="cpp" style="font-family: monospace;"&gt;&lt;br /&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;  &lt;/div&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7660917028131688558-7172814277902922505?l=jainmarket.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://jainmarket.blogspot.com/feeds/7172814277902922505/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7660917028131688558&amp;postID=7172814277902922505' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7660917028131688558/posts/default/7172814277902922505'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7660917028131688558/posts/default/7172814277902922505'/><link rel='alternate' type='text/html' href='http://jainmarket.blogspot.com/2009/04/this-will-get-random-number-between-0.html' title=''/><author><name>Rahul Vyas</name><uri>http://www.blogger.com/profile/08326955903115378266</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://bp1.blogger.com/_6C_XpG63jYw/SAgrxtkt56I/AAAAAAAAACc/pr7-vuTQS5w/S220/P1170634+(Small).JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7660917028131688558.post-6830828891779052468</id><published>2009-05-01T08:32:00.000+05:30</published><updated>2009-05-01T08:35:12.774+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='IPHONE'/><title type='text'>Create UIButton/button with images</title><content type='html'>&lt;span class="author"&gt;&lt;/span&gt;&lt;span class="pubDate"&gt;&lt;/span&gt;      &lt;div style="font-weight: bold;" class="text"&gt;&lt;p style="margin: 0px; font-family: Monaco; font-style: normal; font-variant: normal; font-weight: normal; font-size: 10px; line-height: normal; font-size-adjust: none; font-stretch: normal; color: rgb(46, 13, 110);"&gt;&lt;span style="font-size:130%;"&gt;&lt;span style="color: rgb(92, 38, 153);"&gt;UIButton&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; *playButton = [[&lt;/span&gt;&lt;span style="color: rgb(92, 38, 153);"&gt;UIButton&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;buttonWithType&lt;span style="color: rgb(0, 0, 0);"&gt;:&lt;/span&gt;UIButtonTypeRoundedRect&lt;span style="color: rgb(0, 0, 0);"&gt;] &lt;/span&gt;retain&lt;span style="color: rgb(0, 0, 0);"&gt;];&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style="margin: 0px; font-family: Monaco; font-style: normal; font-variant: normal; font-weight: normal; font-size: 10px; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;&lt;span style="font-size:130%;"&gt;playButton.frame = &lt;span style="color: rgb(46, 13, 110);"&gt;CGRectMake&lt;/span&gt;(&lt;span style="color: rgb(28, 0, 207);"&gt;110.0&lt;/span&gt;, &lt;span style="color: rgb(28, 0, 207);"&gt;360.0&lt;/span&gt;, &lt;span style="color: rgb(28, 0, 207);"&gt;100.0&lt;/span&gt;, &lt;span style="color: rgb(28, 0, 207);"&gt;30.0&lt;/span&gt;);&lt;/span&gt;&lt;/p&gt;&lt;p style="margin: 0px; font-family: Monaco; font-style: normal; font-variant: normal; font-weight: normal; font-size: 10px; line-height: normal; font-size-adjust: none; font-stretch: normal; color: rgb(46, 13, 110);"&gt;&lt;span style="font-size:130%;"&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;[playButton &lt;/span&gt;setTitle&lt;span style="color: rgb(0, 0, 0);"&gt;:&lt;/span&gt;&lt;span style="color: rgb(196, 26, 22);"&gt;@"Play"&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;forState&lt;span style="color: rgb(0, 0, 0);"&gt;:&lt;/span&gt;UIControlStateNormal&lt;span style="color: rgb(0, 0, 0);"&gt;];&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style="margin: 0px; font-family: Monaco; font-style: normal; font-variant: normal; font-weight: normal; font-size: 10px; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;&lt;span style="font-size:130%;"&gt;playButton.backgroundColor = [&lt;span style="color: rgb(92, 38, 153);"&gt;UIColor&lt;/span&gt; &lt;span style="color: rgb(46, 13, 110);"&gt;clearColor&lt;/span&gt;];&lt;/span&gt;&lt;/p&gt;&lt;p style="margin: 0px; font-family: Monaco; font-style: normal; font-variant: normal; font-weight: normal; font-size: 10px; line-height: normal; font-size-adjust: none; font-stretch: normal; color: rgb(46, 13, 110);"&gt;&lt;span style="font-size:130%;"&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;[playButton &lt;/span&gt;setTitleColor&lt;span style="color: rgb(0, 0, 0);"&gt;:[&lt;/span&gt;&lt;span style="color: rgb(92, 38, 153);"&gt;UIColor&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;whiteColor&lt;span style="color: rgb(0, 0, 0);"&gt;] &lt;/span&gt;forState&lt;span style="color: rgb(0, 0, 0);"&gt;:&lt;/span&gt;UIControlStateNormal&lt;span style="color: rgb(0, 0, 0);"&gt; ];&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style="margin: 0px; font-family: Monaco; font-style: normal; font-variant: normal; font-weight: normal; font-size: 10px; line-height: normal; font-size-adjust: none; font-stretch: normal; min-height: 14px;"&gt;&lt;span style="font-size:130%;"&gt; &lt;/span&gt;&lt;/p&gt;&lt;p style="margin: 0px; font-family: Monaco; font-style: normal; font-variant: normal; font-weight: normal; font-size: 10px; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;&lt;span style="font-size:130%;"&gt;&lt;span style="color: rgb(92, 38, 153);"&gt;UIImage&lt;/span&gt; *buttonImageNormal = [&lt;span style="color: rgb(92, 38, 153);"&gt;UIImage&lt;/span&gt; &lt;span style="color: rgb(46, 13, 110);"&gt;imageNamed&lt;/span&gt;:&lt;span style="color: rgb(196, 26, 22);"&gt;@"blueButton.png"&lt;/span&gt;];&lt;/span&gt;&lt;/p&gt;&lt;p style="margin: 0px; font-family: Monaco; font-style: normal; font-variant: normal; font-weight: normal; font-size: 10px; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;&lt;span style="font-size:130%;"&gt;&lt;span style="color: rgb(92, 38, 153);"&gt;UIImage&lt;/span&gt; *strechableButtonImageNormal = [buttonImageNormal &lt;span style="color: rgb(46, 13, 110);"&gt;stretchableImageWithLeftCapWidth&lt;/span&gt;:&lt;span style="color: rgb(28, 0, 207);"&gt;12&lt;/span&gt; &lt;span style="color: rgb(46, 13, 110);"&gt;topCapHeight&lt;/span&gt;:&lt;span style="color: rgb(28, 0, 207);"&gt;0&lt;/span&gt;];&lt;/span&gt;&lt;/p&gt;&lt;p style="margin: 0px; font-family: Monaco; font-style: normal; font-variant: normal; font-weight: normal; font-size: 10px; line-height: normal; font-size-adjust: none; font-stretch: normal; color: rgb(46, 13, 110);"&gt;&lt;span style="font-size:130%;"&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;[playButton &lt;/span&gt;setBackgroundImage&lt;span style="color: rgb(0, 0, 0);"&gt;:strechableButtonImageNormal &lt;/span&gt;forState&lt;span style="color: rgb(0, 0, 0);"&gt;:&lt;/span&gt;UIControlStateNormal&lt;span style="color: rgb(0, 0, 0);"&gt;];&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style="margin: 0px; font-family: Monaco; font-style: normal; font-variant: normal; font-weight: normal; font-size: 10px; line-height: normal; font-size-adjust: none; font-stretch: normal; min-height: 14px;"&gt;&lt;span style="font-size:130%;"&gt; &lt;/span&gt;&lt;/p&gt;&lt;p style="margin: 0px; font-family: Monaco; font-style: normal; font-variant: normal; font-weight: normal; font-size: 10px; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;&lt;span style="font-size:130%;"&gt;&lt;span style="color: rgb(92, 38, 153);"&gt;UIImage&lt;/span&gt; *buttonImagePressed = [&lt;span style="color: rgb(92, 38, 153);"&gt;UIImage&lt;/span&gt; &lt;span style="color: rgb(46, 13, 110);"&gt;imageNamed&lt;/span&gt;:&lt;span style="color: rgb(196, 26, 22);"&gt;@"whiteButton.png"&lt;/span&gt;];&lt;/span&gt;&lt;/p&gt;&lt;p style="margin: 0px; font-family: Monaco; font-style: normal; font-variant: normal; font-weight: normal; font-size: 10px; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;&lt;span style="font-size:130%;"&gt;&lt;span style="color: rgb(92, 38, 153);"&gt;UIImage&lt;/span&gt; *strechableButtonImagePressed = [buttonImagePressed &lt;span style="color: rgb(46, 13, 110);"&gt;stretchableImageWithLeftCapWidth&lt;/span&gt;:&lt;span style="color: rgb(28, 0, 207);"&gt;12&lt;/span&gt; &lt;span style="color: rgb(46, 13, 110);"&gt;topCapHeight&lt;/span&gt;:&lt;span style="color: rgb(28, 0, 207);"&gt;0&lt;/span&gt;];&lt;/span&gt;&lt;/p&gt;&lt;p style="margin: 0px; font-family: Monaco; font-style: normal; font-variant: normal; font-weight: normal; font-size: 10px; line-height: normal; font-size-adjust: none; font-stretch: normal; color: rgb(46, 13, 110);"&gt;&lt;span style="font-size:130%;"&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;[playButton &lt;/span&gt;setBackgroundImage&lt;span style="color: rgb(0, 0, 0);"&gt;:strechableButtonImagePressed &lt;/span&gt;forState&lt;span style="color: rgb(0, 0, 0);"&gt;:&lt;/span&gt;UIControlStateHighlighted&lt;span style="color: rgb(0, 0, 0);"&gt;];&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style="margin: 0px; font-family: Monaco; font-style: normal; font-variant: normal; font-weight: normal; font-size: 10px; line-height: normal; font-size-adjust: none; font-stretch: normal; min-height: 14px;"&gt;&lt;span style="font-size:130%;"&gt; &lt;/span&gt;&lt;/p&gt;&lt;p style="margin: 0px; font-family: Monaco; font-style: normal; font-variant: normal; font-weight: normal; font-size: 10px; line-height: normal; font-size-adjust: none; font-stretch: normal; color: rgb(46, 13, 110);"&gt;&lt;span style="font-size:130%;"&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;[playButton &lt;/span&gt;addTarget&lt;span style="color: rgb(0, 0, 0);"&gt;:&lt;/span&gt;&lt;span style="color: rgb(170, 13, 145);"&gt;self&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;action&lt;span style="color: rgb(0, 0, 0);"&gt;:&lt;/span&gt;&lt;span style="color: rgb(170, 13, 145);"&gt;@selector&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;(playAction:) &lt;/span&gt;forControlEvents&lt;span style="color: rgb(0, 0, 0);"&gt;:&lt;/span&gt;UIControlEventTouchUpInside&lt;span style="color: rgb(0, 0, 0);"&gt;];&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style="margin: 0px; font-family: Monaco; font-style: normal; font-variant: normal; font-weight: normal; font-size: 10px; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;&lt;span style="font-size:130%;"&gt;[&lt;span style="color: rgb(170, 13, 145);"&gt;self&lt;/span&gt;.view &lt;span style="color: rgb(46, 13, 110);"&gt;addSubview&lt;/span&gt;:playButton];&lt;/span&gt;&lt;/p&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7660917028131688558-6830828891779052468?l=jainmarket.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://jainmarket.blogspot.com/feeds/6830828891779052468/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7660917028131688558&amp;postID=6830828891779052468' title='7 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7660917028131688558/posts/default/6830828891779052468'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7660917028131688558/posts/default/6830828891779052468'/><link rel='alternate' type='text/html' href='http://jainmarket.blogspot.com/2009/04/create-uibuttonbutton-with-images.html' title='Create UIButton/button with images'/><author><name>Rahul Vyas</name><uri>http://www.blogger.com/profile/08326955903115378266</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://bp1.blogger.com/_6C_XpG63jYw/SAgrxtkt56I/AAAAAAAAACc/pr7-vuTQS5w/S220/P1170634+(Small).JPG'/></author><thr:total>7</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7660917028131688558.post-7522958121969466577</id><published>2009-05-01T08:28:00.000+05:30</published><updated>2009-05-01T08:29:38.953+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='IPHONE'/><title type='text'>Splash Screen</title><content type='html'>&lt;h1&gt;&lt;span style="font-size:130%;"&gt;&lt;a href="http://iphonesdksnippets.com/post/2009/02/14/Show-splash-screen-during-loading.aspx" class="taggedlink"&gt;Show splash screen during loading&lt;/a&gt;&lt;/span&gt;&lt;/h1&gt;   &lt;span style="font-size:130%;"&gt;&lt;span class="author"&gt;&lt;/span&gt;&lt;span class="pubDate"&gt;&lt;/span&gt;&lt;/span&gt;      &lt;div class="text"&gt;&lt;p style="margin: 0px; font-family: Monaco; font-style: normal; font-variant: normal; font-weight: normal; font-size: 10px; line-height: normal; font-size-adjust: none; font-stretch: normal; color: rgb(0, 116, 0);"&gt;&lt;span style="font-size:130%;"&gt;//In AppDelegate.m&lt;/span&gt;&lt;/p&gt;&lt;p style="margin: 0px; font-family: Monaco; font-style: normal; font-variant: normal; font-weight: normal; font-size: 10px; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;&lt;span style="font-size:130%;"&gt;- (&lt;span style="color: rgb(170, 13, 145);"&gt;void&lt;/span&gt;)applicationDidFinishLaunching:(&lt;span style="color: rgb(92, 38, 153);"&gt;UIApplication&lt;/span&gt; *)application {&lt;/span&gt;&lt;/p&gt;&lt;p style="margin: 0px; font-family: Monaco; font-style: normal; font-variant: normal; font-weight: normal; font-size: 10px; line-height: normal; font-size-adjust: none; font-stretch: normal; color: rgb(196, 26, 22);"&gt;&lt;span style="font-size:130%;"&gt; &lt;/span&gt;&lt;/p&gt;&lt;p style="margin: 0px; font-family: Monaco; font-style: normal; font-variant: normal; font-weight: normal; font-size: 10px; line-height: normal; font-size-adjust: none; font-stretch: normal; color: rgb(63, 110, 116);"&gt;&lt;span style="font-size:130%;"&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;&lt;/span&gt;m_viewController&lt;span style="color: rgb(0, 0, 0);"&gt; = [[&lt;/span&gt;SplashViewController&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(46, 13, 110);"&gt;alloc&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;] &lt;/span&gt;&lt;span style="color: rgb(46, 13, 110);"&gt;initWithNibName&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;:&lt;/span&gt;&lt;span style="color: rgb(170, 13, 145);"&gt;nil&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(46, 13, 110);"&gt;bundle&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;:&lt;/span&gt;&lt;span style="color: rgb(170, 13, 145);"&gt;nil&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;];&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style="margin: 0px; font-family: Monaco; font-style: normal; font-variant: normal; font-weight: normal; font-size: 10px; line-height: normal; font-size-adjust: none; font-stretch: normal; min-height: 14px;"&gt;&lt;span style="font-size:130%;"&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style="margin: 0px; font-family: Monaco; font-style: normal; font-variant: normal; font-weight: normal; font-size: 10px; line-height: normal; font-size-adjust: none; font-stretch: normal; color: rgb(63, 110, 116);"&gt;&lt;span style="font-size:130%;"&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;[&lt;/span&gt;window&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(46, 13, 110);"&gt;addSubview&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;:&lt;/span&gt;m_viewController&lt;span style="color: rgb(0, 0, 0);"&gt;.&lt;/span&gt;&lt;span style="color: rgb(46, 13, 110);"&gt;view&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;];&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style="margin: 0px; font-family: Monaco; font-style: normal; font-variant: normal; font-weight: normal; font-size: 10px; line-height: normal; font-size-adjust: none; font-stretch: normal; color: rgb(46, 13, 110);"&gt;&lt;span style="font-size:130%;"&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;[&lt;/span&gt;&lt;span style="color: rgb(63, 110, 116);"&gt;window&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;makeKeyAndVisible&lt;span style="color: rgb(0, 0, 0);"&gt;];&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style="margin: 0px; font-family: Monaco; font-style: normal; font-variant: normal; font-weight: normal; font-size: 10px; line-height: normal; font-size-adjust: none; font-stretch: normal; color: rgb(46, 13, 110);"&gt;&lt;span style="font-size:130%;"&gt; &lt;/span&gt;&lt;/p&gt;&lt;p style="margin: 0px; font-family: Monaco; font-style: normal; font-variant: normal; font-weight: normal; font-size: 10px; line-height: normal; font-size-adjust: none; font-stretch: normal; color: rgb(0, 116, 0);"&gt;&lt;span style="font-size:130%;"&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;&lt;/span&gt;//set delay before showing new screen&lt;/span&gt;&lt;/p&gt;&lt;p style="margin: 0px; font-family: Monaco; font-style: normal; font-variant: normal; font-weight: normal; font-size: 10px; line-height: normal; font-size-adjust: none; font-stretch: normal; color: rgb(46, 13, 110);"&gt;&lt;span style="font-size:130%;"&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;[&lt;/span&gt;&lt;span style="color: rgb(92, 38, 153);"&gt;NSTimer&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;scheduledTimerWithTimeInterval&lt;span style="color: rgb(0, 0, 0);"&gt;:&lt;/span&gt;&lt;span style="color: rgb(28, 0, 207);"&gt;5.0f&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;target&lt;span style="color: rgb(0, 0, 0);"&gt;:&lt;/span&gt;&lt;span style="color: rgb(170, 13, 145);"&gt;self&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;selector&lt;span style="color: rgb(0, 0, 0);"&gt;:&lt;/span&gt;&lt;span style="color: rgb(170, 13, 145);"&gt;@selector&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;(&lt;/span&gt;&lt;span style="color: rgb(38, 71, 75);"&gt;onSlashScreenExpired&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;:) &lt;/span&gt;userInfo&lt;span style="color: rgb(0, 0, 0);"&gt;:&lt;/span&gt;&lt;span style="color: rgb(170, 13, 145);"&gt;nil&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;repeats&lt;span style="color: rgb(0, 0, 0);"&gt;:&lt;/span&gt;&lt;span style="color: rgb(170, 13, 145);"&gt;NO&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;];&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style="margin: 0px; font-family: Monaco; font-style: normal; font-variant: normal; font-weight: normal; font-size: 10px; line-height: normal; font-size-adjust: none; font-stretch: normal; min-height: 14px;"&gt;&lt;span style="font-size:130%;"&gt;}&lt;/span&gt;&lt;/p&gt;&lt;div&gt;&lt;span style="font-size:130%;"&gt; &lt;/span&gt;&lt;/div&gt;&lt;p style="margin: 0px; font-family: Monaco; font-style: normal; font-variant: normal; font-weight: normal; font-size: 10px; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;&lt;span style="font-size:130%;"&gt;- (&lt;span style="color: rgb(170, 13, 145);"&gt;void&lt;/span&gt;)onSlashScreenExpired:(&lt;span style="color: rgb(170, 13, 145);"&gt;id&lt;/span&gt;)userInfo{&lt;/span&gt;&lt;/p&gt;&lt;p style="margin: 0px; font-family: Monaco; font-style: normal; font-variant: normal; font-weight: normal; font-size: 10px; line-height: normal; font-size-adjust: none; font-stretch: normal; color: rgb(46, 13, 110);"&gt;&lt;span style="font-size:130%;"&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;[&lt;/span&gt;&lt;span style="color: rgb(63, 110, 116);"&gt;m_viewController&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;.view &lt;/span&gt;removeFromSuperview&lt;span style="color: rgb(0, 0, 0);"&gt;];&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style="margin: 0px; font-family: Monaco; font-style: normal; font-variant: normal; font-weight: normal; font-size: 10px; line-height: normal; font-size-adjust: none; font-stretch: normal; color: rgb(63, 110, 116);"&gt;&lt;span style="font-size:130%;"&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;[&lt;/span&gt;window&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(46, 13, 110);"&gt;addSubview&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;:[&lt;/span&gt;navigationController&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(46, 13, 110);"&gt;view&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;]];&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style="margin: 0px; font-family: Monaco; font-style: normal; font-variant: normal; font-weight: normal; font-size: 10px; line-height: normal; font-size-adjust: none; font-stretch: normal; color: rgb(46, 13, 110);"&gt;&lt;span style="font-size:130%;"&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;[&lt;/span&gt;&lt;span style="color: rgb(63, 110, 116);"&gt;window&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;makeKeyAndVisible&lt;span style="color: rgb(0, 0, 0);"&gt;];&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style="margin: 0px; font-family: Monaco; font-style: normal; font-variant: normal; font-weight: normal; font-size: 10px; line-height: normal; font-size-adjust: none; font-stretch: normal; min-height: 14px;"&gt;&lt;span style="font-size:130%;"&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style="margin: 0px; font-family: Monaco; font-style: normal; font-variant: normal; font-weight: normal; font-size: 10px; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;&lt;span style="font-size:130%;"&gt;}&lt;/span&gt;&lt;/p&gt;&lt;div&gt;&lt;span style="font-size:130%;"&gt; &lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7660917028131688558-7522958121969466577?l=jainmarket.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://jainmarket.blogspot.com/feeds/7522958121969466577/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7660917028131688558&amp;postID=7522958121969466577' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7660917028131688558/posts/default/7522958121969466577'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7660917028131688558/posts/default/7522958121969466577'/><link rel='alternate' type='text/html' href='http://jainmarket.blogspot.com/2009/04/splash-screen.html' title='Splash Screen'/><author><name>Rahul Vyas</name><uri>http://www.blogger.com/profile/08326955903115378266</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://bp1.blogger.com/_6C_XpG63jYw/SAgrxtkt56I/AAAAAAAAACc/pr7-vuTQS5w/S220/P1170634+(Small).JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7660917028131688558.post-2021100363078764325</id><published>2009-04-29T21:02:00.000+05:30</published><updated>2009-05-04T16:38:17.937+05:30</updated><title type='text'></title><content type='html'>http://www.servin.com/iphone/iPhone-Programming-Window-Based-App.pdf&lt;br /&gt;http://www.raddonline.com/blogs/geek-journal/iphone-sdk-uinavigationcontroller-hiding-the-navigation-bar/&lt;br /&gt;http://www.iphonedevsdk.com/forum/iphone-sdk-development/13832-please-correct-me-design-code.html&lt;br /&gt;http://cocoadevcentral.com/articles/000064.php&lt;br /&gt;http://www.iphonedevsdk.com/forum/iphone-sdk-development/11585-editable-uitableview-custom-uitableviewcell.html&lt;br /&gt;&lt;br /&gt;http://www.google.co.in/search?hl=en&amp;q=how+to+make+window+based+application+template+behave+like+navigation+based+application+template&amp;btnG=Search&amp;meta=&amp;aq=o&amp;oq=&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;http://mashable.com/2009/02/21/how-to-build-an-iphone-app/&lt;br /&gt;http://blog.daveverwer.com/iphone-development/build-an-iphone-app-in-20-minutes-source-code/&lt;br /&gt;http://eequalsmcsquare.com/iPhone-SDK?page=8&lt;br /&gt;http://www.iphonemusings.com/2009/01/iphone-programming-tutorial-creating.html&lt;br /&gt;http://www.switchonthecode.com/tutorials/an-absolute-beginners-guide-to-iphone-development#comment-2724&lt;br /&gt;http://www.switchonthecode.com/tutorials/an-absolute-beginners-guide-to-iphone-development#comment-2724&lt;br /&gt;http://www.skylarcantu.com/blog/iphone-tutorials/&lt;br /&gt;http://iphonesdksnippets.com&lt;br /&gt;&lt;br /&gt;http://www.e-string.com/content/custom-uitableviewcells-interface-builder&lt;br /&gt;http://iphonelessons.wordpress.com/2009/02/21/hello-world/&lt;br /&gt;http://www.switchonthecode.com/neat-websites/great-set-of-video-tutorials-on-iphone-uitableview&lt;br /&gt;&lt;br /&gt;http://revver.com/video/887191/uitableview-iphone-programming-tutorial/&lt;br /&gt;http://cocoacast.com/?q=node/182&lt;br /&gt;http://cocoawithlove.com/2009/04/easy-custom-uitableview-drawing.html&lt;br /&gt;&lt;br /&gt;http://www.littlecomputers.net/?page_id=549&lt;br /&gt;http://miketeo.net/wp/index.php/2008/08/31/simple-iphone-tutorial-part-1.html&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7660917028131688558-2021100363078764325?l=jainmarket.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://jainmarket.blogspot.com/feeds/2021100363078764325/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7660917028131688558&amp;postID=2021100363078764325' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7660917028131688558/posts/default/2021100363078764325'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7660917028131688558/posts/default/2021100363078764325'/><link rel='alternate' type='text/html' href='http://jainmarket.blogspot.com/2009/04/httpmashable.html' title=''/><author><name>Rahul Vyas</name><uri>http://www.blogger.com/profile/08326955903115378266</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://bp1.blogger.com/_6C_XpG63jYw/SAgrxtkt56I/AAAAAAAAACc/pr7-vuTQS5w/S220/P1170634+(Small).JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7660917028131688558.post-1695278655018747655</id><published>2009-04-28T15:11:00.000+05:30</published><updated>2009-04-28T15:23:16.818+05:30</updated><title type='text'></title><content type='html'>http://www.servin.com/iphone/iPhone-Table-of-Colors-Mini-Course.html&lt;br /&gt;&lt;br /&gt;http://developer.apple.com/iphone/library/documentation/UserExperience/Conceptual/TableView_iPhone/TableViewAndDataModel/TableViewAndDataModel.html&lt;br /&gt;&lt;br /&gt;http://www.switchonthecode.com/tutorials/an-absolute-beginners-guide-to-iphone-development&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7660917028131688558-1695278655018747655?l=jainmarket.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://jainmarket.blogspot.com/feeds/1695278655018747655/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7660917028131688558&amp;postID=1695278655018747655' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7660917028131688558/posts/default/1695278655018747655'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7660917028131688558/posts/default/1695278655018747655'/><link rel='alternate' type='text/html' href='http://jainmarket.blogspot.com/2009/04/httpwww.html' title=''/><author><name>Rahul Vyas</name><uri>http://www.blogger.com/profile/08326955903115378266</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://bp1.blogger.com/_6C_XpG63jYw/SAgrxtkt56I/AAAAAAAAACc/pr7-vuTQS5w/S220/P1170634+(Small).JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7660917028131688558.post-7772976432437914359</id><published>2009-04-27T12:51:00.000+05:30</published><updated>2009-04-28T19:59:06.778+05:30</updated><title type='text'></title><content type='html'>http://www.roseindia.net/ittraining/iPhone-Development-Training.shtml&lt;br /&gt;&lt;br /&gt;http://blog.jayway.com/2009/03/22/uitoolbars-in-iphone-os-2x/&lt;br /&gt;&lt;br /&gt;&lt;h1&gt;UITableView iPhone Programming Tutorial - Part 1&lt;br /&gt;&lt;/h1&gt;http://www.youtube.com/watch?v=e0zi5pQgpaY&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;h1&gt;iPhone App Tutorial 1&lt;/h1&gt;&lt;br /&gt;http://www.youtube.com/watch?v=Tz9mzB2fWhs&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;http://speckyboy.com/2008/07/18/35-free-icon-sets-for-your-iphone-pimp-it-up/&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7660917028131688558-7772976432437914359?l=jainmarket.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://jainmarket.blogspot.com/feeds/7772976432437914359/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7660917028131688558&amp;postID=7772976432437914359' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7660917028131688558/posts/default/7772976432437914359'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7660917028131688558/posts/default/7772976432437914359'/><link rel='alternate' type='text/html' href='http://jainmarket.blogspot.com/2009/04/httpwww_27.html' title=''/><author><name>Rahul Vyas</name><uri>http://www.blogger.com/profile/08326955903115378266</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://bp1.blogger.com/_6C_XpG63jYw/SAgrxtkt56I/AAAAAAAAACc/pr7-vuTQS5w/S220/P1170634+(Small).JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7660917028131688558.post-6351911228777097823</id><published>2009-04-24T09:35:00.000+05:30</published><updated>2009-04-27T07:39:53.900+05:30</updated><title type='text'></title><content type='html'>http://icezero.softarchive.net/beginning_iphone_development_exploring_the_iphone_sdk.28459.html&lt;br /&gt;&lt;br /&gt;http://www.cimgf.com/2008/10/01/cocoa-touch-tutorial-iphone-application-example/&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7660917028131688558-6351911228777097823?l=jainmarket.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://jainmarket.blogspot.com/feeds/6351911228777097823/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7660917028131688558&amp;postID=6351911228777097823' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7660917028131688558/posts/default/6351911228777097823'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7660917028131688558/posts/default/6351911228777097823'/><link rel='alternate' type='text/html' href='http://jainmarket.blogspot.com/2009/04/httpicezero.html' title=''/><author><name>Rahul Vyas</name><uri>http://www.blogger.com/profile/08326955903115378266</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://bp1.blogger.com/_6C_XpG63jYw/SAgrxtkt56I/AAAAAAAAACc/pr7-vuTQS5w/S220/P1170634+(Small).JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7660917028131688558.post-2135328873715695438</id><published>2009-04-02T07:59:00.000+05:30</published><updated>2009-04-02T08:00:22.238+05:30</updated><title type='text'>Flow chart assignment</title><content type='html'>1. Take the input n from user and print the n steps of Fibonacci series.&lt;br /&gt;2. Check whether the number is Armstrong or not ?&lt;br /&gt;3. Take the input from user and reverse the number&lt;br /&gt;4. Take four numbers from user and Get Min, Max and Average among these numbers.&lt;br /&gt;5. Take n number of array (input) from user and sort the array.&lt;br /&gt;6. Find the factorial of given number.&lt;br /&gt;7. Take two array of number and put the common element in third array.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7660917028131688558-2135328873715695438?l=jainmarket.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://jainmarket.blogspot.com/feeds/2135328873715695438/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7660917028131688558&amp;postID=2135328873715695438' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7660917028131688558/posts/default/2135328873715695438'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7660917028131688558/posts/default/2135328873715695438'/><link rel='alternate' type='text/html' href='http://jainmarket.blogspot.com/2009/04/flow-chart-assignment.html' title='Flow chart assignment'/><author><name>Rahul Vyas</name><uri>http://www.blogger.com/profile/08326955903115378266</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://bp1.blogger.com/_6C_XpG63jYw/SAgrxtkt56I/AAAAAAAAACc/pr7-vuTQS5w/S220/P1170634+(Small).JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7660917028131688558.post-6674037147687058316</id><published>2009-03-26T17:37:00.000+05:30</published><updated>2009-03-26T17:47:52.604+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='c++'/><category scheme='http://www.blogger.com/atom/ns#' term='c#'/><title type='text'>Object Oriented Programming</title><content type='html'>&lt;div class="Section1"&gt;  &lt;h4&gt;&lt;a name="_Toc141068460"&gt;Object Oriented Programming&lt;/a&gt;&lt;/h4&gt;  &lt;p class="MsoBodyText"&gt;&lt;span style=""&gt;Object-oriented programming is a programming paradigm that uses abstraction (in the form of classes and objects) to create models based on the real world environment.&lt;span style=""&gt;  &lt;/span&gt;An object-oriented application uses a collection of objects, which communicate by passing messages to request services.&lt;span style=""&gt;  &lt;/span&gt;Objects are capable of passing messages, receiving messages, and processing data.&lt;span style=""&gt;  &lt;/span&gt;The aim of object-oriented programming is to try to increase the flexibility and maintainability of programs.&lt;span style=""&gt;  &lt;/span&gt;Because programs created using an OO language are modular, they can be easier to develop, and simpler to understand after development.&lt;/span&gt;&lt;/p&gt;  &lt;h4&gt;&lt;span style=""&gt;Object-Oriented Programming vs. Procedural Programming&lt;/span&gt;&lt;/h4&gt;  &lt;p class="MsoNormal"&gt;&lt;span style="font-size: 11pt; font-family: Arial;"&gt; &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style="font-size: 11pt; font-family: Arial;"&gt;Programs are made up of modules, which are parts of a program that can be coded and tested separately, and then assembled to form a complete program.&lt;span style=""&gt;  &lt;/span&gt;In procedural languages (i.e. C) these modules are procedures, where a procedure is a sequence of statements.&lt;span style=""&gt;  &lt;/span&gt;In C for example, procedures are a sequence of imperative statements, such as assignments, tests, loops and invocations of sub procedures.&lt;span style=""&gt;  &lt;/span&gt;These procedures are functions, which map arguments to return statements.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style="font-size: 11pt; font-family: Arial;"&gt; &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style="font-size: 11pt; font-family: Arial;"&gt;The design method used in procedural programming is called Top Down Design.&lt;span style=""&gt;  &lt;/span&gt;This is where you start with a problem (procedure) and then systematically break the problem down into sub problems (sub procedures).&lt;span style=""&gt;  &lt;/span&gt;This is called functional decomposition, which continues until a sub problem is straightforward enough to be solved by the corresponding sub procedure.&lt;span style=""&gt;  &lt;/span&gt;The difficulties with this type of programming, is that software maintenance can be difficult and time consuming.&lt;span style=""&gt;  &lt;/span&gt;When changes are made to the main procedure (top), those changes can cascade to the sub procedures of main, and the sub-sub procedures and so on, where the change may impact all procedures in the pyramid.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style="font-size: 11pt; font-family: Arial;"&gt; &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style="font-size: 11pt; font-family: Arial;"&gt; One alternative to procedural programming is object oriented programming. Object oriented programming is meant to address the difficulties with procedural programming.&lt;span style=""&gt;  &lt;/span&gt;In object oriented programming, the main modules in a program are classes, rather than procedures.&lt;span style=""&gt;  &lt;/span&gt;The object-oriented approach lets you create classes and objects that model real world objects.&lt;span style=""&gt;  &lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style="font-size: 11pt; font-family: Arial;"&gt; &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;b style=""&gt;&lt;span style="font-size: 11pt; font-family: Arial;"&gt;Classes and Objects&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style="font-size: 11pt; font-family: Arial;"&gt;&lt;!--[if !supportEmptyParas]--&gt; &lt;!--[endif]--&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style="font-size: 11pt; font-family: Arial;"&gt;A&lt;b&gt;&lt;i&gt; class&lt;/i&gt;&lt;/b&gt; is a collection of objects that have common properties, operations and behaviours.&lt;span style=""&gt;  &lt;/span&gt;A class is a combination of state (data) and behaviour (methods).&lt;span style=""&gt;    &lt;/span&gt;In object-oriented languages, a class is a data type, and objects are instances of that data type.&lt;span style=""&gt;  &lt;/span&gt;In other words, classes are prototypes from which objects are created.&lt;span style=""&gt;  &lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style="font-size: 11pt; font-family: Arial;"&gt;&lt;!--[if !supportEmptyParas]--&gt; &lt;!--[endif]--&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style="font-size: 11pt; font-family: Arial;"&gt;For example, we may design a class Human, which is a collection of all humans in the world. Humans have state, such as height, weight, and hair color.&lt;span style=""&gt;  &lt;/span&gt;They also have behaviour, such as walking, talking, eating.&lt;span style=""&gt;  &lt;/span&gt;All of the state and behaviour of a human is encapsulated (contained) within the class human.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style="font-size: 11pt; font-family: Arial;"&gt;&lt;!--[if !supportEmptyParas]--&gt; &lt;!--[endif]--&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style="font-size: 11pt; font-family: Arial;"&gt;An&lt;/span&gt;&lt;span style="font-size: 11pt; font-family: Arial;"&gt; &lt;/span&gt;&lt;b&gt;&lt;i&gt;&lt;span style="font-size: 11pt; font-family: Arial;"&gt;object&lt;/span&gt;&lt;/i&gt;&lt;/b&gt;&lt;span style="font-size: 11pt; font-family: Arial;"&gt; is an instance of a class&lt;/span&gt;&lt;span style="font-size: 11pt; font-family: Arial;"&gt;.&lt;span style=""&gt;  &lt;/span&gt;&lt;/span&gt;&lt;span style="font-size: 11pt; font-family: Arial;"&gt;Objects are units of abstraction.&lt;span style=""&gt;  &lt;/span&gt;An object can communicate with other objects using messages.&lt;span style=""&gt;  &lt;/span&gt;An object passes a message to another object, which results in the invocation of a method.&lt;span style=""&gt;  &lt;/span&gt;Objects then perform the actions that are required to get a response from the system.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style="font-size: 11pt; font-family: Arial;"&gt;&lt;!--[if !supportEmptyParas]--&gt; &lt;!--[endif]--&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style="font-size: 11pt; font-family: Arial;"&gt;Real world objects all share two characteristics; they all have state and behaviour.&lt;span style=""&gt;  &lt;/span&gt;One-way to begin thinking in an object oriented way is to identify the state and behaviour of real world objects.&lt;span style=""&gt;  &lt;/span&gt;The complexity of objects can differ, some object have more states and more complex behaviours than other object. Compare the state and behaviour of a television to the states and behaviours of a car.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style="font-size: 11pt; font-family: Arial;"&gt;&lt;!--[if !supportEmptyParas]--&gt; &lt;!--[endif]--&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style="font-size: 11pt; font-family: Arial;"&gt;Software objects are conceptually similar to real world objects.&lt;span style=""&gt;  &lt;/span&gt;An object stores its state in fields, and it exposes its behaviours through its methods.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style="font-size: 11pt; font-family: Arial;"&gt;&lt;!--[if !supportEmptyParas]--&gt; &lt;!--[endif]--&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style=""&gt;&lt;span style="font-size: 11pt; font-family: Arial;"&gt;A fundamental principle of object oriented programming is encapsulation; the hiding of an objects internal state and requiring all interaction to be performed using the objects methods.&lt;span style=""&gt;  &lt;/span&gt;(Think of the classes used in VB.Net)&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style="font-size: 11pt; font-family: Arial;"&gt;&lt;!--[if !supportEmptyParas]--&gt; &lt;!--[endif]--&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;b style=""&gt;&lt;span style="font-size: 11pt; font-family: Arial;"&gt;Classes and Objects Example - class Bicycle&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style="font-size: 11pt; font-family: Arial;"&gt;There are many types of bicycles, but we can say that each bicycle was built from the same blueprint (or prototype) and each bicycle contains the same components.&lt;span style=""&gt;  &lt;/span&gt;Your bicycle (a specific bicycle object) is an instance of a class of objects known as bicycles.&lt;span style=""&gt;  &lt;/span&gt;Describe the state and behaviour of a bicycle.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style="font-size: 11pt; font-family: Arial;"&gt;&lt;!--[if !supportEmptyParas]--&gt; &lt;!--[endif]--&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;a name="_Toc141068464"&gt;&lt;span style="font-family: Arial;"&gt;Fields and Methods&lt;/span&gt;&lt;/a&gt;&lt;span style="font-family: Arial;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style="font-size: 11pt; font-family: Arial;"&gt; &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style="font-size: 11pt; font-family: Arial;"&gt;Objects in a class have a number of shared properties/features/attributes.&lt;span style=""&gt;  &lt;/span&gt;Fields are the variables contained in a class (encapsulated) that are used to represent these properties.&lt;span style=""&gt;  &lt;/span&gt;For example, class Student may have an integer field to represent graduation year, or a String field to represent the student’s Last Name.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style="font-size: 11pt; font-family: Arial;"&gt; &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style="font-size: 11pt; font-family: Arial;"&gt;Before fields in an object can be assigned values, the object must first be constructed/created.&lt;span style=""&gt;  &lt;/span&gt;In Java (as an example of an OO language) a special function called a &lt;b&gt;constructor&lt;/b&gt; is used to create and initialize an instance of a class.&lt;span style=""&gt;  &lt;/span&gt;The statement:&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style="font-size: 11pt; font-family: Arial;"&gt; &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style="font-size: 11pt; font-family: Arial;"&gt;new Student();&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style="font-size: 11pt; font-family: Arial;"&gt; &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style="font-size: 11pt; font-family: Arial;"&gt;creates an instance of the class Student, or in other words, a Student object.&lt;span style=""&gt;  &lt;/span&gt;Each class has operations associated with it.&lt;span style=""&gt;  &lt;/span&gt;Each Student object has a number of distinct behaviours, such as study, sleep, work, etcetera.&lt;span style=""&gt;  &lt;/span&gt;The operations associated with a class, together with the attributes of a class are encapsulated within the class.&lt;span style=""&gt;  &lt;/span&gt;These operations are called the methods of a class.&lt;span style=""&gt;  &lt;/span&gt;Methods are functions that represent the operations associated with a particular class.&lt;span style=""&gt;  &lt;/span&gt;Fields and methods are referred to as class &lt;b&gt;members&lt;/b&gt;.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style="font-size: 11pt; font-family: Arial;"&gt;&lt;!--[if !supportEmptyParas]--&gt; &lt;!--[endif]--&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin: 12pt 0in 3pt; page-break-after: avoid;"&gt;&lt;b&gt;&lt;span style="font-size: 13pt; font-family: Arial;"&gt;Encapsulation&lt;/span&gt;&lt;/b&gt;&lt;b style=""&gt;&lt;span style="font-size: 11pt; font-family: Arial;" lang="EN-CA"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;b style=""&gt;&lt;span style="font-size: 11pt; font-family: Arial;" lang="EN-CA"&gt;&lt;!--[if !supportEmptyParas]--&gt; &lt;!--[endif]--&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;b style=""&gt;&lt;span style="font-size: 11pt; font-family: Arial;"&gt;Definition: &lt;/span&gt;&lt;/b&gt;&lt;span style="font-size: 11pt; font-family: Arial;"&gt;the ability of an object to hide its data and methods from the rest of the world - one of the fundamental principles of OOP.&lt;span style=""&gt;  &lt;/span&gt;Because objects encapsulate data and implementation, the user of an object can view the object as a black box that provides services. Instance variables and methods can be added, deleted, or changed, but as long as the services provided by the object remain the same, code that uses the object can continue to use it without being rewritten.&lt;/span&gt;&lt;span style="font-size: 11pt; font-family: Arial;" lang="EN-CA"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style="font-size: 11pt; font-family: Arial;"&gt;&lt;!--[if !supportEmptyParas]--&gt; &lt;!--[endif]--&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;b style=""&gt;&lt;span style="font-size: 11pt; font-family: Arial;"&gt;Coupling&lt;/span&gt;&lt;/b&gt;&lt;span style="font-size: 11pt; font-family: Arial;"&gt; – the degree to which a module (class) depends on other classes.&lt;span style=""&gt;  &lt;/span&gt;In a good design, you should try to minimize coupling.&lt;span style=""&gt;  &lt;/span&gt;Classes should be self-contained units that have a low dependence on other classes, meaning understanding and using one class should not require an understanding of another. With low coupling a change in a module will not require changes in other modules.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style="font-size: 11pt; font-family: Arial;"&gt;&lt;!--[if !supportEmptyParas]--&gt; &lt;!--[endif]--&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style="font-size: 11pt; font-family: Arial;"&gt;Related to the concept of coupling is information hiding.&lt;span style=""&gt;  &lt;/span&gt;Information hiding &lt;/span&gt;&lt;span style="font-size: 11pt; font-family: Arial;" lang="EN"&gt;is the hiding of &lt;span style=""&gt;the implementation &lt;/span&gt;in a class or module that are most likely to change; this protects other parts of the program from change if the implementation is changed. Protecting an implementation&lt;span style=""&gt;  &lt;/span&gt;involves providing a stable &lt;/span&gt;&lt;span style="font-size: 11pt; font-family: Arial;"&gt;interface &lt;/span&gt;&lt;span style="font-size: 11pt; font-family: Arial;" lang="EN"&gt;which other classes can use to access&lt;span style=""&gt;  &lt;/span&gt;services provided by the class.&lt;span style=""&gt;  &lt;/span&gt;Often encapsulation and information hiding are used interchangeably.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style="font-size: 11pt; font-family: Arial;" lang="EN"&gt;&lt;!--[if !supportEmptyParas]--&gt; &lt;!--[endif]--&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style="font-size: 11pt; font-family: Arial;" lang="EN"&gt;Example: Car and Driver&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style="font-size: 11pt; font-family: Arial;" lang="EN"&gt;&lt;!--[if !supportEmptyParas]--&gt; &lt;!--[endif]--&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;b style=""&gt;&lt;span style="font-size: 11pt; font-family: Arial;"&gt;Cohesion &lt;/span&gt;&lt;/b&gt;&lt;span style="font-size: 11pt; font-family: Arial;"&gt;– is the measure within a module (class) of how well the members work together to provide a specific piece of functionality.&lt;span style=""&gt;  &lt;/span&gt;Cohesion is measured by how strongly related and focused the responsibilities of a single class are.&lt;span style=""&gt;  &lt;/span&gt;In good design, the cohesion should be maximized.&lt;span style=""&gt;  &lt;/span&gt;Cohesion is decreased if the methods of a class have little in common, or methods carry out many activities.&lt;span style=""&gt;  &lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style="font-size: 11pt; font-family: Arial;"&gt;&lt;!--[if !supportEmptyParas]--&gt; &lt;!--[endif]--&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style="font-size: 11pt; font-family: Arial;"&gt;If cohesion is low, modules may be difficult to understand, maintenance is difficult, because change may affect many modules, and modules cannot be reused, because it is unlikely that another application will have a use for the random grouping of functionality. &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style="font-size: 11pt; font-family: Arial;"&gt;&lt;!--[if !supportEmptyParas]--&gt; &lt;!--[endif]--&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style="font-size: 11pt; font-family: Arial;"&gt;Example:&lt;span style=""&gt;  &lt;/span&gt;Oven that has built-in radio and alarm clock.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style="font-size: 11pt; font-family: Arial;"&gt;&lt;!--[if !supportEmptyParas]--&gt; &lt;!--[endif]--&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style="font-size: 11pt; font-family: Arial;"&gt;&lt;!--[if !supportEmptyParas]--&gt; &lt;!--[endif]--&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;div style="border: 3pt solid windowtext; padding: 1pt 4pt;"&gt;  &lt;p class="MsoNormal" style="border: medium none ; padding: 0in;"&gt;&lt;b style=""&gt;&lt;i style=""&gt;&lt;span style="font-size: 13pt; font-family: Arial;"&gt;A well-designed system should maximize cohesion, and minimize coupling.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/i&gt;&lt;/b&gt;&lt;/p&gt;  &lt;/div&gt;  &lt;p class="MsoNormal"&gt;&lt;span style="font-size: 11pt; font-family: Arial;"&gt;&lt;!--[if !supportEmptyParas]--&gt; &lt;!--[endif]--&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style="font-size: 11pt; font-family: Arial;"&gt;&lt;!--[if !supportEmptyParas]--&gt; &lt;!--[endif]--&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style="font-size: 11pt; font-family: Arial;"&gt;&lt;!--[if !supportEmptyParas]--&gt; &lt;!--[endif]--&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;b style=""&gt;&lt;span style="font-size: 11pt; font-family: Arial;"&gt;Inheritance&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;b style=""&gt;&lt;span style="font-size: 11pt; font-family: Arial;"&gt;&lt;!--[if !supportEmptyParas]--&gt; &lt;!--[endif]--&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style="font-size: 11pt; font-family: Arial;"&gt;Multiple classes may share some of the same characteristics, and have things in common with one another, but also may have certain properties that make them different.&lt;span style=""&gt;  &lt;/span&gt;Object oriented programming languages allow classes to inherit commonly used state and behaviour from other classes.&lt;span style=""&gt;  &lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style="font-size: 11pt; font-family: Arial;"&gt;&lt;!--[if !supportEmptyParas]--&gt; &lt;!--[endif]--&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style="font-size: 11pt; font-family: Arial;"&gt;Classes in Java occur in &lt;b&gt;inheritance hierarchies&lt;/b&gt;.&lt;span style=""&gt;  &lt;/span&gt;These hierarchies consist of parent child relationships among the classes.&lt;span style=""&gt;  &lt;/span&gt;Inheritance is used to specialize a parent class, but creating a child class (example).&lt;span style=""&gt;  &lt;/span&gt;Inheritance also allows designers to combine features of classes in a common parent.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style="font-size: 11pt; font-family: Arial;"&gt;&lt;!--[if !supportEmptyParas]--&gt; &lt;!--[endif]--&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style="font-size: 11pt; font-family: Arial;"&gt;Example: Student&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style="font-size: 11pt; font-family: Arial;"&gt; &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style=""&gt;&lt;b style=""&gt;&lt;span style="font-size: 11pt; font-family: Arial;"&gt;Benefits of Object Oriented Programming&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style=""&gt;&lt;span style="font-size: 11pt; font-family: Arial;"&gt;&lt;!--[if !supportEmptyParas]--&gt; &lt;!--[endif]--&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-left: 0.25in; text-indent: -0.25in;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style="font-size: 11pt; font-family: Arial;"&gt;1.&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;      &lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;&lt;b&gt;&lt;span style="font-size: 11pt; font-family: Arial;"&gt;Modularity&lt;/span&gt;&lt;/b&gt;&lt;span style="font-size: 11pt; font-family: Arial;"&gt;: The source code for a class can be written and maintained independently of the source code for other classes. Once created, an object can be easily passed around inside the system. &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-left: 0.25in; text-indent: -0.25in;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style="font-size: 11pt; font-family: Arial;"&gt;2.&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;      &lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;&lt;b&gt;&lt;span style="font-size: 11pt; font-family: Arial;"&gt;Information-hiding:&lt;/span&gt;&lt;/b&gt;&lt;span style="font-size: 11pt; font-family: Arial;"&gt; By interacting only with an object's methods, the details of its internal implementation remain hidden from the outside world. &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-left: 0.25in; text-indent: -0.25in;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style="font-size: 11pt; font-family: Arial;"&gt;3.&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;      &lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;&lt;b&gt;&lt;span style="font-size: 11pt; font-family: Arial;"&gt;Code re-use:&lt;/span&gt;&lt;/b&gt;&lt;span style="font-size: 11pt; font-family: Arial;"&gt; If a class already exists, you can use objects from that class in your program. This allows programmers to implement/test/debug complex, task-specific objects, which you can then use in your own code. &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-left: 0.25in; text-indent: -0.25in;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style="font-size: 11pt; font-family: Arial;"&gt;4.&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;      &lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;&lt;b&gt;&lt;span style="font-size: 11pt; font-family: Arial;"&gt;Easy Debugging:&lt;/span&gt;&lt;/b&gt;&lt;span style="font-size: 11pt; font-family: Arial;"&gt; If a particular object turns out to be a problem, you can simply remove it from your application and plug in a different object as its replacement. This is analogous to fixing mechanical problems in the real world. If a bolt breaks, you replace &lt;i&gt;it&lt;/i&gt;, not the entire machine. &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin: 12pt 0in 3pt; page-break-after: avoid;"&gt;&lt;b&gt;&lt;i&gt;&lt;span style="font-size: 14pt; font-family: Arial;"&gt;Summary of Object-Oriented Concepts&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/i&gt;&lt;/b&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-left: 0.25in; text-indent: -0.25in;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style="font-size: 11pt; font-family: Arial;"&gt;1.&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;      &lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;&lt;span style="font-size: 11pt; font-family: Arial;"&gt;Everything is an object.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-left: 0.25in; text-indent: -0.25in;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style="font-size: 11pt; font-family: Arial;"&gt;2.&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;      &lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;&lt;span style="font-size: 11pt; font-family: Arial;"&gt;Computation is performed by objects communicating with each other, requesting that other objects perform actions.&lt;span style=""&gt;  &lt;/span&gt;Objects communicate by sending and receiving messages.&lt;span style=""&gt;  &lt;/span&gt;A message is a request for action, bundled with whatever arguments may be necessary to complete the tasks.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-left: 0.25in; text-indent: -0.25in;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style="font-size: 11pt; font-family: Arial;"&gt;3.&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;      &lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;&lt;span style="font-size: 11pt; font-family: Arial;"&gt;Each object has its own memory, which consists of other objects.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-left: 0.25in; text-indent: -0.25in;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style="font-size: 11pt; font-family: Arial;"&gt;4.&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;      &lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;&lt;span style="font-size: 11pt; font-family: Arial;"&gt;Every object is an instance of a class.&lt;span style=""&gt;  &lt;/span&gt;A class simply represents a grouping of similar objects, such as Integers or lists.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-left: 0.25in; text-indent: -0.25in;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style="font-size: 11pt; font-family: Arial;"&gt;5.&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;      &lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;&lt;span style="font-size: 11pt; font-family: Arial;"&gt;The class is the repository for behaviour associated with an object.&lt;span style=""&gt;  &lt;/span&gt;That is, that all objects that are instances of the same class can perform the same actions.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin-left: 0.25in; text-indent: -0.25in;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style="font-size: 11pt; font-family: Arial;"&gt;6.&lt;span style="font-family: &amp;quot;Times New Roman&amp;quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"&gt;      &lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;&lt;span style="font-size: 11pt; font-family: Arial;"&gt;Classes are organized into a singly rooted tree structure, called the inheritance hierarchy.&lt;span style=""&gt;  &lt;/span&gt;Memory and behaviour associated with instances of a class are automatically available to any class associated with a descendant in this tree structure.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style="font-size: 11pt; font-family: Arial;"&gt;&lt;!--[if !supportEmptyParas]--&gt; &lt;!--[endif]--&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7660917028131688558-6674037147687058316?l=jainmarket.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://jainmarket.blogspot.com/feeds/6674037147687058316/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7660917028131688558&amp;postID=6674037147687058316' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7660917028131688558/posts/default/6674037147687058316'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7660917028131688558/posts/default/6674037147687058316'/><link rel='alternate' type='text/html' href='http://jainmarket.blogspot.com/2009/03/object-oriented-programming.html' title='Object Oriented Programming'/><author><name>Rahul Vyas</name><uri>http://www.blogger.com/profile/08326955903115378266</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://bp1.blogger.com/_6C_XpG63jYw/SAgrxtkt56I/AAAAAAAAACc/pr7-vuTQS5w/S220/P1170634+(Small).JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7660917028131688558.post-6892520691465731544</id><published>2009-03-20T20:53:00.001+05:30</published><updated>2009-03-20T20:53:46.010+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='c++'/><category scheme='http://www.blogger.com/atom/ns#' term='c#'/><category scheme='http://www.blogger.com/atom/ns#' term='c'/><title type='text'>Structure Vs Class</title><content type='html'>&lt;p align="center"&gt;&lt;b&gt;&lt;span style="font-size:180%;color:#000080;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;     &lt;p&gt;Visual Basic .NET unifies the syntax for structures and classes, with the    result that both entities support most of the same features. However, there    are also important differences between structures and classes.&lt;/p&gt;   &lt;h3 class="dtH3"&gt;Similarities&lt;/h3&gt;   &lt;p&gt;Structures and classes are similar in the following respects: &lt;/p&gt;   &lt;ul type="disc"&gt;&lt;li&gt;Both are &lt;i&gt;container&lt;/i&gt; types, meaning that they contain other types      as members. &lt;/li&gt;&lt;li&gt;Both have members, which can include constructors, methods, properties,      fields, constants, enumerations, events, and event handlers. &lt;/li&gt;&lt;li&gt;Members of both can have individualized accessibilities. For example,      one member can be declared &lt;b&gt;Public&lt;/b&gt; and another &lt;b&gt;Private&lt;/b&gt;. &lt;/li&gt;&lt;li&gt;Both can implement interfaces. &lt;/li&gt;&lt;li&gt;Both can have shared constructors, with or without parameters. &lt;/li&gt;&lt;li&gt;Both can expose a default property, provided that property takes at      least one argument. &lt;/li&gt;&lt;li&gt;Both can declare and raise events, and both can declare delegates. &lt;/li&gt;&lt;/ul&gt;   &lt;h3 class="dtH3"&gt;Differences&lt;/h3&gt;   &lt;p&gt;Structures and classes differ in the following particulars: &lt;/p&gt;   &lt;ul type="disc"&gt;&lt;li&gt;Structures are value types; classes are reference types. &lt;/li&gt;&lt;li&gt;Structures use stack allocation; classes use heap allocation. &lt;/li&gt;&lt;li&gt;All structure members are &lt;b&gt;Public&lt;/b&gt; by default; class variables and      constants are &lt;b&gt;Private&lt;/b&gt; by default, while other class members are &lt;b&gt;     Public&lt;/b&gt; by default. This behavior for class members provides      compatibility with the Visual Basic 6.0 system of defaults. &lt;/li&gt;&lt;li&gt;A structure must have at least one nonshared variable or event member; a      class can be completely empty. &lt;/li&gt;&lt;li&gt;Structure members cannot be declared as &lt;b&gt;Protected&lt;/b&gt;; class members      can. &lt;/li&gt;&lt;li&gt;A structure procedure can handle events only if it is a &lt;b&gt;Shared Sub&lt;/b&gt;      procedure, and only by means of the &lt;b&gt;AddHandler&lt;/b&gt; statement; any class      procedure can handle events, using either the &lt;b&gt;Handles&lt;/b&gt; keyword or the     &lt;b&gt;AddHandler&lt;/b&gt; statement. &lt;/li&gt;&lt;li&gt;Structure variable declarations cannot specify initializers, the &lt;b&gt;New&lt;/b&gt;      keyword, or initial sizes for arrays; class variable declarations can. &lt;/li&gt;&lt;li&gt;Structures implicitly inherit from the &lt;b&gt;ValueType&lt;/b&gt; class and cannot      inherit from any other type; classes can inherit from any class or classes      other than &lt;b&gt;ValueType&lt;/b&gt;. &lt;/li&gt;&lt;li&gt;Structures are not inheritable; classes are. &lt;/li&gt;&lt;li&gt;Structures are never terminated, so the common language runtime (CLR)      never calls the &lt;b&gt;Finalize&lt;/b&gt; method on any structure; classes are      terminated by the garbage collector, which calls &lt;b&gt;Finalize&lt;/b&gt; on a class      when it detects there are no active references remaining. &lt;/li&gt;&lt;li&gt;A structure does not require a constructor; a class does. &lt;/li&gt;&lt;li&gt;Structures can have nonshared constructors only if they take parameters;      classes can have them with or without parameters. &lt;/li&gt;&lt;/ul&gt;   &lt;p&gt;Every structure has an implicit public constructor without parameters. This    constructor initializes all the structure's data members to their default    values. You cannot redefine this behavior.&lt;/p&gt;   &lt;h3 class="dtH3"&gt;Instances and Variables&lt;/h3&gt;   &lt;p&gt;Because structures are value types, each structure variable is permanently    bound to an individual structure instance. But classes are reference types,    and an object variable can refer to various class instances. This distinction    affects your usage of structures and classes in the following ways: &lt;/p&gt;   &lt;ul type="disc"&gt;&lt;li&gt;A structure variable implicitly includes an initialization of the      members using the structure's parameterless constructor. Therefore,     &lt;code class="ce"&gt;Dim S As Struct1&lt;/code&gt; is equivalent to &lt;code class="ce"&gt;     Dim S As Struct1 = New Struct1()&lt;/code&gt;. &lt;/li&gt;&lt;li&gt;When you assign one structure variable to another, or pass a structure      instance to a procedure argument, the current values of all the variable      members are copied to the new structure. When you assign one object variable      to another, or pass an object variable to a procedure, only the reference      pointer is copied. &lt;/li&gt;&lt;li&gt;You can assign the value &lt;b&gt;Nothing&lt;/b&gt; to a structure variable, but the      instance continues to be associated with the variable. You can still call      its methods and access its data members, although variable members are      reinitialized by the assignment. In contrast, if you set an object variable      to &lt;b&gt;Nothing&lt;/b&gt;, you dissociate it from any class instance, and you cannot      access any members through the variable until you assign another instance to      it. &lt;/li&gt;&lt;li&gt;An object variable can have different class instances assigned to it at      different times, and several object variables can refer to the same class      instance at the same time. Changes you make to the values of class members      affect those members when accessed through another variable pointing to the      same instance. Structure members, however, are isolated within their own      instance. Changes to their values are not reflected in any other structure      variables, even in other instances of the same &lt;b&gt;Structure&lt;/b&gt; declaration.     &lt;/li&gt;&lt;li&gt;Equality testing of two structures must be performed with a      member-by-member test. Two object variables can be compared using the &lt;b&gt;     Equals&lt;/b&gt; method. &lt;b&gt;Equals&lt;/b&gt; indicates whether the two variables point      to the same instance. &lt;/li&gt;&lt;/ul&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7660917028131688558-6892520691465731544?l=jainmarket.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://jainmarket.blogspot.com/feeds/6892520691465731544/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7660917028131688558&amp;postID=6892520691465731544' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7660917028131688558/posts/default/6892520691465731544'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7660917028131688558/posts/default/6892520691465731544'/><link rel='alternate' type='text/html' href='http://jainmarket.blogspot.com/2009/03/structure-vs-class.html' title='Structure Vs Class'/><author><name>Rahul Vyas</name><uri>http://www.blogger.com/profile/08326955903115378266</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://bp1.blogger.com/_6C_XpG63jYw/SAgrxtkt56I/AAAAAAAAACc/pr7-vuTQS5w/S220/P1170634+(Small).JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7660917028131688558.post-5793480003682099709</id><published>2009-03-20T20:51:00.000+05:30</published><updated>2009-03-20T20:52:09.048+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='c++'/><category scheme='http://www.blogger.com/atom/ns#' term='c#'/><category scheme='http://www.blogger.com/atom/ns#' term='c'/><title type='text'>What is the difference between Object Oriented Programming and Procedural Programming?</title><content type='html'>&lt;h3 class="storytitle"&gt;&lt;a href="http://saimaterial.wordpress.com/2007/09/14/1what-is-the-difference-between-object-oriented-programming-and-procedural-programming/" rel="bookmark"&gt;&lt;br /&gt;&lt;/a&gt;&lt;/h3&gt;        &lt;p&gt;&lt;span style="font-family: Arial;"&gt;Procedural programming creates a step by step program that guides the application through a sequence of instructions. Each instruction is executed in order. Procedural programming also focuses on the idea that all algorithms are executed with functions and data that the programmer has access to and is able to change.&lt;/span&gt;&lt;span style="font-family: Arial;"&gt; &lt;/span&gt;&lt;span style="font-family: Arial;"&gt;Object-Oriented programming is much more similar to the way the real world works; it is analogous to the human brain. Each program is made up of many entities called objects. Objects become the fundamental units and have behavior, or a specific purpose, associated with them. Objects cannot directly access another object’s data. Instead, a message must be sent requesting the data, just like people must ask one another for information; we cannot see inside each other’s heads.&lt;/span&gt;&lt;span style="font-family: Arial;"&gt; &lt;/span&gt;&lt;span style="font-family: Arial;"&gt;Benefits of Object-Oriented programming include:&lt;/span&gt;&lt;span style="font-family: Arial;"&gt; &lt;/span&gt;&lt;/p&gt; &lt;ul&gt;&lt;li class="MsoNormal"&gt;&lt;span style="font-family: Arial;"&gt;ability to simulate real-world event much more effectively &lt;/span&gt;&lt;/li&gt;&lt;li class="MsoNormal"&gt;&lt;span style="font-family: Arial;"&gt;code is reusable thus less code may have to be written &lt;/span&gt;&lt;/li&gt;&lt;li class="MsoNormal"&gt;&lt;span style="font-family: Arial;"&gt;data becomes active &lt;/span&gt;&lt;/li&gt;&lt;li class="MsoNormal"&gt;&lt;span style="font-family: Arial;"&gt;better able to create GUI (graphical user interface) applications &lt;/span&gt;&lt;/li&gt;&lt;li class="MsoNormal"&gt;&lt;span style="font-family: Arial;"&gt;programmers are able to reach their goals faster &lt;/span&gt;&lt;/li&gt;&lt;li class="MsoNormal"&gt;&lt;span style="font-family: Arial;"&gt;Programmers are able to produce faster, more accurate and better-written applications (in the case of a veteran programmer, by a factor of as much as 20 times compared with a procedural program).&lt;/span&gt;&lt;/li&gt;&lt;/ul&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7660917028131688558-5793480003682099709?l=jainmarket.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://jainmarket.blogspot.com/feeds/5793480003682099709/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7660917028131688558&amp;postID=5793480003682099709' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7660917028131688558/posts/default/5793480003682099709'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7660917028131688558/posts/default/5793480003682099709'/><link rel='alternate' type='text/html' href='http://jainmarket.blogspot.com/2009/03/what-is-difference-between-object.html' title='What is the difference between Object Oriented Programming and Procedural Programming?'/><author><name>Rahul Vyas</name><uri>http://www.blogger.com/profile/08326955903115378266</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://bp1.blogger.com/_6C_XpG63jYw/SAgrxtkt56I/AAAAAAAAACc/pr7-vuTQS5w/S220/P1170634+(Small).JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7660917028131688558.post-8216617567555830628</id><published>2009-03-20T11:55:00.000+05:30</published><updated>2009-03-27T19:02:40.464+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='Links'/><title type='text'>Web Links for Object Oriented Programming</title><content type='html'>&lt;div xmlns='http://www.w3.org/1999/xhtml'&gt;http://ignou.ac.in/MASTERS(II).doc&lt;br/&gt;&lt;br/&gt;the best tutorial(*****)&lt;br/&gt;http://www.jgcampbell.com/oopcpp/html/node2.html&lt;br/&gt;&lt;br/&gt;http://net.pku.edu.cn/~course/cs101/resource/CppHowToProgram/5e/html/ch01.html&lt;br/&gt;&lt;br/&gt;&lt;b&gt;&lt;code&gt;jg.campbell@ntlworld.com&lt;/code&gt;&lt;/b&gt;&lt;br/&gt;&lt;br/&gt;http://debuggable.com/posts/introduction-to-test-driven-development-tdd-part-1:480f4dfd-e8f4-4a82-923c-4625cbdd56cb&lt;br/&gt;http://debuggable.com/posts/introduction-to-test-driven-development-tdd-part-2:480f4dfd-b3e4-4f84-9399-4084cbdd56cb&lt;br/&gt;http://debuggable.com/posts/problems-with-repeatitive-source-code-or-better-dont-repeat-yourself:480f4dfd-ac70-4f1b-907b-4eb4cbdd56cb&lt;br/&gt;http://debuggable.com/posts/the-various-kinds-of-design-patterns:480f4dfe-eab0-49ad-b2b0-4575cbdd56cb&lt;br/&gt;http://www.javaworld.com/javaworld/jw-07-1999/jw-07-toolbox.html?page=1&lt;br/&gt;&lt;br/&gt;http://www.programmersheaven.com/2/Art_ObjBasedSystems&lt;br/&gt;&lt;br/&gt;http://wiki.tcl.tk/13398&lt;br/&gt;&lt;br/&gt;http://www.archwing.com/technet/technet_OO.html&lt;br/&gt;&lt;br/&gt;http://www.catalysoft.com/articles/simulatingOO.html&lt;br/&gt;&lt;br/&gt;http://www.ctp.bilkent.edu.tr/~russell/java/LectureNotes/1_OOConcepts.htm&lt;br/&gt;&lt;br/&gt;http://www.scribd.com/doc/7281196/Ooc-Slides&lt;br/&gt;&lt;br/&gt;http://www.codeproject.com/KB/books/OOP_Polymorphism.aspx&lt;br/&gt;&lt;br/&gt;http://mycplus.com/source-code/c-source-code/great-librarian-2001/&lt;br/&gt;&lt;br/&gt;http://dir.yahoo.com/Computers_and_Internet/Programming_and_Development/Methodologies/Object_Oriented_Programming/&lt;br/&gt;&lt;br/&gt;http://mycplus.com/category/source-code/c-source-code/&lt;br/&gt;&lt;br/&gt;http://mycplus.com/category/source-code/cplusplus-source-code/&lt;br/&gt;&lt;br/&gt;http://mycplus.com/tutorials/csharp-programming-tutorials/microsoft-net/&lt;br/&gt;&lt;br/&gt;http://www.research.att.com/~bs/whatis.pdf&lt;br/&gt;&lt;br/&gt;http://www.owlnet.rice.edu/~mech517/Books/oop3.pdf&lt;br/&gt;&lt;br/&gt;http://www.restafari.org/object-oriented-sheep-running-in-ruby-shoes.html&lt;br/&gt;&lt;br/&gt;http://www.startvbdotnet.com/oop/default.aspx&lt;br/&gt;&lt;br/&gt;http://gd.tuwien.ac.at/languages/c/c++oop-pmueller/node3.html#SECTION00350000000000000000&lt;br/&gt;&lt;br/&gt;http://www.codinghorror.com/blog/archives/000801.html&lt;br/&gt;&lt;br/&gt;http://www.tutorialized.com/tutorial/bject-Oriented-Programming-Vs-Procedure-oriented-programming---C%2B%2B/27666&lt;br/&gt;&lt;br/&gt;http://www.indianjournals.com/ijor.aspx?target=ijor:glogift2k5&amp;amp;volume=1&amp;amp;issue=1&amp;amp;article=chap037&amp;amp;type=pdf&lt;br/&gt;&lt;br/&gt;http://objectmix.com/c/784333-procedural-vs-object-oriented-programming-methodology.html&lt;br/&gt;&lt;br/&gt;http://bpsharma.in/StructureVsClass.htm&lt;br/&gt;&lt;br/&gt;http://wiki.answers.com/Q/Difference_between_object_oriented_and_non_object_oriented_languages&lt;br/&gt;&lt;br/&gt;http://www.astahost.com/info.php/Tutorial-Lesson-4-Object-Oriented-Programming_t15397.html&lt;br/&gt;&lt;br/&gt;http://en.wikipedia.org/wiki/C%2B%2B_structures_and_classes&lt;br/&gt;&lt;br/&gt;http://forums.devshed.com/c-programming-42/declaring-function-in-structure-in-c-545529.html&lt;br/&gt;&lt;br/&gt;&lt;div class='zemanta-pixie'&gt;&lt;img src='http://img.zemanta.com/pixy.gif?x-id=0bbb91ea-5957-84ca-81db-0c357aef1e10' class='zemanta-pixie-img'/&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7660917028131688558-8216617567555830628?l=jainmarket.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://jainmarket.blogspot.com/feeds/8216617567555830628/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7660917028131688558&amp;postID=8216617567555830628' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7660917028131688558/posts/default/8216617567555830628'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7660917028131688558/posts/default/8216617567555830628'/><link rel='alternate' type='text/html' href='http://jainmarket.blogspot.com/2009/03/httpignou.html' title='Web Links for Object Oriented Programming'/><author><name>Rahul Vyas</name><uri>http://www.blogger.com/profile/08326955903115378266</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://bp1.blogger.com/_6C_XpG63jYw/SAgrxtkt56I/AAAAAAAAACc/pr7-vuTQS5w/S220/P1170634+(Small).JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7660917028131688558.post-5980973906126955275</id><published>2009-03-19T19:08:00.001+05:30</published><updated>2009-03-27T19:03:04.224+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='c#'/><title type='text'>web links</title><content type='html'>&lt;div xmlns='http://www.w3.org/1999/xhtml'&gt;http://objc.toodarkpark.net/oop.html&lt;br/&gt;&lt;br/&gt;http://www.softwaredesign.com/objects.html&lt;br/&gt;&lt;br/&gt;&lt;div class='zemanta-pixie'&gt;&lt;img src='http://img.zemanta.com/pixy.gif?x-id=69cbb899-93f1-87aa-a363-2d65bd3dd40e' class='zemanta-pixie-img'/&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7660917028131688558-5980973906126955275?l=jainmarket.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://jainmarket.blogspot.com/feeds/5980973906126955275/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7660917028131688558&amp;postID=5980973906126955275' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7660917028131688558/posts/default/5980973906126955275'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7660917028131688558/posts/default/5980973906126955275'/><link rel='alternate' type='text/html' href='http://jainmarket.blogspot.com/2009/03/httpobjc.html' title='web links'/><author><name>Rahul Vyas</name><uri>http://www.blogger.com/profile/08326955903115378266</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://bp1.blogger.com/_6C_XpG63jYw/SAgrxtkt56I/AAAAAAAAACc/pr7-vuTQS5w/S220/P1170634+(Small).JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7660917028131688558.post-2339366040940048155</id><published>2009-03-18T20:00:00.001+05:30</published><updated>2009-03-18T20:00:40.333+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='c#'/><title type='text'>Overloading And Overriding</title><content type='html'>&lt;span style="font-size:85%;"&gt;&lt;p&gt;Q: &lt;b&gt;Method Overloading ?&lt;/b&gt;&lt;/p&gt; &lt;p&gt;Ans:&lt;/p&gt; &lt;p&gt;Method overloading means having two or more methods with the same name but different signatures in the same scope. These two methods may exist in the same class or anoter one in base class and another in derived class.&lt;/p&gt; &lt;p&gt; &lt;/p&gt;&lt;b&gt; &lt;p&gt;class Person &lt;/p&gt; &lt;p&gt;{&lt;/p&gt;&lt;/b&gt; &lt;blockquote dir="ltr" style="margin-right: 0px;"&gt; &lt;p&gt;private String firstName;&lt;/p&gt; &lt;p&gt;private String lastName;&lt;/p&gt; &lt;p&gt;Person() &lt;/p&gt; &lt;p&gt;{&lt;/p&gt; &lt;blockquote dir="ltr" style="margin-right: 0px;"&gt; &lt;p&gt;this.firstName = "";&lt;/p&gt; &lt;p&gt;this.lastName = "";&lt;/p&gt;&lt;/blockquote&gt; &lt;p&gt;}&lt;/p&gt; &lt;p&gt;Person(String FirstName) &lt;/p&gt; &lt;p&gt;{&lt;/p&gt; &lt;blockquote dir="ltr" style="margin-right: 0px;"&gt; &lt;p&gt;this.firstName = FirstName;&lt;/p&gt; &lt;p&gt;this.lastName = "";&lt;/p&gt;&lt;/blockquote&gt; &lt;p&gt;}&lt;/p&gt; &lt;p&gt;Person(String FirstName, String LastName) &lt;/p&gt; &lt;p&gt;{&lt;/p&gt; &lt;blockquote dir="ltr" style="margin-right: 0px;"&gt; &lt;p&gt;this.firstName = FirstName;&lt;/p&gt; &lt;p&gt;this.lastName = LastName;&lt;/p&gt;&lt;/blockquote&gt; &lt;p&gt;}&lt;/p&gt;&lt;/blockquote&gt;&lt;b&gt; &lt;p&gt;}&lt;/p&gt;&lt;/b&gt; &lt;p&gt;&lt;b&gt;Calling Overloaded Methods.&lt;/b&gt; &lt;/p&gt; &lt;blockquote dir="ltr" style="margin-right: 0px;"&gt; &lt;p&gt;Person(); // as a constructor and call method without parameter&lt;/p&gt; &lt;p&gt;Person(userFirstName); // as a constructor and call method with one parameter(like User's first Name)&lt;/p&gt; &lt;p&gt;Person(userFirstName,userLastName); // as a constructor and call method with one parameter(like User's first Name)&lt;/p&gt;&lt;/blockquote&gt; &lt;p&gt;&lt;b&gt;When to use Method Overloading?&lt;/b&gt;&lt;/p&gt; &lt;p&gt;Generally, you should consider overloading a method when you have required same reason that take different signatures, but conceptually do the same thing. &lt;/p&gt;&lt;span style="font-size:85%;"&gt; &lt;p&gt;-----------------------------------------------------------------------------------------&lt;/p&gt; &lt;p&gt;Q: &lt;b&gt;Method Overriding?&lt;/b&gt;&lt;/p&gt; &lt;p&gt;Ans:&lt;/p&gt; &lt;p&gt;Method overriding means having a &lt;b&gt;different implementation of the same method&lt;/b&gt; in the &lt;b&gt;inherited class&lt;/b&gt;. These two methods would have the &lt;b&gt;same signature, but different implementation&lt;/b&gt;. One of these would exist in the &lt;b&gt;base class&lt;/b&gt; and another in the &lt;b&gt;derived class&lt;/b&gt;. These cannot exist in the same class.&lt;/p&gt; &lt;p&gt; &lt;/p&gt; &lt;p&gt;Overriding methods &lt;/p&gt; &lt;p&gt;Overriding method definitions&lt;/p&gt; &lt;p&gt;In a derived class, if you include a method definition that has the same name and exactly the same number and types of parameters as a method already defined in the base class, this new definition replaces the old definition of the method.&lt;/p&gt; &lt;p&gt;Explanation&lt;/p&gt; &lt;p&gt;A subclass inherits methods from a superclass. Sometimes, it is necessary for the subclass to modify the methods defined in the superclass. This is referred to as method overriding. The following example demonstrates method overriding.&lt;/p&gt;&lt;b&gt; &lt;p&gt;Step 1&lt;/p&gt;&lt;/b&gt; &lt;p&gt;In this example we will define a base class called Circle&lt;/p&gt; &lt;p&gt;&lt;strong&gt;class Circle&lt;br /&gt;{&lt;/strong&gt;&lt;/p&gt;&lt;/span&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="font-family:Times New Roman;"&gt;&lt;span style="font-size:85%;"&gt; &lt;blockquote dir="ltr" style="margin-right: 0px;"&gt; &lt;p&gt;//declaring the instance variable&lt;/p&gt; &lt;p&gt;protected double radius;&lt;/p&gt; &lt;p dir="ltr" style="margin-right: 0px;"&gt;public Circle(double radius)&lt;br /&gt;{&lt;br /&gt;      this.radius = radius;&lt;br /&gt;}&lt;/p&gt; &lt;p&gt;// other method definitions here&lt;/p&gt; &lt;p&gt;public double getArea()&lt;br /&gt;{&lt;br /&gt;      return Math.PI*radius*radius;&lt;/p&gt; &lt;p&gt;}//this method returns the area of the circle&lt;/p&gt;&lt;/blockquote&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;  &lt;p&gt;&lt;span style="font-size:85%;"&gt;&lt;strong&gt;}&lt;/strong&gt;// end of class circle &lt;/span&gt;&lt;/p&gt; &lt;p&gt;&lt;span style="font-size:85%;"&gt;When the getArea method is invoked from an instance of the Circle class, the method returns the area of the circle.&lt;/span&gt;&lt;/p&gt;&lt;span style="font-size:85%;"&gt;&lt;b&gt; &lt;p&gt;Step 2&lt;/p&gt;&lt;/b&gt; &lt;/span&gt;&lt;p&gt;&lt;span style="font-size:85%;"&gt;The next step is to define a subclass to override the getArea() method in the Circle class. The derived class will be the Cylinder class. The getArea() method in the Circle class computes the area of a circle, while the getArea method in the Cylinder class computes the surface area of a cylinder.&lt;/span&gt;&lt;/p&gt; &lt;p&gt;&lt;span style="font-size:85%;"&gt;The Cylinder class is defined below.&lt;/span&gt;&lt;/p&gt; &lt;p&gt;&lt;span style="font-size:85%;"&gt;&lt;strong&gt;class Cylinder extends Circle&lt;br /&gt;{&lt;/strong&gt;&lt;/span&gt;&lt;/p&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="font-family:Times New Roman;"&gt;&lt;span style="font-size:85%;"&gt; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;blockquote dir="ltr" style="margin-right: 0px;"&gt; &lt;p&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="font-family:Times New Roman;"&gt;&lt;span style="font-size:85%;"&gt;//declaring the instance variable&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt; &lt;p&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="font-family:Times New Roman;"&gt;&lt;span style="font-size:85%;"&gt;protected double length;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt; &lt;p&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="font-family:Times New Roman;"&gt;&lt;span style="font-size:85%;"&gt;public Cylinder(double radius, double length)&lt;br /&gt;{&lt;br /&gt;     super(radius);&lt;br /&gt;     this.length = length;&lt;br /&gt;} &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt; &lt;p&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="font-family:Times New Roman;"&gt;&lt;span style="font-size:85%;"&gt;// other method definitions here&lt;br /&gt;&lt;br /&gt;public double getArea()&lt;br /&gt;{&lt;br /&gt;     // method overriden here&lt;br /&gt;     return 2*super.getArea()+2*Math.PI*radius*length;&lt;br /&gt;}//this method returns the cylinder surface area&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;/blockquote&gt; &lt;p&gt;&lt;span style="font-size:85%;"&gt;&lt;strong&gt;}&lt;/strong&gt;// end of class Cylinder&lt;/span&gt;&lt;/p&gt;  &lt;p&gt;&lt;span style="font-size:85%;"&gt;When the overriden method (getArea) is invoked for an object of the Cylinder class, the new definition of the method is called and not the old definition from the superclass(Circle).&lt;/span&gt;&lt;/p&gt;  &lt;span style="font-size:85%;"&gt;&lt;b&gt; &lt;p&gt; &lt;/p&gt; &lt;p&gt;Example code&lt;/p&gt;&lt;/b&gt; &lt;/span&gt;&lt;p&gt;&lt;span style="font-size:85%;"&gt;This is the code to instantiate the above two classes&lt;/span&gt;&lt;/p&gt; &lt;p&gt;&lt;span style="font-size:85%;"&gt;Circle myCircle;&lt;br /&gt;myCircle = new Circle(1.20);&lt;br /&gt;Cylinder myCylinder;&lt;br /&gt;myCylinder = new Cylinder(1.20,2.50); &lt;/span&gt;&lt;/p&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7660917028131688558-2339366040940048155?l=jainmarket.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://jainmarket.blogspot.com/feeds/2339366040940048155/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7660917028131688558&amp;postID=2339366040940048155' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7660917028131688558/posts/default/2339366040940048155'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7660917028131688558/posts/default/2339366040940048155'/><link rel='alternate' type='text/html' href='http://jainmarket.blogspot.com/2009/03/overloading-and-overriding.html' title='Overloading And Overriding'/><author><name>Rahul Vyas</name><uri>http://www.blogger.com/profile/08326955903115378266</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://bp1.blogger.com/_6C_XpG63jYw/SAgrxtkt56I/AAAAAAAAACc/pr7-vuTQS5w/S220/P1170634+(Small).JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7660917028131688558.post-8692635002851504796</id><published>2009-03-18T19:56:00.000+05:30</published><updated>2009-03-18T19:58:09.654+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='c#'/><title type='text'>Overloading Vs Overriding</title><content type='html'>&lt;table width="100%" bg cellpadding="5" cellspacing="1" style="color:#ccff99;"&gt;&lt;tbody&gt;&lt;tr bg style="color:white;"&gt;&lt;td colspan="3"&gt;&lt;span style="font-family:Arial;color:BLACK;"&gt;overloading comes with in class         for example :&lt;br /&gt;&lt;br /&gt;            Operator Overloading and Method overloading.&lt;br /&gt;&lt;br /&gt;             void Add( int i );&lt;br /&gt;             void Add( char c );&lt;br /&gt;&lt;br /&gt;These two function declaration and definition in the same class is called method OVERLOADING.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;        overriding comes with two class ( base and drived class )&lt;br /&gt;&lt;br /&gt;              function in the base class  is like&lt;br /&gt;&lt;br /&gt;                  public virtual void Display();&lt;br /&gt;&lt;br /&gt;              function in the drived class is like&lt;br /&gt;&lt;br /&gt;                    public override void Display();&lt;br /&gt;&lt;br /&gt;            this function overrides the base class .&lt;br /&gt;&lt;br /&gt;I think you should know more on OOPs , Polimorphism , inheritance etc.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td class="authorBar"&gt;Author: &lt;a href="http://www.dotnetspider.com/member/kamlieshnadar.aspx"&gt;&lt;b&gt;Kamliesh Nadar&lt;/b&gt;&lt;/a&gt;    17 May 2005&lt;/td&gt;&lt;td class="authorBar"&gt;Member Level: &lt;b&gt;&lt;a href="http://www.dotnetspider.com/General/MembershipLevels.aspx" title="Total Points: 1590"&gt;Gold&lt;/a&gt;&lt;/b&gt;&lt;/td&gt;&lt;td class="authorBar" valign="middle"&gt;Rating: &lt;img src="http://www.dotnetspider.com/images/general/yellowstar.jpg" width="20" border="0" /&gt; &lt;img src="http://www.dotnetspider.com/images/general/yellowstar.jpg" width="20" border="0" /&gt;      &lt;a href="http://www.dotnetspider.com/general/ContentRating.aspx?EntityType=4&amp;amp;EntityId=18850"&gt;Points&lt;/a&gt;: 2&lt;/td&gt;&lt;/tr&gt;&lt;tr bg style="color:white;"&gt;&lt;td colspan="3"&gt;&lt;br /&gt;&lt;span style="font-family:Arial;color:BLACK;"&gt;Hi,&lt;br /&gt;&lt;br /&gt;Overriding - same method names with same arguments and same return types associated in a class and its subclass.&lt;br /&gt;&lt;br /&gt;Overloading - same method name with different arguments, may or may not be same return type written in the same class itself.&lt;br /&gt;&lt;br /&gt;Example for overriding&lt;br /&gt;Clas A&lt;br /&gt;{&lt;br /&gt;Virtual void hi(int a)&lt;br /&gt; {&lt;br /&gt; }&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;Class B:A&lt;br /&gt;{&lt;br /&gt; public   overrid void hi(int a)&lt;br /&gt;{&lt;br /&gt; &lt;br /&gt;}&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;Example for Over loading&lt;br /&gt;&lt;br /&gt;Class A&lt;br /&gt;{&lt;br /&gt;class a()&lt;br /&gt;&lt;br /&gt;{&lt;br /&gt;&lt;br /&gt;}&lt;br /&gt;class a(int a)&lt;br /&gt;{&lt;br /&gt;}&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;Regards,&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td class="authorBar"&gt;Author: &lt;a href="http://www.dotnetspider.com/member/M.Ravi%20Kishore.aspx"&gt;&lt;b&gt;M.Ravi Kishore&lt;/b&gt;&lt;/a&gt;    18 May 2005&lt;/td&gt;&lt;td class="authorBar"&gt;Member Level: &lt;b&gt;&lt;a href="http://www.dotnetspider.com/General/MembershipLevels.aspx" title="Total Points: 215"&gt;Silver&lt;/a&gt;&lt;/b&gt;&lt;/td&gt;&lt;td class="authorBar" valign="middle"&gt;Rating: &lt;img src="http://www.dotnetspider.com/images/general/yellowstar.jpg" width="20" border="0" /&gt; &lt;img src="http://www.dotnetspider.com/images/general/yellowstar.jpg" width="20" border="0" /&gt;      &lt;a href="http://www.dotnetspider.com/general/ContentRating.aspx?EntityType=4&amp;amp;EntityId=18882"&gt;Points&lt;/a&gt;: 2&lt;/td&gt;&lt;/tr&gt;&lt;tr bg style="color:white;"&gt;&lt;td colspan="3"&gt;&lt;br /&gt;&lt;span style="font-family:Arial;color:BLACK;"&gt;OverLoading  means one name many forms .its functionallty changes corresponding to the objects&lt;br /&gt;Overriding means its funcationality can be overrided.these can be done by using by using two keywords&lt;br /&gt;1.overrideable&lt;br /&gt;2.overrides&lt;br /&gt;overriding take place with in the in_heritance. it is not possiable  with in the class.&lt;br /&gt;have u got it if not contact me(ravikim2001@yahoo.co.in)&lt;br /&gt;ok bye.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td class="authorBar"&gt;Author: &lt;a href="http://www.dotnetspider.com/member/Maheshreddy245.aspx"&gt;&lt;b&gt;Maheswara Reddy&lt;/b&gt;&lt;/a&gt;    13 Jun 2007&lt;/td&gt;&lt;td class="authorBar"&gt;Member Level: &lt;b&gt;&lt;a href="http://www.dotnetspider.com/General/MembershipLevels.aspx" title="Total Points: 30"&gt;Bronze&lt;/a&gt;&lt;/b&gt;&lt;/td&gt;&lt;td class="authorBar" valign="middle"&gt;Rating: &lt;img src="http://www.dotnetspider.com/images/general/yellowstar.jpg" width="20" border="0" /&gt; &lt;img src="http://www.dotnetspider.com/images/general/yellowstar.jpg" width="20" border="0" /&gt;      &lt;a href="http://www.dotnetspider.com/general/ContentRating.aspx?EntityType=4&amp;amp;EntityId=129036"&gt;Points&lt;/a&gt;: 2&lt;/td&gt;&lt;/tr&gt;&lt;tr bg style="color:white;"&gt;&lt;td colspan="3"&gt;&lt;br /&gt;&lt;span style="font-family:Arial;color:BLACK;"&gt;To begin with, overloading has been used before in other languages such as C++. If you have any C++ experience with overloading operators, this will be a snap. If not, don't worry; once you see a couple examples you'll be able to figure out where things are headed.&lt;br /&gt;&lt;br /&gt;Method Overriding&lt;br /&gt;&lt;br /&gt;Overriding in C# makes use of the "override" keyword. To override a method means to replace it with a new way of handling data. Here's an example of what I mean:&lt;br /&gt;&lt;br /&gt;Say we have an object that contains data for a rectangle. Our object has accessors and a method for returning the area. This is our Rectangle object (refer to Accessors in C# for help understanding what this object does):&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;public class Rectangle&lt;br /&gt;{&lt;br /&gt;  public int Width&lt;br /&gt;  {&lt;br /&gt;     set { width = value; }&lt;br /&gt;     get { return width;  }&lt;br /&gt;  }&lt;br /&gt;&lt;br /&gt;  public int Height&lt;br /&gt;  {&lt;br /&gt;     set { height = value; }&lt;br /&gt;     get { return height;  }&lt;br /&gt;  }&lt;br /&gt;&lt;br /&gt;  public int Area&lt;br /&gt;  {&lt;br /&gt;     get { return (width * height); }&lt;br /&gt;  }&lt;br /&gt;&lt;br /&gt;  int width, height;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Now for the overriding… The easiest, and most common, use of overriding is with the ToSting() method. ToString is a built-in method that returns a string, generally referring to some aspect of the object, to the calling statement. Let's look at the following Main() method used to call Rectangle:&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;class TestRectangle&lt;br /&gt;{&lt;br /&gt;  public static void Main()&lt;br /&gt;  {&lt;br /&gt;     Rectangle myRect1 = new Rectangle();&lt;br /&gt;&lt;br /&gt;     myRect1.Width  = 3;&lt;br /&gt;     myRect1.Height = 5;&lt;br /&gt;&lt;br /&gt;     Console.WriteLine("The area of a {0}, width={1} and height={2} is: {3}.",&lt;br /&gt;        myRect, myRect.Width, myRect.Height, myRect.Area);&lt;br /&gt;  }&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;The exact output for this is:&lt;br /&gt;"The area of a Rectangle, width=3 and height=5 is: 15."&lt;br /&gt;&lt;br /&gt;The first thing you should be asking is how the word "Rectangle" gets in there? This is where ToString() comes in. As with JAVA, when you try to reference an object as a string, it automatically calls ToString(); it'd be like calling myRect.ToString(). When we call myRect with Console.WriteLine(), it outputs myRect as a string. An un-overridden object will return the type of object it is, "Rectangle" in this case. Perhaps instead to returning "Rectangle," though, we want it to return "cool rectangle." To do this we must override ToString() in our object. Adding the following method to the Rectangle class will do this:&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;public override string ToString()&lt;br /&gt;{&lt;br /&gt;  return "cool rectangle";&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;The only change between this method and any other method is the use of the override keyword. It's as simple as that. Now when the Main() method is run, the output will be:&lt;br /&gt;"The area of a cool rectangle, width=3 and height=5 is: 15."&lt;br /&gt;&lt;br /&gt;Overriding ToSting() is very useful if your class contains a list of information and you want to return it with some formatting already done. For example, you could create a string that formats a list of names for output similar to:&lt;br /&gt;&lt;br /&gt;Name 1: Kevin&lt;br /&gt;Name 2: Brittany&lt;br /&gt;Name 3: Joseph&lt;br /&gt;etc…&lt;br /&gt;&lt;br /&gt;Then when your object (i.e. myNameList) is referenced as a string, it’ll return your formatted list of names.&lt;br /&gt;&lt;br /&gt;Operator Overloading&lt;br /&gt;OK, so overriding methods can be fun, but what about other things? Well let’s say we want to add two rectangles. Now the common way would be to add their areas, but maybe we want to add the lengths and the widths and find the new area. We could write a method that'd find this special area; but, if this is the only way we plan on adding two rectangles, we can easily overload the '+' operator. Here are our two rectangles:&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;-- -- --         -- -- -- -- -- --&lt;br /&gt;|        |       |                 |&lt;br /&gt;|        |       |                 |&lt;br /&gt;|        |        -- -- -- -- -- --&lt;br /&gt;|        |&lt;br /&gt;-- -- --&lt;br /&gt;Width:   3        Width:   6&lt;br /&gt;Height:  4        Height:  2&lt;br /&gt;Area:   12        Area:   12&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Doing our new form of adding, the resulting rectangle should be:&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;-- -- -- -- -- -- -- -- --&lt;br /&gt;|        |                 |&lt;br /&gt;|        |_________________|&lt;br /&gt;|        |__|__|__|        |&lt;br /&gt;|________|__|__|__|        |&lt;br /&gt;|                 |        |&lt;br /&gt;|                 |        |&lt;br /&gt;-- -- -- -- -- -- -- -- --&lt;br /&gt;Width:   9&lt;br /&gt;Height:  6&lt;br /&gt;Area:   54&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;To begin, let's create the method header. We know we want to return a new rectangle with the new dimensions. To simplify things, we're going to take in the two small rectangles and return the composite rectangle. Our header will look as follows:&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;public static Rectangle operator + (Rectangle nRect1, Rectangle nRect2);&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;You should be able to figure out what each part is doing here. The return type is a Rectangle, the operator keyword tells that we're overloading an operator, and the operator is the + symbol; the method is also taking in our two small rectangles. Here's what the entire method might look like:&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;public static Rectangle operator + (Rectangle nRect1, Rectangle nRect2)&lt;br /&gt;{&lt;br /&gt;  Rectangle retRect = new Rectangle();&lt;br /&gt;&lt;br /&gt;  retRect.Width  = nRect1.Width  + nRect2.Width;&lt;br /&gt;  retRect.Height = nRect1.Height + nRect2.Height;&lt;br /&gt;&lt;br /&gt;  return retRect;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;I could have addressed width and height directly, but it is safer to use the accessors because I may have performed some special operation on the data with them (in this case I didn't so it wouldn't matter either way).&lt;br /&gt;&lt;br /&gt;Putting the new Rectangle class together along with a testing Main() method, we'd have:&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;using System;&lt;br /&gt;&lt;br /&gt;namespace Overloading&lt;br /&gt;{&lt;br /&gt;  class TestRectangle&lt;br /&gt;  {&lt;br /&gt;     public static void Main()&lt;br /&gt;     {&lt;br /&gt;        Rectangle myRect1 = new Rectangle();&lt;br /&gt;        Rectangle myRect2 = new Rectangle();&lt;br /&gt;        Rectangle myRect3 = new Rectangle();&lt;br /&gt;&lt;br /&gt;        myRect1.Width  = 3;&lt;br /&gt;        myRect1.Height = 4;&lt;br /&gt;&lt;br /&gt;        myRect2.Width  = 6;&lt;br /&gt;        myRect2.Height = 2;&lt;br /&gt;&lt;br /&gt;        myRect3 = myRect1 + myRect2;&lt;br /&gt;&lt;br /&gt;        Console.WriteLine("The area of a {0}, width={1} and height={2} is: {3}.",&lt;br /&gt;           myRect1, myRect1.Width, myRect1.Height, myRect1.Area);&lt;br /&gt;        Console.WriteLine("The area of another {0}, width={1} and height={2} is: {3}.",&lt;br /&gt;           myRect2, myRect2.Width, myRect2.Height, myRect2.Area);&lt;br /&gt;        Console.WriteLine("The result of the {0}s added is: width={1}, height={2}, area={3}.",&lt;br /&gt;           myRect3, myRect3.Width, myRect3.Height, myRect3.Area);&lt;br /&gt;        }&lt;br /&gt;     }&lt;br /&gt;&lt;br /&gt;     public class Rectangle&lt;br /&gt;     {&lt;br /&gt;        public int Width&lt;br /&gt;        {&lt;br /&gt;           set { width = value; }&lt;br /&gt;           get { return width;  }&lt;br /&gt;        }&lt;br /&gt;&lt;br /&gt;        public int Height&lt;br /&gt;        {&lt;br /&gt;           set { height = value; }&lt;br /&gt;           get { return height;  }&lt;br /&gt;        }&lt;br /&gt;&lt;br /&gt;        public int Area&lt;br /&gt;        {&lt;br /&gt;           get { return (width * height); }&lt;br /&gt;        }&lt;br /&gt;&lt;br /&gt;        public static Rectangle operator + (Rectangle nRect1, Rectangle nRect2)&lt;br /&gt;        {&lt;br /&gt;           Rectangle retRect = new Rectangle();&lt;br /&gt;&lt;br /&gt;           retRect.Width  = nRect1.Width  + nRect2.Width;&lt;br /&gt;           retRect.Height = nRect1.Height + nRect2.Height;&lt;br /&gt;&lt;br /&gt;           return retRect;&lt;br /&gt;        }&lt;br /&gt;&lt;br /&gt;        public override string ToString()&lt;br /&gt;        {&lt;br /&gt;           return "cool rectangle";&lt;br /&gt;        }&lt;br /&gt;&lt;br /&gt;     int width, height;&lt;br /&gt;  }&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;Virtual and Overridden Methods&lt;br /&gt;&lt;br /&gt;Only if a method is declared virtual, derived classes can override this method if they are explicitly declared to override the virtual base class method with the override keyword.&lt;br /&gt;&lt;br /&gt;   using System;&lt;br /&gt;   namespace Polymorphism&lt;br /&gt;   {&lt;br /&gt;       class A&lt;br /&gt;       {&lt;br /&gt;           public virtual void Foo() { Console.WriteLine("A::Foo()"); }&lt;br /&gt;       }&lt;br /&gt;&lt;br /&gt;       class B : A&lt;br /&gt;       {&lt;br /&gt;           public override void Foo() { Console.WriteLine("B::Foo()"); }&lt;br /&gt;       }&lt;br /&gt;&lt;br /&gt;       class Test&lt;br /&gt;       {&lt;br /&gt;           static void Main(string[] args)&lt;br /&gt;           {&lt;br /&gt;               A a;&lt;br /&gt;               B b;&lt;br /&gt;&lt;br /&gt;              
