<?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-4996441835700536347</id><updated>2012-02-21T05:23:59.557-08:00</updated><category term='resize'/><category term='fontsize'/><category term='debug'/><category term='nsstring'/><category term='mapkit'/><category term='protocol'/><category term='mapview'/><category term='gdb'/><category term='cluster'/><category term='geocoder'/><category term='property'/><category term='empty nsstring'/><category term='map'/><category term='textfield'/><category term='objective c'/><category term='non english charcter'/><category term='font'/><category term='uitextfield'/><category term='advance string operation'/><category term='gps'/><category term='string'/><category term='uimapview'/><category term='location'/><category term='autoresize'/><category term='iphone'/><category term='xcode'/><category term='iphone programming'/><category term='map view'/><category term='copy'/><category term='ios'/><category term='assign'/><category term='split nsstring'/><category term='comparison'/><category term='animation'/><category term='retain'/><category term='keyboard'/><category term='layout'/><category term='pin'/><category term='memory allocation'/><category term='uikeyboard'/><category term='UILabel'/><category term='string compare'/><category term='mapviewcontroller'/><category term='delegate'/><title type='text'>iPhone development</title><subtitle type='html'>iPhone development</subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://i-phone-dev.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4996441835700536347/posts/default?max-results=100'/><link rel='alternate' type='text/html' href='http://i-phone-dev.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>Anon</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>9</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>100</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-4996441835700536347.post-4304002299457314838</id><published>2012-01-18T03:43:00.000-08:00</published><updated>2012-01-18T03:44:50.744-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='uitextfield'/><category scheme='http://www.blogger.com/atom/ns#' term='keyboard'/><category scheme='http://www.blogger.com/atom/ns#' term='textfield'/><category scheme='http://www.blogger.com/atom/ns#' term='ios'/><category scheme='http://www.blogger.com/atom/ns#' term='uikeyboard'/><category scheme='http://www.blogger.com/atom/ns#' term='resize'/><category scheme='http://www.blogger.com/atom/ns#' term='iphone'/><title type='text'>Different way to show keyboard and resize UIView with text field</title><content type='html'>When the soft key board is shown and hidden, it broadcast two notifications. We have listen to the notification to perform anything when the keyboard appears and disappears. s&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;div style="font: 11.0px Menlo; margin: 0.0px 0.0px 0.0px 0.0px; min-height: 13.0px;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="font: 11.0px Menlo; margin: 0.0px 0.0px 0.0px 0.0px;"&gt;- (&lt;span style="color: #ba2da2;"&gt;void&lt;/span&gt;) viewWillAppear:(&lt;span style="color: #ba2da2;"&gt;BOOL&lt;/span&gt;)animated {&lt;/div&gt;&lt;div style="font: 11.0px Menlo; margin: 0.0px 0.0px 0.0px 0.0px;"&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;[&lt;span style="color: #ba2da2;"&gt;super&lt;/span&gt; &lt;span style="color: #3d1e81;"&gt;viewWillAppear&lt;/span&gt;:animated];&lt;/div&gt;&lt;div style="font: 11.0px Menlo; margin: 0.0px 0.0px 0.0px 0.0px; min-height: 13.0px;"&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;&lt;/div&gt;&lt;div style="color: #3d1e81; font: 11.0px Menlo; margin: 0.0px 0.0px 0.0px 0.0px;"&gt;&lt;span style="color: black;"&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;[[&lt;/span&gt;&lt;span style="color: #703daa;"&gt;NSNotificationCenter&lt;/span&gt;&lt;span style="color: black;"&gt; &lt;/span&gt;defaultCenter&lt;span style="color: black;"&gt;] &lt;/span&gt;addObserver&lt;span style="color: black;"&gt;:&lt;/span&gt;&lt;span style="color: #ba2da2;"&gt;self&lt;/span&gt;&lt;span style="color: black;"&gt; &lt;/span&gt;selector&lt;span style="color: black;"&gt;:&lt;/span&gt;&lt;span style="color: #ba2da2;"&gt;@selector&lt;/span&gt;&lt;span style="color: black;"&gt;(keyboardWillShow:)&amp;nbsp;&lt;/span&gt;&lt;/div&gt;&lt;div style="color: #703daa; font: 11.0px Menlo; margin: 0.0px 0.0px 0.0px 0.0px;"&gt;&lt;span style="color: black;"&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt;            &lt;/span&gt; &lt;/span&gt;&lt;span style="color: #3d1e81;"&gt;name&lt;/span&gt;&lt;span style="color: black;"&gt;:&lt;/span&gt;UIKeyboardWillShowNotification&lt;span style="color: black;"&gt; &lt;/span&gt;&lt;span style="color: #3d1e81;"&gt;object&lt;/span&gt;&lt;span style="color: black;"&gt;:&lt;/span&gt;&lt;span style="color: #ba2da2;"&gt;nil&lt;/span&gt;&lt;span style="color: black;"&gt;];&lt;/span&gt;&lt;/div&gt;&lt;div style="color: #3d1e81; font: 11.0px Menlo; margin: 0.0px 0.0px 0.0px 0.0px;"&gt;&lt;span style="color: black;"&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;[[&lt;/span&gt;&lt;span style="color: #703daa;"&gt;NSNotificationCenter&lt;/span&gt;&lt;span style="color: black;"&gt; &lt;/span&gt;defaultCenter&lt;span style="color: black;"&gt;] &lt;/span&gt;addObserver&lt;span style="color: black;"&gt;:&lt;/span&gt;&lt;span style="color: #ba2da2;"&gt;self&lt;/span&gt;&lt;span style="color: black;"&gt; &lt;/span&gt;selector&lt;span style="color: black;"&gt;:&lt;/span&gt;&lt;span style="color: #ba2da2;"&gt;@selector&lt;/span&gt;&lt;span style="color: black;"&gt;(keyboardWillHide:)&amp;nbsp;&lt;/span&gt;&lt;/div&gt;&lt;div style="color: #703daa; font: 11.0px Menlo; margin: 0.0px 0.0px 0.0px 0.0px;"&gt;&lt;span style="color: black;"&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt;            &lt;/span&gt; &lt;/span&gt;&lt;span style="color: #3d1e81;"&gt;name&lt;/span&gt;&lt;span style="color: black;"&gt;:&lt;/span&gt;UIKeyboardWillHideNotification&lt;span style="color: black;"&gt; &lt;/span&gt;&lt;span style="color: #3d1e81;"&gt;object&lt;/span&gt;&lt;span style="color: black;"&gt;:&lt;/span&gt;&lt;span style="color: #ba2da2;"&gt;nil&lt;/span&gt;&lt;span style="color: black;"&gt;];&lt;/span&gt;&lt;/div&gt;&lt;div style="font: 11.0px Menlo; margin: 0.0px 0.0px 0.0px 0.0px;"&gt;}&lt;/div&gt;&lt;div style="font: 11.0px Menlo; margin: 0.0px 0.0px 0.0px 0.0px; min-height: 13.0px;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="font: 11.0px Menlo; margin: 0.0px 0.0px 0.0px 0.0px;"&gt;- (&lt;span style="color: #ba2da2;"&gt;void&lt;/span&gt;)viewWillDisappear:(&lt;span style="color: #ba2da2;"&gt;BOOL&lt;/span&gt;)animated {&lt;/div&gt;&lt;div style="color: #3d1e81; font: 11.0px Menlo; margin: 0.0px 0.0px 0.0px 0.0px;"&gt;&lt;span style="color: black;"&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;[&lt;/span&gt;&lt;span style="color: #ba2da2;"&gt;self&lt;/span&gt;&lt;span style="color: black;"&gt;.&lt;/span&gt;&lt;span style="color: #703daa;"&gt;view&lt;/span&gt;&lt;span style="color: black;"&gt; &lt;/span&gt;endEditing&lt;span style="color: black;"&gt;:&lt;/span&gt;&lt;span style="color: #ba2da2;"&gt;YES&lt;/span&gt;&lt;span style="color: black;"&gt;];&lt;/span&gt;&lt;/div&gt;&lt;div style="color: #3d1e81; font: 11.0px Menlo; margin: 0.0px 0.0px 0.0px 0.0px;"&gt;&lt;span style="color: black;"&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;[&lt;/span&gt;&lt;span style="color: #ba2da2;"&gt;super&lt;/span&gt;&lt;span style="color: black;"&gt; &lt;/span&gt;viewWillDisappear&lt;span style="color: black;"&gt;:animated];&lt;/span&gt;&lt;/div&gt;&lt;div style="color: #3d1e81; font: 11.0px Menlo; margin: 0.0px 0.0px 0.0px 0.0px;"&gt;&lt;span style="color: black;"&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;[[&lt;/span&gt;&lt;span style="color: #703daa;"&gt;NSNotificationCenter&lt;/span&gt;&lt;span style="color: black;"&gt; &lt;/span&gt;defaultCenter&lt;span style="color: black;"&gt;] &lt;/span&gt;removeObserver&lt;span style="color: black;"&gt;:&lt;/span&gt;&lt;span style="color: #ba2da2;"&gt;self&lt;/span&gt;&lt;span style="color: black;"&gt;&amp;nbsp;&lt;/span&gt;&lt;/div&gt;&lt;div style="color: #703daa; font: 11.0px Menlo; margin: 0.0px 0.0px 0.0px 0.0px;"&gt;&lt;span style="color: black;"&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt;             &lt;/span&gt;&lt;/span&gt;&lt;span style="color: #3d1e81;"&gt;name&lt;/span&gt;&lt;span style="color: black;"&gt;:&lt;/span&gt;UIKeyboardWillShowNotification&lt;span style="color: black;"&gt; &lt;/span&gt;&lt;span style="color: #3d1e81;"&gt;object&lt;/span&gt;&lt;span style="color: black;"&gt;:&lt;/span&gt;&lt;span style="color: #ba2da2;"&gt;nil&lt;/span&gt;&lt;span style="color: black;"&gt;];&lt;/span&gt;&lt;/div&gt;&lt;div style="color: #3d1e81; font: 11.0px Menlo; margin: 0.0px 0.0px 0.0px 0.0px;"&gt;&lt;span style="color: black;"&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;[[&lt;/span&gt;&lt;span style="color: #703daa;"&gt;NSNotificationCenter&lt;/span&gt;&lt;span style="color: black;"&gt; &lt;/span&gt;defaultCenter&lt;span style="color: black;"&gt;] &lt;/span&gt;removeObserver&lt;span style="color: black;"&gt;:&lt;/span&gt;&lt;span style="color: #ba2da2;"&gt;self&lt;/span&gt;&lt;span style="color: black;"&gt;&amp;nbsp;&lt;/span&gt;&lt;/div&gt;&lt;div style="color: #703daa; font: 11.0px Menlo; margin: 0.0px 0.0px 0.0px 0.0px;"&gt;&lt;span style="color: black;"&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt;             &lt;/span&gt;&lt;/span&gt;&lt;span style="color: #3d1e81;"&gt;name&lt;/span&gt;&lt;span style="color: black;"&gt;:&lt;/span&gt;UIKeyboardWillHideNotification&lt;span style="color: black;"&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt; &lt;/span&gt;&lt;span style="color: #3d1e81;"&gt;object&lt;/span&gt;&lt;span style="color: black;"&gt;:&lt;/span&gt;&lt;span style="color: #ba2da2;"&gt;nil&lt;/span&gt;&lt;span style="color: black;"&gt;];&lt;/span&gt;&lt;/div&gt;&lt;div style="font: 11.0px Menlo; margin: 0.0px 0.0px 0.0px 0.0px;"&gt;}&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;From UIWindow class reference,&amp;nbsp;&lt;/div&gt;&lt;div&gt;&lt;h3 class="constantGroup" style="color: black; font-family: 'Lucida Grande', Geneva, Helvetica, Arial, sans-serif; font-size: 19px; font-weight: normal; margin-bottom: 0.25em; margin-top: 1.5em;"&gt;Keyboard Notification User Info Keys&lt;/h3&gt;&lt;div class="abstract" style="font-family: 'Lucida Grande', Geneva, Helvetica, Arial, sans-serif; font-size: 13px; font: normal normal normal 100%/normal 'Lucida Grande', Geneva, Helvetica, Arial, sans-serif; margin-bottom: 0.833em; margin-top: 1.083em;"&gt;Keys used to get values from the user information dictionary of keyboard notifications.&lt;/div&gt;&lt;span class="Apple-style-span" style="font-family: 'Lucida Grande', Geneva, Helvetica, Arial, sans-serif; font-size: 13px;"&gt;&lt;/span&gt;&lt;br /&gt;&lt;pre class="declaration" style="color: #666666; font-family: Courier, Consolas, monospace; font-size: 13px; margin-bottom: 1em; margin-left: 0.5em; margin-right: 0.333em; margin-top: 0px; white-space: pre;"&gt;&lt;span class="Apple-style-span" style="font-family: 'Lucida Grande', Geneva, Helvetica, Arial, sans-serif; font-size: 13px;"&gt;&lt;code style="color: #666666; font-family: Courier, Consolas, monospace; font-size: 14px;"&gt;NSString *const UIKeyboardFrameBeginUserInfoKey;&lt;/code&gt;&lt;br /&gt;&lt;code style="color: #666666; font-family: Courier, Consolas, monospace; font-size: 14px;"&gt;NSString *const UIKeyboardFrameEndUserInfoKey;&lt;/code&gt;&lt;br /&gt;&lt;code style="color: #666666; font-family: Courier, Consolas, monospace; font-size: 14px;"&gt;NSString *const UIKeyboardAnimationDurationUserInfoKey;&lt;/code&gt;&lt;br /&gt;&lt;code style="color: #666666; font-family: Courier, Consolas, monospace; font-size: 14px;"&gt;NSString *const UIKeyboardAnimationCurveUserInfoKey;&lt;/code&gt;&lt;br /&gt;&lt;code style="color: #666666; font-family: Courier, Consolas, monospace; font-size: 14px;"&gt; &lt;/code&gt;&lt;br /&gt;&lt;code style="color: #666666; font-family: Courier, Consolas, monospace; font-size: 14px;"&gt;// Deprecated in iOS 3.2 and later.&lt;/code&gt;&lt;br /&gt;&lt;code style="color: #666666; font-family: Courier, Consolas, monospace; font-size: 14px;"&gt;NSString *const UIKeyboardCenterBeginUserInfoKey;&lt;/code&gt;&lt;br /&gt;&lt;code style="color: #666666; font-family: Courier, Consolas, monospace; font-size: 14px;"&gt;NSString *const UIKeyboardCenterEndUserInfoKey;&lt;/code&gt;&lt;br /&gt;&lt;code style="color: #666666; font-family: Courier, Consolas, monospace; font-size: 14px;"&gt;NSString *const UIKeyboardBoundsUserInfoKey;&lt;/code&gt;&lt;/span&gt;&lt;/pre&gt;&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;The notification we receive is,&lt;br /&gt;&lt;br /&gt;&lt;div style="font: 11.0px Menlo; margin: 0.0px 0.0px 0.0px 0.0px;"&gt;&lt;b&gt;NSConcreteNotification 0xf5b09c0 {name = UIKeyboardWillHideNotification; userInfo = {&lt;/b&gt;&lt;/div&gt;&lt;div style="font: 11.0px Menlo; margin: 0.0px 0.0px 0.0px 0.0px;"&gt;&lt;b&gt;&amp;nbsp; &amp;nbsp; UIKeyboardAnimationCurveUserInfoKey = 0;&lt;/b&gt;&lt;/div&gt;&lt;div style="font: 11.0px Menlo; margin: 0.0px 0.0px 0.0px 0.0px;"&gt;&lt;b&gt;&amp;nbsp; &amp;nbsp; UIKeyboardAnimationDurationUserInfoKey = "0.25";&lt;/b&gt;&lt;/div&gt;&lt;div style="font: 11.0px Menlo; margin: 0.0px 0.0px 0.0px 0.0px;"&gt;&lt;b&gt;&amp;nbsp; &amp;nbsp; UIKeyboardBoundsUserInfoKey = "NSRect: {{0, 0}, {320, 216}}";&lt;/b&gt;&lt;/div&gt;&lt;div style="font: 11.0px Menlo; margin: 0.0px 0.0px 0.0px 0.0px;"&gt;&lt;b&gt;&amp;nbsp; &amp;nbsp; UIKeyboardCenterBeginUserInfoKey = "NSPoint: {160, 372}";&lt;/b&gt;&lt;/div&gt;&lt;div style="font: 11.0px Menlo; margin: 0.0px 0.0px 0.0px 0.0px;"&gt;&lt;b&gt;&amp;nbsp; &amp;nbsp; UIKeyboardCenterEndUserInfoKey = "NSPoint: {160, 588}";&lt;/b&gt;&lt;/div&gt;&lt;div style="font: 11.0px Menlo; margin: 0.0px 0.0px 0.0px 0.0px;"&gt;&lt;b&gt;&amp;nbsp; &amp;nbsp; UIKeyboardFrameBeginUserInfoKey = "NSRect: {{0, 264}, {320, 216}}";&lt;/b&gt;&lt;/div&gt;&lt;div style="font: 11.0px Menlo; margin: 0.0px 0.0px 0.0px 0.0px;"&gt;&lt;b&gt;&amp;nbsp; &amp;nbsp; UIKeyboardFrameChangedByUserInteraction = 0;&lt;/b&gt;&lt;/div&gt;&lt;div style="font: 11.0px Menlo; margin: 0.0px 0.0px 0.0px 0.0px;"&gt;&lt;b&gt;&amp;nbsp; &amp;nbsp; UIKeyboardFrameEndUserInfoKey = "NSRect: {{0, 480}, {320, 216}}";&lt;/b&gt;&lt;/div&gt;&lt;div style="font: 11.0px Menlo; margin: 0.0px 0.0px 0.0px 0.0px;"&gt;&lt;b&gt;}}&lt;/b&gt;&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-size: large;"&gt;&lt;u&gt;Technique 1- Direct and simple calculation&lt;/u&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;div style="font: 11.0px Menlo; margin: 0.0px 0.0px 0.0px 0.0px;"&gt;-(&lt;span style="color: #ba2da2;"&gt;void&lt;/span&gt;) keyboardWillShow:(&lt;span style="color: #703daa;"&gt;NSNotification&lt;/span&gt; *)aNotification&lt;/div&gt;&lt;div style="font: 11.0px Menlo; margin: 0.0px 0.0px 0.0px 0.0px;"&gt;{&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: Menlo; font-size: 11px;"&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span class="Apple-style-span" style="font-family: Menlo; font-size: 11px;"&gt;&lt;span style="color: #703daa;"&gt;NSDictionary&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="font-family: Menlo; font-size: 11px;"&gt;* info = [aNotification &lt;/span&gt;&lt;span class="Apple-style-span" style="font-family: Menlo; font-size: 11px;"&gt;&lt;span style="color: #3d1e81;"&gt;userInfo&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="font-family: Menlo; font-size: 11px;"&gt;];&lt;/span&gt;&lt;span class="Apple-style-span" style="font-family: Menlo; font-size: 11px;"&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;&lt;div style="color: #008400; font: 11.0px Menlo; margin: 0.0px 0.0px 0.0px 0.0px;"&gt;&lt;span style="color: black;"&gt;&amp;nbsp; &amp;nbsp; &lt;/span&gt;// Get the frame of the keyboard.&lt;/div&gt;&lt;div style="color: #703daa; font: 11.0px Menlo; margin: 0.0px 0.0px 0.0px 0.0px;"&gt;&lt;span style="color: black;"&gt;&amp;nbsp; &amp;nbsp; &lt;/span&gt;NSValue&lt;span style="color: black;"&gt; *centerValue = [info &lt;/span&gt;&lt;span style="color: #3d1e81;"&gt;objectForKey&lt;/span&gt;&lt;span style="color: black;"&gt;:&lt;/span&gt;UIKeyboardCenterEndUserInfoKey&lt;span style="color: black;"&gt;];&lt;/span&gt;&lt;/div&gt;&lt;div style="color: #703daa; font: 11.0px Menlo; margin: 0.0px 0.0px 0.0px 0.0px;"&gt;&lt;span style="color: black;"&gt;&amp;nbsp; &amp;nbsp; &lt;/span&gt;NSValue&lt;span style="color: black;"&gt; *boundsValue = [info &lt;/span&gt;&lt;span style="color: #3d1e81;"&gt;objectForKey&lt;/span&gt;&lt;span style="color: black;"&gt;:&lt;/span&gt;UIKeyboardBoundsUserInfoKey&lt;span style="color: black;"&gt;];&lt;/span&gt;&lt;/div&gt;&lt;div style="font: 11.0px Menlo; margin: 0.0px 0.0px 0.0px 0.0px;"&gt;&amp;nbsp; &amp;nbsp; &lt;span style="color: #703daa;"&gt;CGPoint&lt;/span&gt; keyboardCenter = [centerValue &lt;span style="color: #3d1e81;"&gt;CGPointValue&lt;/span&gt;];&lt;/div&gt;&lt;div style="font: 11.0px Menlo; margin: 0.0px 0.0px 0.0px 0.0px;"&gt;&amp;nbsp; &amp;nbsp; &lt;span style="color: #703daa;"&gt;CGRect&lt;/span&gt; keyboardBounds = [boundsValue &lt;span style="color: #3d1e81;"&gt;CGRectValue&lt;/span&gt;];&lt;/div&gt;&lt;div style="font: 11.0px Menlo; margin: 0.0px 0.0px 0.0px 0.0px;"&gt;&amp;nbsp; &amp;nbsp; &lt;span style="color: #703daa;"&gt;CGPoint&lt;/span&gt; keyboardOrigin = &lt;span style="color: #3d1e81;"&gt;CGPointMake&lt;/span&gt;(keyboardCenter.&lt;span style="color: #703daa;"&gt;x&lt;/span&gt; - keyboardBounds.&lt;span style="color: #703daa;"&gt;size&lt;/span&gt;.&lt;span style="color: #703daa;"&gt;width&lt;/span&gt; / &lt;span style="color: #252bd8;"&gt;2.0&lt;/span&gt;,&lt;/div&gt;&lt;div style="font: 11.0px Menlo; margin: 0.0px 0.0px 0.0px 0.0px;"&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; keyboardCenter.&lt;span style="color: #703daa;"&gt;y&lt;/span&gt; - keyboardBounds.&lt;span style="color: #703daa;"&gt;size&lt;/span&gt;.&lt;span style="color: #703daa;"&gt;height&lt;/span&gt; / &lt;span style="color: #252bd8;"&gt;2.0&lt;/span&gt;);&lt;/div&gt;&lt;div style="font: 11.0px Menlo; margin: 0.0px 0.0px 0.0px 0.0px;"&gt;&amp;nbsp; &amp;nbsp; &lt;span style="color: #703daa;"&gt;CGRect&lt;/span&gt; keyboardScreenFrame = { keyboardOrigin, keyboardBounds.&lt;span style="color: #703daa;"&gt;size&lt;/span&gt; };&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;&lt;/div&gt;&lt;div style="color: #008400; font: 11.0px Menlo; margin: 0.0px 0.0px 0.0px 0.0px;"&gt;&lt;span style="color: black;"&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;&lt;/span&gt;// some calculation...&lt;/div&gt;&lt;div style="font: 11.0px Menlo; margin: 0.0px 0.0px 0.0px 0.0px;"&gt;&amp;nbsp; &amp;nbsp; &lt;span style="color: #703daa;"&gt;CGRect&lt;/span&gt; viewFrame = &lt;span style="color: #ba2da2;"&gt;self&lt;/span&gt;.&lt;span style="color: #703daa;"&gt;view&lt;/span&gt;.&lt;span style="color: #703daa;"&gt;frame&lt;/span&gt;;&lt;/div&gt;&lt;div style="font: 11.0px Menlo; margin: 0.0px 0.0px 0.0px 0.0px;"&gt;&amp;nbsp; &amp;nbsp; &lt;span style="color: #703daa;"&gt;CGRect&lt;/span&gt; keyboardFrame = [&lt;span style="color: #ba2da2;"&gt;self&lt;/span&gt;.&lt;span style="color: #703daa;"&gt;view&lt;/span&gt;.&lt;span style="color: #703daa;"&gt;superview&lt;/span&gt; &lt;span style="color: #3d1e81;"&gt;convertRect&lt;/span&gt;:keyboardScreenFrame &lt;span style="color: #3d1e81;"&gt;fromView&lt;/span&gt;:&lt;span style="color: #ba2da2;"&gt;nil&lt;/span&gt;];&lt;/div&gt;&lt;div style="font: 11.0px Menlo; margin: 0.0px 0.0px 0.0px 0.0px;"&gt;&amp;nbsp; &amp;nbsp; &lt;span style="color: #703daa;"&gt;CGRect&lt;/span&gt; hiddenRect = &lt;span style="color: #3d1e81;"&gt;CGRectIntersection&lt;/span&gt;(viewFrame, keyboardFrame);&lt;/div&gt;&lt;div style="font: 11.0px Menlo; margin: 0.0px 0.0px 0.0px 0.0px;"&gt;&amp;nbsp; &amp;nbsp; &lt;span style="color: #703daa;"&gt;CGRect&lt;/span&gt; remainder, slice;&lt;/div&gt;&lt;div style="font: 11.0px Menlo; margin: 0.0px 0.0px 0.0px 0.0px;"&gt;&amp;nbsp; &amp;nbsp; &lt;span style="color: #3d1e81;"&gt;CGRectDivide&lt;/span&gt;(viewFrame, &amp;amp;slice, &amp;amp;remainder, &lt;span style="color: #3d1e81;"&gt;CGRectGetHeight&lt;/span&gt;(hiddenRect), &lt;span style="color: #3d1e81;"&gt;CGRectMaxYEdge&lt;/span&gt;);&lt;/div&gt;&lt;div style="font: 11.0px Menlo; margin: 0.0px 0.0px 0.0px 0.0px;"&gt;&amp;nbsp; &amp;nbsp; &lt;span style="color: #ba2da2;"&gt;self&lt;/span&gt;.&lt;span style="color: #703daa;"&gt;view&lt;/span&gt;.&lt;span style="color: #703daa;"&gt;frame&lt;/span&gt; = remainder;&amp;nbsp;&lt;/div&gt;&lt;div&gt;}&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;div style="font: 11.0px Menlo; margin: 0.0px 0.0px 0.0px 0.0px;"&gt;-(&lt;span style="color: #ba2da2;"&gt;void&lt;/span&gt;) keyboardWillHide:(&lt;span style="color: #703daa;"&gt;NSNotification&lt;/span&gt; *)aNotification&lt;/div&gt;&lt;div style="font: 11.0px Menlo; margin: 0.0px 0.0px 0.0px 0.0px;"&gt;{&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: Menlo; font-size: 11px;"&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span class="Apple-style-span" style="font-family: Menlo; font-size: 11px;"&gt;&lt;span style="color: #703daa;"&gt;CGRect&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="font-family: Menlo; font-size: 11px;"&gt; keyboardBounds;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;div style="font: 11.0px Menlo; margin: 0.0px 0.0px 0.0px 0.0px;"&gt;&amp;nbsp; &amp;nbsp; [[aNotification.&lt;span style="color: #703daa;"&gt;userInfo&lt;/span&gt; &lt;span style="color: #3d1e81;"&gt;valueForKey&lt;/span&gt;:&lt;span style="color: #703daa;"&gt;UIKeyboardBoundsUserInfoKey&lt;/span&gt;] &lt;span style="color: #3d1e81;"&gt;getValue&lt;/span&gt;: &amp;amp;keyboardBounds];&lt;/div&gt;&lt;div style="font: 11.0px Menlo; margin: 0.0px 0.0px 0.0px 0.0px;"&gt;&amp;nbsp; &amp;nbsp; &lt;span style="color: #ba2da2;"&gt;float&lt;/span&gt; keyboardHeight = keyboardBounds.&lt;span style="color: #703daa;"&gt;size&lt;/span&gt;.&lt;span style="color: #703daa;"&gt;height&lt;/span&gt;;&lt;/div&gt;&lt;div style="color: #703daa; font: 11.0px Menlo; margin: 0.0px 0.0px 0.0px 0.0px;"&gt;&lt;span style="color: black;"&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;&lt;/span&gt;CGRect&lt;span style="color: black;"&gt; frame = &lt;/span&gt;&lt;span style="color: #ba2da2;"&gt;self&lt;/span&gt;&lt;span style="color: black;"&gt;.&lt;/span&gt;view&lt;span style="color: black;"&gt;.&lt;/span&gt;frame&lt;span style="color: black;"&gt;;&lt;/span&gt;&lt;/div&gt;&lt;div style="font: 11.0px Menlo; margin: 0.0px 0.0px 0.0px 0.0px;"&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;frame.&lt;span style="color: #703daa;"&gt;size&lt;/span&gt;.&lt;span style="color: #703daa;"&gt;height&lt;/span&gt; += keyboardHeight;&lt;/div&gt;&lt;div style="font: 11.0px Menlo; margin: 0.0px 0.0px 0.0px 0.0px; min-height: 13.0px;"&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;&lt;/div&gt;&lt;div style="color: #3d1e81; font: 11.0px Menlo; margin: 0.0px 0.0px 0.0px 0.0px;"&gt;&lt;span style="color: black;"&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;[&lt;/span&gt;&lt;span style="color: #703daa;"&gt;UIView&lt;/span&gt;&lt;span style="color: black;"&gt; &lt;/span&gt;beginAnimations&lt;span style="color: black;"&gt;:&lt;/span&gt;&lt;span style="color: #ba2da2;"&gt;nil&lt;/span&gt;&lt;span style="color: black;"&gt; &lt;/span&gt;context&lt;span style="color: black;"&gt;:&lt;/span&gt;&lt;span style="color: #ba2da2;"&gt;NULL&lt;/span&gt;&lt;span style="color: black;"&gt;];&lt;/span&gt;&lt;/div&gt;&lt;div style="color: #3d1e81; font: 11.0px Menlo; margin: 0.0px 0.0px 0.0px 0.0px;"&gt;&lt;span style="color: black;"&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;[&lt;/span&gt;&lt;span style="color: #703daa;"&gt;UIView&lt;/span&gt;&lt;span style="color: black;"&gt; &lt;/span&gt;setAnimationBeginsFromCurrentState&lt;span style="color: black;"&gt;:&lt;/span&gt;&lt;span style="color: #ba2da2;"&gt;YES&lt;/span&gt;&lt;span style="color: black;"&gt;];&lt;/span&gt;&lt;/div&gt;&lt;div style="color: #3d1e81; font: 11.0px Menlo; margin: 0.0px 0.0px 0.0px 0.0px;"&gt;&lt;span style="color: black;"&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;[&lt;/span&gt;&lt;span style="color: #703daa;"&gt;UIView&lt;/span&gt;&lt;span style="color: black;"&gt; &lt;/span&gt;setAnimationDuration&lt;span style="color: black;"&gt;:&lt;/span&gt;&lt;span style="color: #252bd8;"&gt;0.3f&lt;/span&gt;&lt;span style="color: black;"&gt;];&lt;/span&gt;&lt;/div&gt;&lt;div style="font: 11.0px Menlo; margin: 0.0px 0.0px 0.0px 0.0px;"&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;&lt;span style="color: #ba2da2;"&gt;self&lt;/span&gt;.&lt;span style="color: #703daa;"&gt;view&lt;/span&gt;.&lt;span style="color: #703daa;"&gt;frame&lt;/span&gt; = frame;&lt;/div&gt;&lt;div style="color: #3d1e81; font: 11.0px Menlo; margin: 0.0px 0.0px 0.0px 0.0px;"&gt;&lt;span style="color: black;"&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;[&lt;/span&gt;&lt;span style="color: #703daa;"&gt;UIView&lt;/span&gt;&lt;span style="color: black;"&gt; &lt;/span&gt;commitAnimations&lt;span style="color: black;"&gt;];&lt;/span&gt;&lt;/div&gt;&lt;div style="color: #3d1e81; font: 11.0px Menlo; margin: 0.0px 0.0px 0.0px 0.0px;"&gt;&lt;span style="color: black;"&gt;}&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;"&gt;&lt;span class="Apple-style-span" style="font-size: large;"&gt;&lt;u&gt;Technique 2&lt;/u&gt;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;u&gt;Consider tabBar and keyboard for multiple languages&lt;/u&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;br /&gt;Define a variable &amp;nbsp;&lt;span class="Apple-style-span" style="color: #4f8187; font-family: Menlo; font-size: 11px;"&gt;viewIsResized&lt;/span&gt;&amp;nbsp;to remember that you have already resized the view. Otherwise if you choose/change language in the keyboard, pressing the globe button, this again call keyboardWillShow and change the view size (I did not tested it though).&amp;nbsp;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;When you resize the keyboard, if the view has a tabBar, the keyboard will hide the tabbar. So consider its height too, when resizing the view.&amp;nbsp;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;div style="color: black; font: normal normal normal 11px/normal Menlo; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;"&gt;-(&lt;span style="color: #ba2da2;"&gt;void&lt;/span&gt;) keyboardWillShow:(&lt;span style="color: #703daa;"&gt;NSNotification&lt;/span&gt; *)aNotification&lt;/div&gt;&lt;div style="color: black; font: normal normal normal 11px/normal Menlo; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;"&gt;{&lt;/div&gt;&lt;div style="color: black; font: normal normal normal 11px/normal Menlo; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;"&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;&lt;span style="color: #703daa;"&gt;NSDictionary&lt;/span&gt; * userInfo = aNotification.&lt;span style="color: #703daa;"&gt;userInfo&lt;/span&gt;;&lt;/div&gt;&lt;div style="color: black; font: normal normal normal 11px/normal Menlo; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;"&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;&lt;span style="color: #703daa;"&gt;NSTimeInterval&lt;/span&gt; animationDuration;&lt;/div&gt;&lt;div style="color: #703daa; font: normal normal normal 11px/normal Menlo; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;"&gt;&lt;span style="color: black;"&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;&lt;/span&gt;UIViewAnimationCurve&lt;span style="color: black;"&gt; animationCurve;&lt;/span&gt;&lt;/div&gt;&lt;div style="color: black; font: normal normal normal 11px/normal Menlo; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;"&gt;&amp;nbsp; &amp;nbsp; &lt;span style="color: #703daa;"&gt;CGRect&lt;/span&gt; keyboardFrame;&lt;/div&gt;&lt;div style="color: #703daa; font: normal normal normal 11px/normal Menlo; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;"&gt;&lt;span style="color: black;"&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;[[userInfo &lt;/span&gt;&lt;span style="color: #3d1e81;"&gt;valueForKey&lt;/span&gt;&lt;span style="color: black;"&gt;:&lt;/span&gt;UIKeyboardAnimationCurveUserInfoKey&lt;span style="color: black;"&gt;] &lt;/span&gt;&lt;span style="color: #3d1e81;"&gt;getValue&lt;/span&gt;&lt;span style="color: black;"&gt;:&amp;amp;animationCurve];&lt;/span&gt;&lt;/div&gt;&lt;div style="color: #703daa; font: normal normal normal 11px/normal Menlo; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;"&gt;&lt;span style="color: black;"&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;[[userInfo &lt;/span&gt;&lt;span style="color: #3d1e81;"&gt;valueForKey&lt;/span&gt;&lt;span style="color: black;"&gt;:&lt;/span&gt;UIKeyboardAnimationDurationUserInfoKey&lt;span style="color: black;"&gt;] &lt;/span&gt;&lt;span style="color: #3d1e81;"&gt;getValue&lt;/span&gt;&lt;span style="color: black;"&gt;:&amp;amp;animationDuration];&lt;/span&gt;&lt;/div&gt;&lt;div style="color: black; font: normal normal normal 11px/normal Menlo; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;"&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;[[userInfo &lt;span style="color: #3d1e81;"&gt;valueForKey&lt;/span&gt;:&lt;span style="color: #703daa;"&gt;UIKeyboardFrameEndUserInfoKey&lt;/span&gt;] &lt;span style="color: #3d1e81;"&gt;getValue&lt;/span&gt;:&amp;amp;keyboardFrame];&lt;/div&gt;&lt;div style="color: #3d1e81; font: normal normal normal 11px/normal Menlo; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;"&gt;&lt;span style="color: black;"&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;&lt;/span&gt;CFShow&lt;span style="color: black;"&gt;(&lt;/span&gt;&lt;span style="color: #ba2da2;"&gt;self&lt;/span&gt;&lt;span style="color: black;"&gt;.&lt;/span&gt;&lt;span style="color: #703daa;"&gt;view&lt;/span&gt;&lt;span style="color: black;"&gt;);&lt;/span&gt;&lt;/div&gt;&lt;div style="color: #4f8187; font: normal normal normal 11px/normal Menlo; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;"&gt;&lt;span style="color: black;"&gt;&amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style="color: #ba2da2;"&gt;if&lt;/span&gt;&lt;span style="color: black;"&gt; (!&lt;/span&gt;viewIsResized&lt;span style="color: black;"&gt;) {&lt;/span&gt;&lt;/div&gt;&lt;div style="color: black; font: normal normal normal 11px/normal Menlo; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;"&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt;  &lt;/span&gt;&lt;span style="color: #703daa;"&gt;CGRect&lt;/span&gt; frame = &lt;span style="color: #ba2da2;"&gt;self&lt;/span&gt;.&lt;span style="color: #703daa;"&gt;view&lt;/span&gt;.&lt;span style="color: #703daa;"&gt;frame&lt;/span&gt;;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt;  &lt;/span&gt;&lt;/div&gt;&lt;div style="color: #3d1e81; font: normal normal normal 11px/normal Menlo; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;"&gt;&lt;span style="color: black;"&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt;  &lt;/span&gt;[&lt;/span&gt;&lt;span style="color: #703daa;"&gt;UIView&lt;/span&gt;&lt;span style="color: black;"&gt; &lt;/span&gt;beginAnimations&lt;span style="color: black;"&gt;:&lt;/span&gt;&lt;span style="color: #ba2da2;"&gt;nil&lt;/span&gt;&lt;span style="color: black;"&gt; &lt;/span&gt;context&lt;span style="color: black;"&gt;:&lt;/span&gt;&lt;span style="color: #ba2da2;"&gt;nil&lt;/span&gt;&lt;span style="color: black;"&gt;];&lt;/span&gt;&lt;/div&gt;&lt;div style="color: #3d1e81; font: normal normal normal 11px/normal Menlo; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;"&gt;&lt;span style="color: black;"&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt;  &lt;/span&gt;[&lt;/span&gt;&lt;span style="color: #703daa;"&gt;UIView&lt;/span&gt;&lt;span style="color: black;"&gt; &lt;/span&gt;setAnimationBeginsFromCurrentState&lt;span style="color: black;"&gt;:&lt;/span&gt;&lt;span style="color: #ba2da2;"&gt;YES&lt;/span&gt;&lt;span style="color: black;"&gt;];&lt;/span&gt;&lt;/div&gt;&lt;div style="color: black; font: normal normal normal 11px/normal Menlo; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;"&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt;  &lt;/span&gt;[&lt;span style="color: #703daa;"&gt;UIView&lt;/span&gt; &lt;span style="color: #3d1e81;"&gt;setAnimationDuration&lt;/span&gt;:animationDuration];&lt;/div&gt;&lt;div style="color: black; font: normal normal normal 11px/normal Menlo; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;"&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt;  &lt;/span&gt;[&lt;span style="color: #703daa;"&gt;UIView&lt;/span&gt; &lt;span style="color: #3d1e81;"&gt;setAnimationCurve&lt;/span&gt;:animationCurve];&lt;span class="Apple-tab-span" style="white-space: pre;"&gt;  &lt;/span&gt;&lt;/div&gt;&lt;div style="color: black; font: normal normal normal 11px/normal Menlo; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;"&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt;  &lt;/span&gt;frame.&lt;span style="color: #703daa;"&gt;size&lt;/span&gt;.&lt;span style="color: #703daa;"&gt;height&lt;/span&gt; -= keyboardFrame.&lt;span style="color: #703daa;"&gt;size&lt;/span&gt;.&lt;span style="color: #703daa;"&gt;height&lt;/span&gt;;&lt;/div&gt;&lt;div style="color: #008400; font: normal normal normal 11px/normal Menlo; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;"&gt;&lt;span style="color: black;"&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt;  &lt;/span&gt;&lt;/span&gt;&lt;span style="color: #ba2da2;"&gt;if&lt;/span&gt;&lt;span style="color: black;"&gt; (&lt;/span&gt;&lt;span style="color: #ba2da2;"&gt;self&lt;/span&gt;&lt;span style="color: black;"&gt;.&lt;/span&gt;&lt;span style="color: #703daa;"&gt;tabBarController&lt;/span&gt;&lt;span style="color: black;"&gt;) { &lt;/span&gt;// consider if there is a tab bar below&lt;/div&gt;&lt;div style="color: #703daa; font: normal normal normal 11px/normal Menlo; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;"&gt;&lt;span style="color: black;"&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt;   &lt;/span&gt;frame.&lt;/span&gt;size&lt;span style="color: black;"&gt;.&lt;/span&gt;height&lt;span style="color: black;"&gt; += &lt;/span&gt;&lt;span style="color: #ba2da2;"&gt;self&lt;/span&gt;&lt;span style="color: black;"&gt;.&lt;/span&gt;tabBarController&lt;span style="color: black;"&gt;.&lt;/span&gt;tabBar&lt;span style="color: black;"&gt;.&lt;/span&gt;frame&lt;span style="color: black;"&gt;.&lt;/span&gt;size&lt;span style="color: black;"&gt;.&lt;/span&gt;height&lt;span style="color: black;"&gt;;&lt;/span&gt;&lt;/div&gt;&lt;div style="color: black; font: normal normal normal 11px/normal Menlo; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;"&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt;  &lt;/span&gt;}&lt;span class="Apple-tab-span" style="white-space: pre;"&gt;  &lt;/span&gt;&lt;/div&gt;&lt;div style="color: black; font: normal normal normal 11px/normal Menlo; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;"&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt;  &lt;/span&gt;&lt;span style="color: #ba2da2;"&gt;self&lt;/span&gt;.&lt;span style="color: #703daa;"&gt;view&lt;/span&gt;.&lt;span style="color: #703daa;"&gt;frame&lt;/span&gt; = frame;&lt;/div&gt;&lt;div style="color: #4f8187; font: normal normal normal 11px/normal Menlo; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;"&gt;&lt;span style="color: black;"&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt;  &lt;/span&gt;&lt;/span&gt;viewIsResized&lt;span style="color: black;"&gt; = &lt;/span&gt;&lt;span style="color: #ba2da2;"&gt;YES&lt;/span&gt;&lt;span style="color: black;"&gt;;&lt;/span&gt;&lt;/div&gt;&lt;div style="color: black; font: normal normal normal 11px/normal Menlo; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;"&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;}&lt;/div&gt;&lt;div style="color: black; font: normal normal normal 11px/normal Menlo; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; min-height: 13px;"&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;&lt;/div&gt;&lt;div style="color: #3d1e81; font: normal normal normal 11px/normal Menlo; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;"&gt;&lt;span style="color: black;"&gt;&amp;nbsp; &amp;nbsp; [&lt;/span&gt;&lt;span style="color: #703daa;"&gt;UIView&lt;/span&gt;&lt;span style="color: black;"&gt; &lt;/span&gt;commitAnimations&lt;span style="color: black;"&gt;];&lt;/span&gt;&lt;/div&gt;&lt;div style="color: black; font: normal normal normal 11px/normal Menlo; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;"&gt;}&lt;/div&gt;&lt;div style="color: black; font: normal normal normal 11px/normal Menlo; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; min-height: 13px;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="color: black; font: normal normal normal 11px/normal Menlo; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;"&gt;-(&lt;span style="color: #ba2da2;"&gt;void&lt;/span&gt;) keyboardWillHide:(&lt;span style="color: #703daa;"&gt;NSNotification&lt;/span&gt; *)aNotification&lt;/div&gt;&lt;div style="color: black; font: normal normal normal 11px/normal Menlo; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;"&gt;{&lt;/div&gt;&lt;div style="color: black; font: normal normal normal 11px/normal Menlo; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;"&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;&lt;span style="color: #3d1e81;"&gt;CFShow&lt;/span&gt;(aNotification);&lt;/div&gt;&lt;div style="color: #3d1e81; font: normal normal normal 11px/normal Menlo; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;"&gt;&lt;span style="color: black;"&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;&lt;/span&gt;CFShow&lt;span style="color: black;"&gt;(&lt;/span&gt;&lt;span style="color: #ba2da2;"&gt;self&lt;/span&gt;&lt;span style="color: black;"&gt;.&lt;/span&gt;&lt;span style="color: #703daa;"&gt;view&lt;/span&gt;&lt;span style="color: black;"&gt;);&lt;/span&gt;&lt;/div&gt;&lt;div style="color: black; font: normal normal normal 11px/normal Menlo; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;"&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;&lt;span style="color: #703daa;"&gt;NSDictionary&lt;/span&gt; * userInfo = aNotification.&lt;span style="color: #703daa;"&gt;userInfo&lt;/span&gt;;&lt;/div&gt;&lt;div style="color: black; font: normal normal normal 11px/normal Menlo; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;"&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;&lt;span style="color: #703daa;"&gt;NSTimeInterval&lt;/span&gt; animationDuration;&lt;/div&gt;&lt;div style="color: #703daa; font: normal normal normal 11px/normal Menlo; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;"&gt;&lt;span style="color: black;"&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;&lt;/span&gt;UIViewAnimationCurve&lt;span style="color: black;"&gt; animationCurve;&lt;/span&gt;&lt;/div&gt;&lt;div style="color: black; font: normal normal normal 11px/normal Menlo; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;"&gt;&amp;nbsp; &amp;nbsp; &lt;span style="color: #703daa;"&gt;CGRect&lt;/span&gt; keyboardFrame;&lt;/div&gt;&lt;div style="color: #703daa; font: normal normal normal 11px/normal Menlo; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;"&gt;&lt;span style="color: black;"&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;[[userInfo &lt;/span&gt;&lt;span style="color: #3d1e81;"&gt;valueForKey&lt;/span&gt;&lt;span style="color: black;"&gt;:&lt;/span&gt;UIKeyboardAnimationCurveUserInfoKey&lt;span style="color: black;"&gt;] &lt;/span&gt;&lt;span style="color: #3d1e81;"&gt;getValue&lt;/span&gt;&lt;span style="color: black;"&gt;:&amp;amp;animationCurve];&lt;/span&gt;&lt;/div&gt;&lt;div style="color: #703daa; font: normal normal normal 11px/normal Menlo; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;"&gt;&lt;span style="color: black;"&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;[[userInfo &lt;/span&gt;&lt;span style="color: #3d1e81;"&gt;valueForKey&lt;/span&gt;&lt;span style="color: black;"&gt;:&lt;/span&gt;UIKeyboardAnimationDurationUserInfoKey&lt;span style="color: black;"&gt;] &lt;/span&gt;&lt;span style="color: #3d1e81;"&gt;getValue&lt;/span&gt;&lt;span style="color: black;"&gt;:&amp;amp;animationDuration];&lt;/span&gt;&lt;/div&gt;&lt;div style="color: black; font: normal normal normal 11px/normal Menlo; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;"&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;[[userInfo &lt;span style="color: #3d1e81;"&gt;valueForKey&lt;/span&gt;:&lt;span style="color: #703daa;"&gt;UIKeyboardFrameEndUserInfoKey&lt;/span&gt;] &lt;span style="color: #3d1e81;"&gt;getValue&lt;/span&gt;:&amp;amp;keyboardFrame];&lt;/div&gt;&lt;div style="color: black; font: normal normal normal 11px/normal Menlo; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; min-height: 13px;"&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;&lt;/div&gt;&lt;div style="color: #4f8187; font: normal normal normal 11px/normal Menlo; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;"&gt;&lt;span style="color: black;"&gt;&amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style="color: #ba2da2;"&gt;if&lt;/span&gt;&lt;span style="color: black;"&gt; (&lt;/span&gt;viewIsResized&lt;span style="color: black;"&gt;) {&lt;/span&gt;&lt;/div&gt;&lt;div style="color: #703daa; font: normal normal normal 11px/normal Menlo; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;"&gt;&lt;span style="color: black;"&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt;  &lt;/span&gt;&lt;/span&gt;CGRect&lt;span style="color: black;"&gt; frame = &lt;/span&gt;&lt;span style="color: #ba2da2;"&gt;self&lt;/span&gt;&lt;span style="color: black;"&gt;.&lt;/span&gt;view&lt;span style="color: black;"&gt;.&lt;/span&gt;frame&lt;span style="color: black;"&gt;;&lt;/span&gt;&lt;/div&gt;&lt;div style="color: black; font: normal normal normal 11px/normal Menlo; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; min-height: 13px;"&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt;  &lt;/span&gt;&lt;/div&gt;&lt;div style="color: #3d1e81; font: normal normal normal 11px/normal Menlo; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;"&gt;&lt;span style="color: black;"&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt;  &lt;/span&gt;[&lt;/span&gt;&lt;span style="color: #703daa;"&gt;UIView&lt;/span&gt;&lt;span style="color: black;"&gt; &lt;/span&gt;beginAnimations&lt;span style="color: black;"&gt;:&lt;/span&gt;&lt;span style="color: #ba2da2;"&gt;nil&lt;/span&gt;&lt;span style="color: black;"&gt; &lt;/span&gt;context&lt;span style="color: black;"&gt;:&lt;/span&gt;&lt;span style="color: #ba2da2;"&gt;nil&lt;/span&gt;&lt;span style="color: black;"&gt;];&lt;/span&gt;&lt;/div&gt;&lt;div style="color: #3d1e81; font: normal normal normal 11px/normal Menlo; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;"&gt;&lt;span style="color: black;"&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt;  &lt;/span&gt;[&lt;/span&gt;&lt;span style="color: #703daa;"&gt;UIView&lt;/span&gt;&lt;span style="color: black;"&gt; &lt;/span&gt;setAnimationBeginsFromCurrentState&lt;span style="color: black;"&gt;:&lt;/span&gt;&lt;span style="color: #ba2da2;"&gt;YES&lt;/span&gt;&lt;span style="color: black;"&gt;];&lt;/span&gt;&lt;/div&gt;&lt;div style="color: black; font: normal normal normal 11px/normal Menlo; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;"&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt;  &lt;/span&gt;[&lt;span style="color: #703daa;"&gt;UIView&lt;/span&gt; &lt;span style="color: #3d1e81;"&gt;setAnimationDuration&lt;/span&gt;:animationDuration];&lt;/div&gt;&lt;div style="color: black; font: normal normal normal 11px/normal Menlo; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;"&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt;  &lt;/span&gt;[&lt;span style="color: #703daa;"&gt;UIView&lt;/span&gt; &lt;span style="color: #3d1e81;"&gt;setAnimationCurve&lt;/span&gt;:animationCurve];&lt;/div&gt;&lt;div style="color: black; font: normal normal normal 11px/normal Menlo; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; min-height: 13px;"&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt;  &lt;/span&gt;&lt;/div&gt;&lt;div style="color: black; font: normal normal normal 11px/normal Menlo; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;"&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt;  &lt;/span&gt;frame.&lt;span style="color: #703daa;"&gt;size&lt;/span&gt;.&lt;span style="color: #703daa;"&gt;height&lt;/span&gt; += keyboardFrame.&lt;span style="color: #703daa;"&gt;size&lt;/span&gt;.&lt;span style="color: #703daa;"&gt;height&lt;/span&gt;;&lt;/div&gt;&lt;div style="color: #703daa; font: normal normal normal 11px/normal Menlo; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;"&gt;&lt;span style="color: black;"&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt;  &lt;/span&gt;&lt;/span&gt;&lt;span style="color: #ba2da2;"&gt;if&lt;/span&gt;&lt;span style="color: black;"&gt; (&lt;/span&gt;&lt;span style="color: #ba2da2;"&gt;self&lt;/span&gt;&lt;span style="color: black;"&gt;.&lt;/span&gt;tabBarController&lt;span style="color: black;"&gt;) {&lt;/span&gt;&lt;/div&gt;&lt;div style="color: #703daa; font: normal normal normal 11px/normal Menlo; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;"&gt;&lt;span style="color: black;"&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt;   &lt;/span&gt;frame.&lt;/span&gt;size&lt;span style="color: black;"&gt;.&lt;/span&gt;height&lt;span style="color: black;"&gt; -= &lt;/span&gt;&lt;span style="color: #ba2da2;"&gt;self&lt;/span&gt;&lt;span style="color: black;"&gt;.&lt;/span&gt;tabBarController&lt;span style="color: black;"&gt;.&lt;/span&gt;tabBar&lt;span style="color: black;"&gt;.&lt;/span&gt;frame&lt;span style="color: black;"&gt;.&lt;/span&gt;size&lt;span style="color: black;"&gt;.&lt;/span&gt;height&lt;span style="color: black;"&gt;;&lt;/span&gt;&lt;/div&gt;&lt;div style="color: black; font: normal normal normal 11px/normal Menlo; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;"&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt;  &lt;/span&gt;}&lt;/div&gt;&lt;div style="color: black; font: normal normal normal 11px/normal Menlo; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;"&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt;  &lt;/span&gt;&lt;span style="color: #ba2da2;"&gt;self&lt;/span&gt;.&lt;span style="color: #703daa;"&gt;view&lt;/span&gt;.&lt;span style="color: #703daa;"&gt;frame&lt;/span&gt; = frame;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt;  &lt;/span&gt;&lt;/div&gt;&lt;div style="color: #3d1e81; font: normal normal normal 11px/normal Menlo; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;"&gt;&lt;span style="color: black;"&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt;  &lt;/span&gt;[&lt;/span&gt;&lt;span style="color: #703daa;"&gt;UIView&lt;/span&gt;&lt;span style="color: black;"&gt; &lt;/span&gt;commitAnimations&lt;span style="color: black;"&gt;];&lt;/span&gt;&lt;/div&gt;&lt;div style="color: #4f8187; font: normal normal normal 11px/normal Menlo; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;"&gt;&lt;span style="color: black;"&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt;  &lt;/span&gt;&lt;/span&gt;viewIsResized&lt;span style="color: black;"&gt; = &lt;/span&gt;&lt;span style="color: #ba2da2;"&gt;NO&lt;/span&gt;&lt;span style="color: black;"&gt;;&lt;/span&gt;&lt;/div&gt;&lt;div style="color: black; font: normal normal normal 11px/normal Menlo; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;"&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;} &amp;nbsp; &amp;nbsp;&lt;/div&gt;&lt;div style="color: black; font: normal normal normal 11px/normal Menlo; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;"&gt;}&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;span style="color: black;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;br /&gt;&lt;div style="background-attachment: initial; background-clip: initial; background-color: #ffffbf; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial; border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; color: black; direction: ltr; font-family: arial, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; height: auto; line-height: normal; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-align: left; width: auto; z-index: 99995;"&gt;&lt;/div&gt;&lt;div style="background-attachment: initial; background-clip: initial; background-color: #ffffbf; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial; border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; color: black; direction: ltr; font-family: arial, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; height: auto; line-height: normal; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-align: left; width: auto; z-index: 99995;"&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4996441835700536347-4304002299457314838?l=i-phone-dev.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://i-phone-dev.blogspot.com/feeds/4304002299457314838/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://i-phone-dev.blogspot.com/2012/01/different-way-to-show-keyboard-and.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4996441835700536347/posts/default/4304002299457314838'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4996441835700536347/posts/default/4304002299457314838'/><link rel='alternate' type='text/html' href='http://i-phone-dev.blogspot.com/2012/01/different-way-to-show-keyboard-and.html' title='Different way to show keyboard and resize UIView with text field'/><author><name>Anon</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4996441835700536347.post-2080148614619670812</id><published>2011-12-22T08:02:00.002-08:00</published><updated>2012-02-14T07:50:44.770-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='protocol'/><category scheme='http://www.blogger.com/atom/ns#' term='iphone'/><category scheme='http://www.blogger.com/atom/ns#' term='objective c'/><category scheme='http://www.blogger.com/atom/ns#' term='delegate'/><title type='text'>Objective C - writing a good delegate</title><content type='html'>&lt;div&gt;We have write custmozied delegate often in your code. Here is complete design pattern with tips on how to write a good delegate in Objective C.&amp;nbsp;&lt;/div&gt;&lt;ul&gt;&lt;li&gt;use @protocol to define the delegate&lt;/li&gt;&lt;li&gt;&lt;span class="Apple-style-span" style="font-family: 'Lucida Grande', Arial, Helvetica, sans-serif; font-size: 12px; line-height: 18px;"&gt;Its usually considered better to use assign &lt;/span&gt;&lt;b&gt;rather&lt;/b&gt; than &lt;i&gt;&lt;b&gt;retain&lt;/b&gt;&lt;/i&gt; when declaring a property that is to be a delegate. If object A is a delegate for object B, then if A is released by its owner, B does not need to reference it anymore. &lt;i&gt;It is also a good practice in dealloc for A, to set any delegate properties that point to A, to null.&lt;/i&gt; That way when the object goes to notify A, after it has been released, it doesn’t get an error.&lt;/li&gt;&lt;li&gt;&lt;span class="Apple-style-span" style="font-family: 'Lucida Grande', Arial, Helvetica, sans-serif; font-size: 12px; line-height: 18px;"&gt;It’s smart to let your protocol inherit from NSObject protocol, this gives you easy access to common methods such as respondsToSelector &amp;amp; performSelector. But it’s an even better idea to declare your delegate ivar not as id but as NSObject* as this also allows gives you access to common NSObject methods not defined in the NSObject Protocol (like performSelectorOnMainthread: and performSelector:AfterDelay:).&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span class="Apple-style-span" style="font-family: 'Lucida Grande', Arial, Helvetica, sans-serif; font-size: 12px; line-height: 18px;"&gt;Always check if the delegate implemented the required methods.&amp;nbsp;&lt;/span&gt;&lt;/li&gt;&lt;/ul&gt;&lt;blockquote class="tr_bq"&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;if ([[self delegate] respondsToSelector:@selector(processSuccesfully:)]) {&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;[[self delegate] processSuccesfully:YES];&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;}&lt;/span&gt;&lt;/blockquote&gt;&lt;div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 10px; padding-left: 0px; padding-right: 0px; padding-top: 0px;"&gt;&lt;/div&gt;&lt;a name='more'&gt;&lt;/a&gt;&lt;b&gt;In the header file:&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;&lt;div style="color: #4f8187; font-family: 'Lucida Grande', Arial, Helvetica, sans-serif; font-size: 12px; font: normal normal normal 11px/normal Menlo; line-height: 18px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; text-transform: none;"&gt;&lt;span style="color: #ba2da2;"&gt;@class&lt;/span&gt;&lt;span style="color: black;"&gt; &lt;/span&gt;ClusterAnnotationView&lt;span style="color: black;"&gt;;&lt;/span&gt;&lt;/div&gt;&lt;div style="font-family: 'Lucida Grande', Arial, Helvetica, sans-serif; font-size: 12px; font: normal normal normal 11px/normal Menlo; line-height: 18px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; min-height: 13px; text-transform: none;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="font-family: 'Lucida Grande', Arial, Helvetica, sans-serif; font-size: 12px; font: normal normal normal 11px/normal Menlo; line-height: 18px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; text-transform: none;"&gt;&lt;span style="color: #ba2da2;"&gt;@&lt;b&gt;protocol&lt;/b&gt;&lt;/span&gt; ClusterAnnotationViewDelegate &amp;lt;&lt;span style="color: #703daa;"&gt;NSObject&lt;/span&gt;&amp;gt;&lt;/div&gt;&lt;div style="font-family: 'Lucida Grande', Arial, Helvetica, sans-serif; font-size: 12px; font: normal normal normal 11px/normal Menlo; line-height: 18px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; min-height: 13px; text-transform: none;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="font-family: 'Lucida Grande', Arial, Helvetica, sans-serif; font-size: 12px; font: normal normal normal 11px/normal Menlo; line-height: 18px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; min-height: 13px; text-transform: none;"&gt;&lt;/div&gt;&lt;div style="color: #ba2da2; font-family: 'Lucida Grande', Arial, Helvetica, sans-serif; font-size: 12px; font: normal normal normal 11px/normal Menlo; line-height: 18px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; text-transform: none;"&gt;@required&lt;/div&gt;&lt;div style="color: #008400; font-family: 'Lucida Grande', Arial, Helvetica, sans-serif; font-size: 12px; font: normal normal normal 11px/normal Menlo; line-height: 18px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; text-transform: none;"&gt;// any required method, you want to use&lt;/div&gt;&lt;div style="font-family: 'Lucida Grande', Arial, Helvetica, sans-serif; font-size: 12px; line-height: 18px; text-transform: none;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="color: #ba2da2; font-family: 'Lucida Grande', Arial, Helvetica, sans-serif; font-size: 12px; font: normal normal normal 11px/normal Menlo; line-height: 18px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; text-transform: none;"&gt;@optional&lt;/div&gt;&lt;div style="font-family: 'Lucida Grande', Arial, Helvetica, sans-serif; font-size: 12px; font: normal normal normal 11px/normal Menlo; line-height: 18px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; text-transform: none;"&gt;&lt;/div&gt;&lt;div style="color: #ba2da2; font-family: 'Lucida Grande', Arial, Helvetica, sans-serif; font-size: 12px; font: normal normal normal 11px/normal Menlo; line-height: 18px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; text-transform: none;"&gt;&lt;span class="Apple-style-span" style="color: black;"&gt;- (&lt;/span&gt;&lt;span class="Apple-style-span" style="color: black;"&gt;&lt;span style="color: #ba2da2;"&gt;void&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="color: black;"&gt;) clusterAnnotationView:(&lt;/span&gt;&lt;span class="Apple-style-span" style="color: black;"&gt;&lt;span style="color: #4f8187;"&gt;ClusterAnnotationView&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="color: black;"&gt; *)annotationView&amp;nbsp;&lt;/span&gt;&lt;/div&gt;&lt;div style="font-family: 'Lucida Grande', Arial, Helvetica, sans-serif; font-size: 12px; font: normal normal normal 11px/normal Menlo; line-height: 18px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; text-transform: none;"&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt;    &lt;/span&gt;&amp;nbsp; touchesBegan:(&lt;span style="color: #703daa;"&gt;NSSet&lt;/span&gt; *)touches withEvent:(&lt;span style="color: #703daa;"&gt;UIEvent&lt;/span&gt; *)event;&lt;/div&gt;&lt;div style="font-family: 'Lucida Grande', Arial, Helvetica, sans-serif; font-size: 12px; font: normal normal normal 11px/normal Menlo; line-height: 18px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; text-transform: none;"&gt;- (&lt;span style="color: #ba2da2;"&gt;void&lt;/span&gt;) clusterAnnotationView:(&lt;span style="color: #4f8187;"&gt;ClusterAnnotationView&lt;/span&gt; *)annotationView&amp;nbsp;&lt;/div&gt;&lt;div style="font-family: 'Lucida Grande', Arial, Helvetica, sans-serif; font-size: 12px; font: normal normal normal 11px/normal Menlo; line-height: 18px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; text-transform: none;"&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt;    &lt;/span&gt; &amp;nbsp; longPressed:(&lt;span style="color: #ba2da2;"&gt;BOOL&lt;/span&gt;)longPressed;&lt;/div&gt;&lt;div style="font-family: 'Lucida Grande', Arial, Helvetica, sans-serif; font-size: 12px; line-height: 18px; text-transform: none;"&gt;&lt;/div&gt;&lt;div style="color: #ba2da2; font-family: 'Lucida Grande', Arial, Helvetica, sans-serif; font-size: 12px; font: normal normal normal 11px/normal Menlo; line-height: 18px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; text-transform: none;"&gt;@end&lt;/div&gt;&lt;div style="font-family: 'Lucida Grande', Arial, Helvetica, sans-serif; font-size: 12px; font: normal normal normal 11px/normal Menlo; line-height: 18px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; min-height: 13px; text-transform: none;"&gt;&lt;br /&gt;&lt;/div&gt;Then your class definition. &lt;br /&gt;&lt;br /&gt;&lt;div style="font: normal normal normal 11px/normal Menlo; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;"&gt;&lt;/div&gt;&lt;div style="color: #ba2da2; font-family: 'Lucida Grande', Arial, Helvetica, sans-serif; font-size: 12px; font: normal normal normal 11px/normal Menlo; line-height: 18px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; text-transform: none;"&gt;&lt;span style="color: #ba2da2;"&gt;@interface&lt;/span&gt; ClusterAnnotationView : &lt;span style="color: #703daa;"&gt;MKAnnotationView&lt;/span&gt; &amp;lt;&lt;span style="color: #703daa;"&gt;MKAnnotation&lt;/span&gt;&amp;gt; {&lt;/div&gt;&lt;div style="color: #ba2da2; font-family: 'Lucida Grande', Arial, Helvetica, sans-serif; font-size: 12px; font: normal normal normal 11px/normal Menlo; line-height: 18px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; text-transform: none;"&gt;&lt;span class="Apple-style-span" style="color: #4f8187;"&gt;&lt;span style="color: black;"&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="color: #4f8187;"&gt;&lt;span style="color: #ba2da2;"&gt;id&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="color: #4f8187;"&gt;&lt;span style="color: black;"&gt; &amp;lt;&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="color: #4f8187;"&gt;ClusterAnnotationViewDelegate&lt;/span&gt;&lt;span class="Apple-style-span" style="color: #4f8187;"&gt;&lt;span style="color: black;"&gt;&amp;gt; delegate;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style="color: #ba2da2; font-family: 'Lucida Grande', Arial, Helvetica, sans-serif; font-size: 12px; font: normal normal normal 11px/normal Menlo; line-height: 18px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; text-transform: none;"&gt;}&lt;/div&gt;&lt;div style="color: #ba2da2; font-family: 'Lucida Grande', Arial, Helvetica, sans-serif; font-size: 12px; font: normal normal normal 11px/normal Menlo; line-height: 18px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; min-height: 13px; text-transform: none;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="color: #ba2da2; font-family: 'Lucida Grande', Arial, Helvetica, sans-serif; font-size: 12px; font: normal normal normal 11px/normal Menlo; line-height: 18px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; text-transform: none;"&gt;@property&lt;span style="color: black;"&gt; (&lt;/span&gt;nonatomic&lt;span style="color: black;"&gt;, &lt;/span&gt;assign&lt;span style="color: black;"&gt;) &lt;/span&gt;id&lt;span style="color: black;"&gt; delegate;&lt;/span&gt;&lt;/div&gt;&lt;div style="color: #ba2da2; font-family: 'Lucida Grande', Arial, Helvetica, sans-serif; font-size: 12px; line-height: 18px; text-transform: none;"&gt;&lt;span style="color: black;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style="font-family: 'Lucida Grande', Arial, Helvetica, sans-serif; font-size: 12px; line-height: 18px; text-transform: none;"&gt;&lt;/div&gt;&lt;br /&gt;&lt;div style="font-family: 'Lucida Grande', Arial, Helvetica, sans-serif; font-size: 12px; line-height: 18px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 10px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-transform: none;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="font-family: 'Lucida Grande', Arial, Helvetica, sans-serif; line-height: 18px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 10px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-transform: none;"&gt;&lt;b&gt;The class implementation with its delegate:&lt;/b&gt;&lt;/div&gt;&lt;div style="font-family: 'Lucida Grande', Arial, Helvetica, sans-serif; line-height: 18px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 10px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-transform: none;"&gt;&lt;span class="Apple-style-span" style="font-family: Menlo; font-size: 11px; line-height: normal;"&gt;&lt;span style="color: #ba2da2;"&gt;@implementation&lt;/span&gt; &lt;b&gt;ClusterAnnotationView&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style="font: 11.0px Menlo; margin: 0.0px 0.0px 0.0px 0.0px; min-height: 13.0px;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="font: 11.0px Menlo; margin: 0.0px 0.0px 0.0px 0.0px;"&gt;&lt;span style="color: #ba2da2;"&gt;@synthesize&lt;/span&gt; coordinate;&lt;/div&gt;&lt;div style="font: 11.0px Menlo; margin: 0.0px 0.0px 0.0px 0.0px;"&gt;&lt;span style="color: #ba2da2;"&gt;@synthesize&lt;/span&gt; customCallOutView;&lt;/div&gt;&lt;div style="color: #ba2da2; font: 11.0px Menlo; margin: 0.0px 0.0px 0.0px 0.0px;"&gt;@synthesize&lt;span style="color: black;"&gt; delegate;&lt;/span&gt;&lt;/div&gt;&lt;div style="font: 11.0px Menlo; margin: 0.0px 0.0px 0.0px 0.0px; min-height: 13.0px;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="font: 11.0px Menlo; margin: 0.0px 0.0px 0.0px 0.0px;"&gt;&lt;/div&gt;&lt;div style="font: 11.0px Menlo; margin: 0.0px 0.0px 0.0px 0.0px;"&gt;- (&lt;span style="color: #ba2da2;"&gt;id&lt;/span&gt;) initWithAnnotation:(&lt;span style="color: #ba2da2;"&gt;id&lt;/span&gt;&amp;lt;&lt;span style="color: #703daa;"&gt;MKAnnotation&lt;/span&gt;&amp;gt;)annotation&amp;nbsp;&lt;/div&gt;&lt;div style="font: 11.0px Menlo; margin: 0.0px 0.0px 0.0px 0.0px;"&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt;  &lt;/span&gt;&amp;nbsp; reuseIdentifier:(&lt;span style="color: #703daa;"&gt;NSString&lt;/span&gt; *)reuseIdentifier&lt;/div&gt;&lt;div style="font: 11.0px Menlo; margin: 0.0px 0.0px 0.0px 0.0px;"&gt;{&lt;/div&gt;&lt;div style="font: 11.0px Menlo; margin: 0.0px 0.0px 0.0px 0.0px;"&gt;&amp;nbsp; &amp;nbsp; &lt;span style="color: #ba2da2;"&gt;self&lt;/span&gt; = [&lt;span style="color: #ba2da2;"&gt;super&lt;/span&gt; &lt;span style="color: #3d1e81;"&gt;initWithAnnotation&lt;/span&gt;:annotation &lt;span style="color: #3d1e81;"&gt;reuseIdentifier&lt;/span&gt;:reuseIdentifier];&lt;/div&gt;&lt;div style="font: 11.0px Menlo; margin: 0.0px 0.0px 0.0px 0.0px; min-height: 13.0px;"&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;&lt;/div&gt;&lt;div style="font: 11.0px Menlo; margin: 0.0px 0.0px 0.0px 0.0px;"&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;&lt;span style="color: #ba2da2;"&gt;if&lt;/span&gt; (&lt;span style="color: #ba2da2;"&gt;self&lt;/span&gt;) {&lt;span class="Apple-tab-span" style="white-space: pre;"&gt;    &lt;/span&gt;&lt;/div&gt;&lt;div style="color: #703daa; font: 11.0px Menlo; margin: 0.0px 0.0px 0.0px 0.0px;"&gt;&lt;span style="color: black;"&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt;  &lt;/span&gt;&lt;/span&gt;UILongPressGestureRecognizer&lt;span style="color: black;"&gt; *longPress = [[&lt;/span&gt;UILongPressGestureRecognizer&lt;span style="color: black;"&gt; &lt;/span&gt;&lt;span style="color: #3d1e81;"&gt;alloc&lt;/span&gt;&lt;span style="color: black;"&gt;]&amp;nbsp;&lt;/span&gt;&lt;/div&gt;&lt;div style="font: 11.0px Menlo; margin: 0.0px 0.0px 0.0px 0.0px;"&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt;            &lt;/span&gt; &amp;nbsp; &lt;span style="color: #3d1e81;"&gt;initWithTarget&lt;/span&gt;:&lt;span style="color: #ba2da2;"&gt;self&lt;/span&gt; &lt;span style="color: #3d1e81;"&gt;action&lt;/span&gt;:&lt;span style="color: #ba2da2;"&gt;@selector&lt;/span&gt;(longPress:)];&lt;/div&gt;&lt;div style="color: #3d1e81; font: 11.0px Menlo; margin: 0.0px 0.0px 0.0px 0.0px;"&gt;&lt;span style="color: black;"&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt;  &lt;/span&gt;[&lt;/span&gt;&lt;span style="color: #ba2da2;"&gt;self&lt;/span&gt;&lt;span style="color: black;"&gt; &lt;/span&gt;addGestureRecognizer&lt;span style="color: black;"&gt;:longPress];&lt;/span&gt;&lt;/div&gt;&lt;div style="font: 11.0px Menlo; margin: 0.0px 0.0px 0.0px 0.0px;"&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt;  &lt;/span&gt;[longPress &lt;span style="color: #3d1e81;"&gt;release&lt;/span&gt;];&lt;/div&gt;&lt;div style="font: 11.0px Menlo; margin: 0.0px 0.0px 0.0px 0.0px;"&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;}&lt;/div&gt;&lt;div style="font: 11.0px Menlo; margin: 0.0px 0.0px 0.0px 0.0px; min-height: 13.0px;"&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&lt;/div&gt;&lt;div style="color: #ba2da2; font: 11.0px Menlo; margin: 0.0px 0.0px 0.0px 0.0px;"&gt;&lt;span style="color: black;"&gt;&amp;nbsp; &amp;nbsp; &lt;/span&gt;return&lt;span style="color: black;"&gt; &lt;/span&gt;self&lt;span style="color: black;"&gt;;&lt;/span&gt;&lt;/div&gt;&lt;div style="font: 11.0px Menlo; margin: 0.0px 0.0px 0.0px 0.0px;"&gt;}&lt;/div&gt;&lt;div style="font: 11.0px Menlo; margin: 0.0px 0.0px 0.0px 0.0px;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="font: 11.0px Menlo; margin: 0.0px 0.0px 0.0px 0.0px;"&gt;// calling delegate's methods.&amp;nbsp;&lt;/div&gt;&lt;br /&gt;&lt;div style="font: 11.0px Menlo; margin: 0.0px 0.0px 0.0px 0.0px;"&gt;&lt;/div&gt;&lt;div style="font: 11.0px Menlo; margin: 0.0px 0.0px 0.0px 0.0px;"&gt;- (&lt;span style="color: #ba2da2;"&gt;void&lt;/span&gt;)touchesBegan:(&lt;span style="color: #703daa;"&gt;NSSet&lt;/span&gt; *)touches withEvent:(&lt;span style="color: #703daa;"&gt;UIEvent&lt;/span&gt; *)event{&lt;/div&gt;&lt;div style="color: #4f8187; font: 11.0px Menlo; margin: 0.0px 0.0px 0.0px 0.0px;"&gt;&lt;span style="color: black;"&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style="color: #ba2da2;"&gt;self&lt;/span&gt;&lt;span style="color: black;"&gt;.&lt;/span&gt;customCallOutView&lt;span style="color: black;"&gt;.&lt;/span&gt;&lt;span style="color: #703daa;"&gt;hidden&lt;/span&gt;&lt;span style="color: black;"&gt; = &lt;/span&gt;&lt;span style="color: #ba2da2;"&gt;YES&lt;/span&gt;&lt;span style="color: black;"&gt;;&lt;/span&gt;&lt;/div&gt;&lt;div style="font: 11.0px Menlo; margin: 0.0px 0.0px 0.0px 0.0px;"&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;&lt;span style="color: #ba2da2;"&gt;if&lt;/span&gt; ([&lt;span style="color: #ba2da2;"&gt;self&lt;/span&gt;.&lt;span style="color: #4f8187;"&gt;delegate&lt;/span&gt; &lt;span style="color: #3d1e81;"&gt;respondsToSelector&lt;/span&gt;:&lt;span style="color: #ba2da2;"&gt;@selector&lt;/span&gt;(clusterAnnotationView:touchesBegan:withEvent:)]) {&lt;/div&gt;&lt;div style="color: #31595e; font: 11.0px Menlo; margin: 0.0px 0.0px 0.0px 0.0px;"&gt;&lt;span style="color: black;"&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt;  &lt;/span&gt;[&lt;/span&gt;&lt;span style="color: #ba2da2;"&gt;self&lt;/span&gt;&lt;span style="color: black;"&gt;.&lt;/span&gt;&lt;span style="color: #4f8187;"&gt;delegate&lt;/span&gt;&lt;span style="color: black;"&gt; &lt;/span&gt;clusterAnnotationView&lt;span style="color: black;"&gt;:&lt;/span&gt;&lt;span style="color: #ba2da2;"&gt;self&lt;/span&gt;&lt;span style="color: black;"&gt; &lt;/span&gt;touchesBegan&lt;span style="color: black;"&gt;:touches &lt;/span&gt;withEvent&lt;span style="color: black;"&gt;:event];&lt;/span&gt;&lt;/div&gt;&lt;div style="font: 11.0px Menlo; margin: 0.0px 0.0px 0.0px 0.0px;"&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;}&lt;/div&gt;&lt;div style="font: 11.0px Menlo; margin: 0.0px 0.0px 0.0px 0.0px;"&gt;}&lt;/div&gt;&lt;br /&gt;&lt;div style="font: 11.0px Menlo; margin: 0.0px 0.0px 0.0px 0.0px;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="font: 11.0px Menlo; margin: 0.0px 0.0px 0.0px 0.0px;"&gt;&lt;/div&gt;&lt;div style="color: #703daa; font: 11.0px Menlo; margin: 0.0px 0.0px 0.0px 0.0px;"&gt;&lt;span style="color: black;"&gt;- (&lt;/span&gt;&lt;span style="color: #ba2da2;"&gt;void&lt;/span&gt;&lt;span style="color: black;"&gt;)longPress:(&lt;/span&gt;UILongPressGestureRecognizer&lt;span style="color: black;"&gt;*)gesture {&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style="color: black;"&gt;&lt;/span&gt;&lt;br /&gt;&lt;div style="font: 11.0px Menlo; margin: 0.0px 0.0px 0.0px 0.0px;"&gt;&lt;span style="color: black;"&gt;&lt;span style="color: #ba2da2;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;if&lt;/span&gt; ([&lt;span style="color: #ba2da2;"&gt;self&lt;/span&gt;.&lt;span style="color: #4f8187;"&gt;delegate&lt;/span&gt; &lt;span style="color: #3d1e81;"&gt;respondsToSelector&lt;/span&gt;:&lt;span style="color: #ba2da2;"&gt;@selector&lt;/span&gt;(clusterAnnotationView:longPressed:)]) {&lt;/span&gt;&lt;/div&gt;&lt;div style="color: #31595e; font: 11.0px Menlo; margin: 0.0px 0.0px 0.0px 0.0px;"&gt;&lt;span style="color: black;"&gt;&lt;span style="color: black;"&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt;  &lt;/span&gt;[&lt;/span&gt;&lt;span style="color: #ba2da2;"&gt;self&lt;/span&gt;&lt;span style="color: black;"&gt;.&lt;/span&gt;&lt;span style="color: #4f8187;"&gt;delegate&lt;/span&gt;&lt;span style="color: black;"&gt; &lt;/span&gt;clusterAnnotationView&lt;span style="color: black;"&gt;:&lt;/span&gt;&lt;span style="color: #ba2da2;"&gt;self&lt;/span&gt;&lt;span style="color: black;"&gt; &lt;/span&gt;longPressed&lt;span style="color: black;"&gt;:&lt;/span&gt;&lt;span style="color: #ba2da2;"&gt;YES&lt;/span&gt;&lt;span style="color: black;"&gt;];&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style="font: 11.0px Menlo; margin: 0.0px 0.0px 0.0px 0.0px;"&gt;&lt;span style="color: black;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;}&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;span style="color: black;"&gt;}&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style="color: black;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;br /&gt;&lt;div style="font: 11.0px Menlo; margin: 0.0px 0.0px 0.0px 0.0px;"&gt;&lt;/div&gt;&lt;div style="color: #ba2da2; font: 11.0px Menlo; margin: 0.0px 0.0px 0.0px 0.0px;"&gt;@end&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;div style="background-attachment: initial; background-clip: initial; background-color: #ffffbf; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial; border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; color: black; direction: ltr; font-family: arial, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; height: auto; line-height: normal; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-align: left; width: auto; z-index: 99995;"&gt;&lt;/div&gt;&lt;div style="background-attachment: initial; background-clip: initial; background-color: #ffffbf; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial; border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; color: black; direction: ltr; font-family: arial, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; height: auto; line-height: normal; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-align: left; width: auto; z-index: 99995;"&gt;&lt;/div&gt;&lt;div style="background-attachment: initial; background-clip: initial; background-color: #ffffbf; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial; border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; color: black; direction: ltr; font-family: arial, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; height: auto; line-height: normal; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-align: left; width: auto; z-index: 99995;"&gt;&lt;/div&gt;&lt;div style="background-attachment: initial; background-clip: initial; background-color: #ffffbf; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial; border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; color: black; direction: ltr; font-family: arial, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; height: auto; line-height: normal; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-align: left; width: auto; z-index: 99995;"&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4996441835700536347-2080148614619670812?l=i-phone-dev.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://i-phone-dev.blogspot.com/feeds/2080148614619670812/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://i-phone-dev.blogspot.com/2011/12/objective-c-writing-good-delegate.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4996441835700536347/posts/default/2080148614619670812'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4996441835700536347/posts/default/2080148614619670812'/><link rel='alternate' type='text/html' href='http://i-phone-dev.blogspot.com/2011/12/objective-c-writing-good-delegate.html' title='Objective C - writing a good delegate'/><author><name>Anon</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4996441835700536347.post-8184903044240511883</id><published>2011-12-15T01:57:00.000-08:00</published><updated>2011-12-15T01:57:24.807-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='copy'/><category scheme='http://www.blogger.com/atom/ns#' term='property'/><category scheme='http://www.blogger.com/atom/ns#' term='retain'/><category scheme='http://www.blogger.com/atom/ns#' term='objective c'/><category scheme='http://www.blogger.com/atom/ns#' term='assign'/><title type='text'>Objective C - Property unleashed</title><content type='html'>When we define Objective C class, we define property and synthesize them using built-in synthesizing methods.&lt;br /&gt;Properties can &lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;nonatomic&lt;/span&gt;, &lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;assign&lt;/span&gt;, &lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;copy&lt;/span&gt; etc. Here I will go into the meaning of different keywords of defining a property.&lt;br /&gt;&lt;br /&gt;Property definitions:&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;@property (nonatomic, retain) NSString * name;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;@property (assign) NSInteger count;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-size: large;"&gt;&lt;b&gt;assign:&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-size: 14px;"&gt;In your setter method for the property, there is a simple assignment of your instance variable to the new value, eg:&lt;/span&gt;&lt;br /&gt;&lt;pre class="lang-c prettyprint" style="background-attachment: initial; background-clip: initial; background-color: #eeeeee; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial; border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; font-family: Consolas, Menlo, Monaco, 'Lucida Console', 'Liberation Mono', 'DejaVu Sans Mono', 'Bitstream Vera Sans Mono', 'Courier New', monospace, serif; font-size: 14px; margin-bottom: 10px; margin-left: 0px; margin-right: 0px; margin-top: 0px; max-height: 600px; overflow-x: auto; overflow-y: auto; padding-bottom: 5px; padding-left: 5px; padding-right: 5px; padding-top: 5px; vertical-align: baseline; width: auto; word-wrap: normal;"&gt;&lt;code style="background-attachment: initial; background-clip: initial; background-color: #eeeeee; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial; border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; font-family: Consolas, Menlo, Monaco, 'Lucida Console', 'Liberation Mono', 'DejaVu Sans Mono', 'Bitstream Vera Sans Mono', 'Courier New', monospace, serif; font-size: 14px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;"&gt;&lt;span class="pun" style="background-attachment: initial; background-clip: initial; background-color: transparent; background-image: initial; background-origin: initial; border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; color: black; font-size: 14px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;"&gt;-&lt;/span&gt;&lt;span class="pln" style="background-attachment: initial; background-clip: initial; background-color: transparent; background-image: initial; background-origin: initial; border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; color: black; font-size: 14px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;"&gt; &lt;/span&gt;&lt;span class="pun" style="background-attachment: initial; background-clip: initial; background-color: transparent; background-image: initial; background-origin: initial; border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; color: black; font-size: 14px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;"&gt;(&lt;/span&gt;&lt;span class="kwd" style="background-attachment: initial; background-clip: initial; background-color: transparent; background-image: initial; background-origin: initial; border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; color: darkblue; font-size: 14px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;"&gt;void&lt;/span&gt;&lt;span class="pun" style="background-attachment: initial; background-clip: initial; background-color: transparent; background-image: initial; background-origin: initial; border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; color: black; font-size: 14px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;"&gt;)&lt;/span&gt;&lt;span class="pln" style="background-attachment: initial; background-clip: initial; background-color: transparent; background-image: initial; background-origin: initial; border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; color: black; font-size: 14px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;"&gt;setString&lt;/span&gt;&lt;span class="pun" style="background-attachment: initial; background-clip: initial; background-color: transparent; background-image: initial; background-origin: initial; border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; color: black; font-size: 14px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;"&gt;:(&lt;/span&gt;&lt;span class="typ" style="background-attachment: initial; background-clip: initial; background-color: transparent; background-image: initial; background-origin: initial; border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; color: #2b91af; font-size: 14px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;"&gt;NSString&lt;/span&gt;&lt;span class="pun" style="background-attachment: initial; background-clip: initial; background-color: transparent; background-image: initial; background-origin: initial; border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; color: black; font-size: 14px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;"&gt;*)&lt;/span&gt;&lt;span class="pln" style="background-attachment: initial; background-clip: initial; background-color: transparent; background-image: initial; background-origin: initial; border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; color: black; font-size: 14px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;"&gt;newString&lt;/span&gt;&lt;span class="pun" style="background-attachment: initial; background-clip: initial; background-color: transparent; background-image: initial; background-origin: initial; border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; color: black; font-size: 14px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;"&gt;{&lt;/span&gt;&lt;span class="pln" style="background-attachment: initial; background-clip: initial; background-color: transparent; background-image: initial; background-origin: initial; border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; color: black; font-size: 14px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;"&gt;&lt;br /&gt;&amp;nbsp; &amp;nbsp; string &lt;/span&gt;&lt;span class="pun" style="background-attachment: initial; background-clip: initial; background-color: transparent; background-image: initial; background-origin: initial; border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; color: black; font-size: 14px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;"&gt;=&lt;/span&gt;&lt;span class="pln" style="background-attachment: initial; background-clip: initial; background-color: transparent; background-image: initial; background-origin: initial; border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; color: black; font-size: 14px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;"&gt; newString&lt;/span&gt;&lt;span class="pun" style="background-attachment: initial; background-clip: initial; background-color: transparent; background-image: initial; background-origin: initial; border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; color: black; font-size: 14px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;"&gt;;&lt;/span&gt;&lt;span class="pln" style="background-attachment: initial; background-clip: initial; background-color: transparent; background-image: initial; background-origin: initial; border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; color: black; font-size: 14px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span class="pun" style="background-attachment: initial; background-clip: initial; background-color: transparent; background-image: initial; background-origin: initial; border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; color: black; font-size: 14px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;"&gt;}&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: Arial, 'Liberation Sans', 'DejaVu Sans', sans-serif;"&gt;&lt;span class="Apple-style-span" style="border-collapse: collapse; font-size: 14px; line-height: 18px;"&gt;This can cause problems since Objective-C objects use reference counting, and therefore by not retaining the object, there is a chance that the string could be deallocated whilst you are still using it.&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: Arial, 'Liberation Sans', 'DejaVu Sans', sans-serif;"&gt;&lt;span class="Apple-style-span" style="border-collapse: collapse; font-size: 14px; line-height: 18px;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: Arial, 'Liberation Sans', 'DejaVu Sans', sans-serif; font-size: large;"&gt;&lt;span class="Apple-style-span" style="border-collapse: collapse; line-height: 18px;"&gt;&lt;b&gt;retain:&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: Arial, 'Liberation Sans', 'DejaVu Sans', sans-serif;"&gt;&lt;span class="Apple-style-span" style="border-collapse: collapse; font-size: 14px; line-height: 18px;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="border-collapse: collapse; font-family: Arial, 'Liberation Sans', 'DejaVu Sans', sans-serif; font-size: 14px; line-height: 18px;"&gt;&lt;/span&gt;&lt;br /&gt;&lt;div style="background-attachment: initial; background-clip: initial; background-color: transparent; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial; border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; clear: both; font-size: 14px; margin-bottom: 1em; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline; word-wrap: break-word;"&gt;this&amp;nbsp;&lt;em style="background-attachment: initial; background-clip: initial; background-color: transparent; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial; border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; font-size: 14px; font-style: italic; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;"&gt;retains&lt;/em&gt;&amp;nbsp;the new value in your setter method. For example:&lt;/div&gt;&lt;pre class="lang-c prettyprint" style="background-attachment: initial; background-clip: initial; background-color: #eeeeee; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial; border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; font-family: Consolas, Menlo, Monaco, 'Lucida Console', 'Liberation Mono', 'DejaVu Sans Mono', 'Bitstream Vera Sans Mono', 'Courier New', monospace, serif; font-size: 14px; margin-bottom: 10px; margin-left: 0px; margin-right: 0px; margin-top: 0px; max-height: 600px; overflow-x: auto; overflow-y: auto; padding-bottom: 5px; padding-left: 5px; padding-right: 5px; padding-top: 5px; vertical-align: baseline; width: auto; word-wrap: normal;"&gt;&lt;code style="background-attachment: initial; background-clip: initial; background-color: #eeeeee; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial; border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; font-family: Consolas, Menlo, Monaco, 'Lucida Console', 'Liberation Mono', 'DejaVu Sans Mono', 'Bitstream Vera Sans Mono', 'Courier New', monospace, serif; font-size: 14px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;"&gt;&lt;span class="pun" style="background-attachment: initial; background-clip: initial; background-color: transparent; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial; border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; color: black; font-size: 14px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;"&gt;-&lt;/span&gt;&lt;span class="pln" style="background-attachment: initial; background-clip: initial; background-color: transparent; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial; border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; color: black; font-size: 14px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;"&gt; &lt;/span&gt;&lt;span class="pun" style="background-attachment: initial; background-clip: initial; background-color: transparent; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial; border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; color: black; font-size: 14px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;"&gt;(&lt;/span&gt;&lt;span class="kwd" style="background-attachment: initial; background-clip: initial; background-color: transparent; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial; border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; color: darkblue; font-size: 14px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;"&gt;void&lt;/span&gt;&lt;span class="pun" style="background-attachment: initial; background-clip: initial; background-color: transparent; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial; border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; color: black; font-size: 14px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;"&gt;)&lt;/span&gt;&lt;span class="pln" style="background-attachment: initial; background-clip: initial; background-color: transparent; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial; border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; color: black; font-size: 14px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;"&gt;setString&lt;/span&gt;&lt;span class="pun" style="background-attachment: initial; background-clip: initial; background-color: transparent; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial; border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; color: black; font-size: 14px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;"&gt;:(&lt;/span&gt;&lt;span class="typ" style="background-attachment: initial; background-clip: initial; background-color: transparent; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial; border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; color: #2b91af; font-size: 14px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;"&gt;NSString&lt;/span&gt;&lt;span class="pun" style="background-attachment: initial; background-clip: initial; background-color: transparent; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial; border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; color: black; font-size: 14px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;"&gt;*)&lt;/span&gt;&lt;span class="pln" style="background-attachment: initial; background-clip: initial; background-color: transparent; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial; border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; color: black; font-size: 14px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;"&gt;newString&lt;/span&gt;&lt;span class="pun" style="background-attachment: initial; background-clip: initial; background-color: transparent; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial; border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; color: black; font-size: 14px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;"&gt;{&lt;/span&gt;&lt;span class="pln" style="background-attachment: initial; background-clip: initial; background-color: transparent; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial; border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; color: black; font-size: 14px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;"&gt;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span class="pun" style="background-attachment: initial; background-clip: initial; background-color: transparent; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial; border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; color: black; font-size: 14px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;"&gt;[&lt;/span&gt;&lt;span class="pln" style="background-attachment: initial; background-clip: initial; background-color: transparent; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial; border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; color: black; font-size: 14px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;"&gt;newString retain&lt;/span&gt;&lt;span class="pun" style="background-attachment: initial; background-clip: initial; background-color: transparent; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial; border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; color: black; font-size: 14px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;"&gt;];&lt;/span&gt;&lt;span class="pln" style="background-attachment: initial; background-clip: initial; background-color: transparent; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial; border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; color: black; font-size: 14px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;"&gt;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span class="pun" style="background-attachment: initial; background-clip: initial; background-color: transparent; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial; border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; color: black; font-size: 14px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;"&gt;[&lt;/span&gt;&lt;span class="pln" style="background-attachment: initial; background-clip: initial; background-color: transparent; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial; border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; color: black; font-size: 14px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;"&gt;string release&lt;/span&gt;&lt;span class="pun" style="background-attachment: initial; background-clip: initial; background-color: transparent; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial; border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; color: black; font-size: 14px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;"&gt;];&lt;/span&gt;&lt;span class="pln" style="background-attachment: initial; background-clip: initial; background-color: transparent; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial; border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; color: black; font-size: 14px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;"&gt;&lt;br /&gt;&amp;nbsp; &amp;nbsp; string &lt;/span&gt;&lt;span class="pun" style="background-attachment: initial; background-clip: initial; background-color: transparent; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial; border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; color: black; font-size: 14px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;"&gt;=&lt;/span&gt;&lt;span class="pln" style="background-attachment: initial; background-clip: initial; background-color: transparent; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial; border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; color: black; font-size: 14px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;"&gt; newString&lt;/span&gt;&lt;span class="pun" style="background-attachment: initial; background-clip: initial; background-color: transparent; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial; border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; color: black; font-size: 14px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;"&gt;;&lt;/span&gt;&lt;span class="pln" style="background-attachment: initial; background-clip: initial; background-color: transparent; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial; border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; color: black; font-size: 14px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span class="pun" style="background-attachment: initial; background-clip: initial; background-color: transparent; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial; border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; color: black; font-size: 14px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;"&gt;}&lt;/span&gt;&lt;span class="pln" style="background-attachment: initial; background-clip: initial; background-color: transparent; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial; border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; color: black; font-size: 14px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;div style="background-attachment: initial; background-clip: initial; background-color: transparent; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial; border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; clear: both; font-size: 14px; margin-bottom: 1em; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline; word-wrap: break-word;"&gt;This is safer, since you explicitly state that you want to maintain a reference of the object, and you must release it before it will be deallocated.&amp;nbsp;This is usual method to have a object property in the class.&amp;nbsp;&lt;/div&gt;&lt;div style="background-attachment: initial; background-clip: initial; background-color: transparent; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial; border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; clear: both; font-size: 14px; margin-bottom: 1em; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline; word-wrap: break-word;"&gt;&lt;span class="Apple-style-span" style="font-size: large;"&gt;&lt;b&gt;copy:&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;&lt;span class="Apple-style-span" style="border-collapse: collapse; font-family: Arial, 'Liberation Sans', 'DejaVu Sans', sans-serif; font-size: 14px; line-height: 18px;"&gt;This makes a copy of the string in your setter method:&lt;/span&gt;&lt;span class="Apple-style-span" style="border-collapse: collapse; font-family: Arial, 'Liberation Sans', 'DejaVu Sans', sans-serif; font-size: 14px; line-height: 18px;"&gt;&lt;pre class="lang-c prettyprint" style="background-attachment: initial; background-clip: initial; background-color: #eeeeee; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial; border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; font-family: Consolas, Menlo, Monaco, 'Lucida Console', 'Liberation Mono', 'DejaVu Sans Mono', 'Bitstream Vera Sans Mono', 'Courier New', monospace, serif; font-size: 14px; margin-bottom: 10px; margin-left: 0px; margin-right: 0px; margin-top: 0px; max-height: 600px; overflow-x: auto; overflow-y: auto; padding-bottom: 5px; padding-left: 5px; padding-right: 5px; padding-top: 5px; vertical-align: baseline; width: auto; word-wrap: normal;"&gt;&lt;code style="background-attachment: initial; background-clip: initial; background-color: #eeeeee; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial; border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; font-family: Consolas, Menlo, Monaco, 'Lucida Console', 'Liberation Mono', 'DejaVu Sans Mono', 'Bitstream Vera Sans Mono', 'Courier New', monospace, serif; font-size: 14px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;"&gt;&lt;span class="pun" style="background-attachment: initial; background-clip: initial; background-color: transparent; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial; border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; color: black; font-size: 14px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;"&gt;-&lt;/span&gt;&lt;span class="pln" style="background-attachment: initial; background-clip: initial; background-color: transparent; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial; border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; color: black; font-size: 14px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;"&gt; &lt;/span&gt;&lt;span class="pun" style="background-attachment: initial; background-clip: initial; background-color: transparent; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial; border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; color: black; font-size: 14px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;"&gt;(&lt;/span&gt;&lt;span class="kwd" style="background-attachment: initial; background-clip: initial; background-color: transparent; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial; border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; color: darkblue; font-size: 14px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;"&gt;void&lt;/span&gt;&lt;span class="pun" style="background-attachment: initial; background-clip: initial; background-color: transparent; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial; border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; color: black; font-size: 14px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;"&gt;)&lt;/span&gt;&lt;span class="pln" style="background-attachment: initial; background-clip: initial; background-color: transparent; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial; border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; color: black; font-size: 14px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;"&gt;setString&lt;/span&gt;&lt;span class="pun" style="background-attachment: initial; background-clip: initial; background-color: transparent; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial; border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; color: black; font-size: 14px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;"&gt;:(&lt;/span&gt;&lt;span class="typ" style="background-attachment: initial; background-clip: initial; background-color: transparent; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial; border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; color: #2b91af; font-size: 14px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;"&gt;NSString&lt;/span&gt;&lt;span class="pun" style="background-attachment: initial; background-clip: initial; background-color: transparent; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial; border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; color: black; font-size: 14px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;"&gt;*)&lt;/span&gt;&lt;span class="pln" style="background-attachment: initial; background-clip: initial; background-color: transparent; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial; border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; color: black; font-size: 14px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;"&gt;newString&lt;/span&gt;&lt;span class="pun" style="background-attachment: initial; background-clip: initial; background-color: transparent; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial; border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; color: black; font-size: 14px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;"&gt;{&lt;/span&gt;&lt;span class="pln" style="background-attachment: initial; background-clip: initial; background-color: transparent; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial; border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; color: black; font-size: 14px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;"&gt;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span class="kwd" style="background-attachment: initial; background-clip: initial; background-color: transparent; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial; border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; color: darkblue; font-size: 14px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;"&gt;if&lt;/span&gt;&lt;span class="pun" style="background-attachment: initial; background-clip: initial; background-color: transparent; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial; border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; color: black; font-size: 14px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;"&gt;(&lt;/span&gt;&lt;span class="pln" style="background-attachment: initial; background-clip: initial; background-color: transparent; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial; border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; color: black; font-size: 14px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;"&gt;string&lt;/span&gt;&lt;span class="pun" style="background-attachment: initial; background-clip: initial; background-color: transparent; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial; border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; color: black; font-size: 14px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;"&gt;!=&lt;/span&gt;&lt;span class="pln" style="background-attachment: initial; background-clip: initial; background-color: transparent; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial; border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; color: black; font-size: 14px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;"&gt;newString&lt;/span&gt;&lt;span class="pun" style="background-attachment: initial; background-clip: initial; background-color: transparent; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial; border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; color: black; font-size: 14px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;"&gt;)&lt;/span&gt;&lt;span class="pln" style="background-attachment: initial; background-clip: initial; background-color: transparent; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial; border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; color: black; font-size: 14px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;"&gt;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span class="pun" style="background-attachment: initial; background-clip: initial; background-color: transparent; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial; border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; color: black; font-size: 14px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;"&gt;{&lt;/span&gt;&lt;span class="pln" style="background-attachment: initial; background-clip: initial; background-color: transparent; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial; border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; color: black; font-size: 14px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;"&gt;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span class="pun" style="background-attachment: initial; background-clip: initial; background-color: transparent; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial; border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; color: black; font-size: 14px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;"&gt;[&lt;/span&gt;&lt;span class="pln" style="background-attachment: initial; background-clip: initial; background-color: transparent; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial; border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; color: black; font-size: 14px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;"&gt;string release&lt;/span&gt;&lt;span class="pun" style="background-attachment: initial; background-clip: initial; background-color: transparent; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial; border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; color: black; font-size: 14px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;"&gt;];&lt;/span&gt;&lt;span class="pln" style="background-attachment: initial; background-clip: initial; background-color: transparent; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial; border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; color: black; font-size: 14px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;"&gt;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; string &lt;/span&gt;&lt;span class="pun" style="background-attachment: initial; background-clip: initial; background-color: transparent; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial; border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; color: black; font-size: 14px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;"&gt;=&lt;/span&gt;&lt;span class="pln" style="background-attachment: initial; background-clip: initial; background-color: transparent; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial; border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; color: black; font-size: 14px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;"&gt; &lt;/span&gt;&lt;span class="pun" style="background-attachment: initial; background-clip: initial; background-color: transparent; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial; border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; color: black; font-size: 14px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;"&gt;[&lt;/span&gt;&lt;span class="pln" style="background-attachment: initial; background-clip: initial; background-color: transparent; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial; border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; color: black; font-size: 14px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;"&gt;newString copy&lt;/span&gt;&lt;span class="pun" style="background-attachment: initial; background-clip: initial; background-color: transparent; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial; border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; color: black; font-size: 14px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;"&gt;];&lt;/span&gt;&lt;span class="pln" style="background-attachment: initial; background-clip: initial; background-color: transparent; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial; border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; color: black; font-size: 14px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;"&gt;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span class="pun" style="background-attachment: initial; background-clip: initial; background-color: transparent; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial; border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; color: black; font-size: 14px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;"&gt;}&lt;/span&gt;&lt;span class="pln" style="background-attachment: initial; background-clip: initial; background-color: transparent; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial; border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; color: black; font-size: 14px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span class="pun" style="background-attachment: initial; background-clip: initial; background-color: transparent; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial; border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; color: black; font-size: 14px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;"&gt;}&lt;/span&gt;&lt;span class="pln" style="background-attachment: initial; background-clip: initial; background-color: transparent; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial; border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; color: black; font-size: 14px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;div style="background-attachment: initial; background-clip: initial; background-color: transparent; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial; border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; clear: both; font-size: 14px; margin-bottom: 1em; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline; word-wrap: break-word;"&gt;This is often used with strings, since making a copy of the original object ensures that it is not changed whilst you are using it. In this method your class always own the object no matter what happens to the original object.&amp;nbsp;&lt;/div&gt;&lt;div style="background-attachment: initial; background-clip: initial; background-color: transparent; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial; border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; clear: both; font-size: 14px; margin-bottom: 1em; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline; word-wrap: break-word;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;/span&gt;&lt;br /&gt;&lt;div style="background-attachment: initial; background-clip: initial; background-color: #ffffbf; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial; border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; color: black; direction: ltr; font-family: arial, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; height: auto; line-height: normal; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-align: left; width: auto; z-index: 99995;"&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4996441835700536347-8184903044240511883?l=i-phone-dev.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://i-phone-dev.blogspot.com/feeds/8184903044240511883/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://i-phone-dev.blogspot.com/2011/12/objective-c-property-unleashed.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4996441835700536347/posts/default/8184903044240511883'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4996441835700536347/posts/default/8184903044240511883'/><link rel='alternate' type='text/html' href='http://i-phone-dev.blogspot.com/2011/12/objective-c-property-unleashed.html' title='Objective C - Property unleashed'/><author><name>Anon</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4996441835700536347.post-6332084291382982167</id><published>2011-12-08T06:21:00.001-08:00</published><updated>2011-12-08T06:24:49.739-08:00</updated><title type='text'>UIDatePicker advanced Tutoial</title><content type='html'>Here is an example how we can make a date picker to pick a start and end date:&lt;br /&gt;&lt;br /&gt;&lt;img src="webkit-fake-url://759F3BAB-790E-4234-B5AC-3D7376F4110E/image.tiff" /&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-size: large;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-size: large;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-size: large;"&gt;Header file&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;div style="font: 11.0px Menlo; margin: 0.0px 0.0px 0.0px 0.0px;"&gt;&lt;span style="color: #ba2da2;"&gt;@class&lt;/span&gt; LPStartEndDatePickerController;&lt;/div&gt;&lt;div style="font: 11.0px Menlo; margin: 0.0px 0.0px 0.0px 0.0px; min-height: 13.0px;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="color: #008400; font: 11.0px Menlo; margin: 0.0px 0.0px 0.0px 0.0px;"&gt;//------------------------------------------------------------&lt;/div&gt;&lt;div style="font: 11.0px Menlo; margin: 0.0px 0.0px 0.0px 0.0px;"&gt;&lt;span style="color: #ba2da2;"&gt;@protocol&lt;/span&gt; LPStartEndDatePickerControllerDelegate &amp;lt;NSObject&amp;gt;&lt;/div&gt;&lt;div style="font: 11.0px Menlo; margin: 0.0px 0.0px 0.0px 0.0px; min-height: 13.0px;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="color: #ba2da2; font: 11.0px Menlo; margin: 0.0px 0.0px 0.0px 0.0px;"&gt;@optional&lt;/div&gt;&lt;div style="font: 11.0px Menlo; margin: 0.0px 0.0px 0.0px 0.0px;"&gt;- (&lt;span style="color: #ba2da2;"&gt;void&lt;/span&gt;) datePickerController:(&lt;span style="color: #703daa;"&gt;LPStartEndDatePickerController&lt;/span&gt; *) controller&amp;nbsp;&lt;/div&gt;&lt;div style="font: 11.0px Menlo; margin: 0.0px 0.0px 0.0px 0.0px;"&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt;   &lt;/span&gt; didPickStartDate:(NSDate *)&lt;span style="color: #4f8187;"&gt;startDate&lt;/span&gt; endDate:(NSDate *) endDate;&lt;/div&gt;&lt;div style="color: #ba2da2; font: 11.0px Menlo; margin: 0.0px 0.0px 0.0px 0.0px;"&gt;@end&lt;/div&gt;&lt;div style="font: 11.0px Menlo; margin: 0.0px 0.0px 0.0px 0.0px; min-height: 13.0px;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="color: #008400; font: 11.0px Menlo; margin: 0.0px 0.0px 0.0px 0.0px;"&gt;//------------------------------------------------------------&lt;/div&gt;&lt;div style="font: 11.0px Menlo; margin: 0.0px 0.0px 0.0px 0.0px;"&gt;&lt;span style="color: #ba2da2;"&gt;@interface&lt;/span&gt; LPStartEndDatePickerController : UIViewController&amp;nbsp;&lt;/div&gt;&lt;div style="font: 11.0px Menlo; margin: 0.0px 0.0px 0.0px 0.0px;"&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt;         &lt;/span&gt;&amp;lt;UITableViewDataSource, &lt;span style="color: #703daa;"&gt;UITableViewDelegate&lt;/span&gt;&amp;gt;&lt;/div&gt;&lt;div style="font: 11.0px Menlo; margin: 0.0px 0.0px 0.0px 0.0px;"&gt;{&lt;/div&gt;&lt;div style="color: #703daa; font: 11.0px Menlo; margin: 0.0px 0.0px 0.0px 0.0px;"&gt;&lt;span style="color: black;"&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style="color: #ba2da2;"&gt;id&lt;/span&gt;&lt;span style="color: black;"&gt; &amp;lt;&lt;/span&gt;LPStartEndDatePickerControllerDelegate&lt;span style="color: black;"&gt;&amp;gt; delegate;&lt;/span&gt;&lt;/div&gt;&lt;div style="font: 11.0px Menlo; margin: 0.0px 0.0px 0.0px 0.0px;"&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;&lt;span style="color: #4f8187;"&gt;NSDate&lt;/span&gt; * startDate, * endDate;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;&lt;/div&gt;&lt;div style="font: 11.0px Menlo; margin: 0.0px 0.0px 0.0px 0.0px;"&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;&lt;span style="color: #703daa;"&gt;UIDatePicker&lt;/span&gt; * datePicker;&lt;/div&gt;&lt;div style="font: 11.0px Menlo; margin: 0.0px 0.0px 0.0px 0.0px; min-height: 13.0px;"&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;&lt;/div&gt;&lt;div style="font: 11.0px Menlo; margin: 0.0px 0.0px 0.0px 0.0px;"&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;NSDateFormatter * dateFormatter;&lt;/div&gt;&lt;div style="font: 11.0px Menlo; margin: 0.0px 0.0px 0.0px 0.0px;"&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;&lt;span style="color: #703daa;"&gt;NSString&lt;/span&gt; * startDateLabel, * endDateLabel;&lt;/div&gt;&lt;div style="font: 11.0px Menlo; margin: 0.0px 0.0px 0.0px 0.0px; min-height: 13.0px;"&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;&lt;/div&gt;&lt;div style="color: #ba2da2; font: 11.0px Menlo; margin: 0.0px 0.0px 0.0px 0.0px;"&gt;&lt;span style="color: black;"&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;&lt;/span&gt;@private&lt;/div&gt;&lt;div style="font: 11.0px Menlo; margin: 0.0px 0.0px 0.0px 0.0px;"&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;NSInteger selectedRow;&lt;/div&gt;&lt;div style="font: 11.0px Menlo; margin: 0.0px 0.0px 0.0px 0.0px;"&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;&lt;span style="color: #703daa;"&gt;UITableView&lt;/span&gt; * tableView;&lt;/div&gt;&lt;div style="font: 11.0px Menlo; margin: 0.0px 0.0px 0.0px 0.0px;"&gt;}&lt;/div&gt;&lt;div style="font: 11.0px Menlo; margin: 0.0px 0.0px 0.0px 0.0px; min-height: 13.0px;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="font: 11.0px Menlo; margin: 0.0px 0.0px 0.0px 0.0px;"&gt;&lt;span style="color: #ba2da2;"&gt;@property&lt;/span&gt; (&lt;span style="color: #ba2da2;"&gt;assign&lt;/span&gt;) &lt;span style="color: #ba2da2;"&gt;id&lt;/span&gt; &amp;lt;LPStartEndDatePickerControllerDelegate&amp;gt; delegate;&lt;/div&gt;&lt;div style="font: 11.0px Menlo; margin: 0.0px 0.0px 0.0px 0.0px; min-height: 13.0px;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="font: 11.0px Menlo; margin: 0.0px 0.0px 0.0px 0.0px;"&gt;&lt;span style="color: #ba2da2;"&gt;@property&lt;/span&gt; (&lt;span style="color: #ba2da2;"&gt;nonatomic&lt;/span&gt;, &lt;span style="color: #ba2da2;"&gt;retain&lt;/span&gt;) NSDateFormatter * dateFormatter; &amp;nbsp; &amp;nbsp;&lt;/div&gt;&lt;div style="font: 11.0px Menlo; margin: 0.0px 0.0px 0.0px 0.0px;"&gt;&lt;span style="color: #ba2da2;"&gt;@property&lt;/span&gt; (&lt;span style="color: #ba2da2;"&gt;nonatomic&lt;/span&gt;, &lt;span style="color: #ba2da2;"&gt;retain&lt;/span&gt;) &lt;span style="color: #703daa;"&gt;NSDate&lt;/span&gt; * startDate, * endDate;&lt;/div&gt;&lt;div style="font: 11.0px Menlo; margin: 0.0px 0.0px 0.0px 0.0px; min-height: 13.0px;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="font: 11.0px Menlo; margin: 0.0px 0.0px 0.0px 0.0px;"&gt;&lt;span style="color: #ba2da2;"&gt;@property&lt;/span&gt; (&lt;span style="color: #ba2da2;"&gt;nonatomic&lt;/span&gt;, &lt;span style="color: #ba2da2;"&gt;retain&lt;/span&gt;) NSString * startDateLabel, * endDateLabel;&lt;/div&gt;&lt;div style="color: #ba2da2; font: 11.0px Menlo; margin: 0.0px 0.0px 0.0px 0.0px;"&gt;@property&lt;span style="color: black;"&gt; (&lt;/span&gt;nonatomic&lt;span style="color: black;"&gt;, &lt;/span&gt;retain&lt;span style="color: black;"&gt;) &lt;/span&gt;&lt;span style="color: #703daa;"&gt;UIDatePicker&lt;/span&gt;&lt;span style="color: black;"&gt; * datePicker;&lt;/span&gt;&lt;/div&gt;&lt;div style="font: 11.0px Menlo; margin: 0.0px 0.0px 0.0px 0.0px; min-height: 13.0px;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="font: 11.0px Menlo; margin: 0.0px 0.0px 0.0px 0.0px; min-height: 13.0px;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="color: #ba2da2; font: 11.0px Menlo; margin: 0.0px 0.0px 0.0px 0.0px;"&gt;@end&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-size: large;"&gt;Source code&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;div style="color: #008400; font: 11.0px Menlo; margin: 0.0px 0.0px 0.0px 0.0px;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="font: 11.0px Menlo; margin: 0.0px 0.0px 0.0px 0.0px; min-height: 13.0px;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="color: #d12e1b; font: 11.0px Menlo; margin: 0.0px 0.0px 0.0px 0.0px;"&gt;&lt;span style="color: #78492a;"&gt;#import &lt;/span&gt;"LPStartEndDatePickerController.h"&lt;/div&gt;&lt;div style="font: 11.0px Menlo; margin: 0.0px 0.0px 0.0px 0.0px; min-height: 13.0px;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="color: #008400; font: 11.0px Menlo; margin: 0.0px 0.0px 0.0px 0.0px;"&gt;//--------------------------------------------------------------------------&lt;/div&gt;&lt;div style="color: #4f8187; font: 11.0px Menlo; margin: 0.0px 0.0px 0.0px 0.0px;"&gt;&lt;span style="color: #ba2da2;"&gt;@interface&lt;/span&gt;&lt;span style="color: black;"&gt; &lt;/span&gt;LPStartEndDatePickerController&lt;span style="color: black;"&gt; ()&amp;nbsp;&lt;/span&gt;&lt;/div&gt;&lt;div style="font: 11.0px Menlo; margin: 0.0px 0.0px 0.0px 0.0px; min-height: 13.0px;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="font: 11.0px Menlo; margin: 0.0px 0.0px 0.0px 0.0px;"&gt;&lt;span style="color: #ba2da2;"&gt;@property&lt;/span&gt; &lt;span style="color: #703daa;"&gt;NSInteger&lt;/span&gt; selectedRow;&lt;/div&gt;&lt;div style="color: #ba2da2; font: 11.0px Menlo; margin: 0.0px 0.0px 0.0px 0.0px;"&gt;@property&lt;span style="color: black;"&gt; (&lt;/span&gt;nonatomic&lt;span style="color: black;"&gt;, &lt;/span&gt;retain&lt;span style="color: black;"&gt;) &lt;/span&gt;&lt;span style="color: #703daa;"&gt;UITableView&lt;/span&gt;&lt;span style="color: black;"&gt; * tableView;&lt;/span&gt;&lt;/div&gt;&lt;div style="font: 11.0px Menlo; margin: 0.0px 0.0px 0.0px 0.0px; min-height: 13.0px;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="color: #ba2da2; font: 11.0px Menlo; margin: 0.0px 0.0px 0.0px 0.0px;"&gt;@end&lt;/div&gt;&lt;div style="color: #008400; font: 11.0px Menlo; margin: 0.0px 0.0px 0.0px 0.0px;"&gt;//--------------------------------------------------------------------------&lt;/div&gt;&lt;div style="font: 11.0px Menlo; margin: 0.0px 0.0px 0.0px 0.0px; min-height: 13.0px;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="font: 11.0px Menlo; margin: 0.0px 0.0px 0.0px 0.0px;"&gt;&lt;span style="color: #ba2da2;"&gt;@implementation&lt;/span&gt; LPStartEndDatePickerController&lt;/div&gt;&lt;div style="font: 11.0px Menlo; margin: 0.0px 0.0px 0.0px 0.0px; min-height: 13.0px;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="font: 11.0px Menlo; margin: 0.0px 0.0px 0.0px 0.0px;"&gt;&lt;span style="color: #ba2da2;"&gt;@synthesize&lt;/span&gt; dateFormatter;&lt;/div&gt;&lt;div style="font: 11.0px Menlo; margin: 0.0px 0.0px 0.0px 0.0px;"&gt;&lt;span style="color: #ba2da2;"&gt;@synthesize&lt;/span&gt; startDate, endDate;&lt;/div&gt;&lt;div style="font: 11.0px Menlo; margin: 0.0px 0.0px 0.0px 0.0px; min-height: 13.0px;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="font: 11.0px Menlo; margin: 0.0px 0.0px 0.0px 0.0px;"&gt;&lt;span style="color: #ba2da2;"&gt;@synthesize&lt;/span&gt; startDateLabel, endDateLabel;&lt;/div&gt;&lt;div style="font: 11.0px Menlo; margin: 0.0px 0.0px 0.0px 0.0px;"&gt;&lt;span style="color: #ba2da2;"&gt;@synthesize&lt;/span&gt; datePicker;&lt;/div&gt;&lt;div style="font: 11.0px Menlo; margin: 0.0px 0.0px 0.0px 0.0px; min-height: 13.0px;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="color: #ba2da2; font: 11.0px Menlo; margin: 0.0px 0.0px 0.0px 0.0px;"&gt;@synthesize&lt;span style="color: black;"&gt; delegate;&lt;/span&gt;&lt;/div&gt;&lt;div style="font: 11.0px Menlo; margin: 0.0px 0.0px 0.0px 0.0px;"&gt;&lt;span style="color: #ba2da2;"&gt;@synthesize&lt;/span&gt; selectedRow;&lt;/div&gt;&lt;div style="font: 11.0px Menlo; margin: 0.0px 0.0px 0.0px 0.0px;"&gt;&lt;span style="color: #ba2da2;"&gt;@synthesize&lt;/span&gt; tableView;&lt;/div&gt;&lt;div style="font: 11.0px Menlo; margin: 0.0px 0.0px 0.0px 0.0px; min-height: 13.0px;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="font: 11.0px Menlo; margin: 0.0px 0.0px 0.0px 0.0px;"&gt;- (&lt;span style="color: #ba2da2;"&gt;id&lt;/span&gt;)initWithNibName:(&lt;span style="color: #703daa;"&gt;NSString&lt;/span&gt; *)nibNameOrNil bundle:(&lt;span style="color: #703daa;"&gt;NSBundle&lt;/span&gt; *)nibBundleOrNil&lt;/div&gt;&lt;div style="font: 11.0px Menlo; margin: 0.0px 0.0px 0.0px 0.0px;"&gt;{&lt;/div&gt;&lt;div style="font: 11.0px Menlo; margin: 0.0px 0.0px 0.0px 0.0px;"&gt;&amp;nbsp; &amp;nbsp; &lt;span style="color: #ba2da2;"&gt;self&lt;/span&gt; = [&lt;span style="color: #ba2da2;"&gt;super&lt;/span&gt; &lt;span style="color: #3d1e81;"&gt;initWithNibName&lt;/span&gt;:nibNameOrNil &lt;span style="color: #3d1e81;"&gt;bundle&lt;/span&gt;:nibBundleOrNil];&lt;/div&gt;&lt;div style="font: 11.0px Menlo; margin: 0.0px 0.0px 0.0px 0.0px;"&gt;&amp;nbsp; &amp;nbsp; &lt;span style="color: #ba2da2;"&gt;if&lt;/span&gt; (&lt;span style="color: #ba2da2;"&gt;self&lt;/span&gt;) {&lt;/div&gt;&lt;div style="color: #008400; font: 11.0px Menlo; margin: 0.0px 0.0px 0.0px 0.0px;"&gt;&lt;span style="color: black;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;// Custom initialization&lt;/div&gt;&lt;div style="font: 11.0px Menlo; margin: 0.0px 0.0px 0.0px 0.0px;"&gt;&amp;nbsp; &amp;nbsp; }&lt;/div&gt;&lt;div style="color: #ba2da2; font: 11.0px Menlo; margin: 0.0px 0.0px 0.0px 0.0px;"&gt;&lt;span style="color: black;"&gt;&amp;nbsp; &amp;nbsp; &lt;/span&gt;return&lt;span style="color: black;"&gt; &lt;/span&gt;self&lt;span style="color: black;"&gt;;&lt;/span&gt;&lt;/div&gt;&lt;div style="font: 11.0px Menlo; margin: 0.0px 0.0px 0.0px 0.0px;"&gt;}&lt;/div&gt;&lt;div style="font: 11.0px Menlo; margin: 0.0px 0.0px 0.0px 0.0px; min-height: 13.0px;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="font: 11.0px Menlo; margin: 0.0px 0.0px 0.0px 0.0px;"&gt;- (&lt;span style="color: #ba2da2;"&gt;void&lt;/span&gt;)dealloc&lt;/div&gt;&lt;div style="font: 11.0px Menlo; margin: 0.0px 0.0px 0.0px 0.0px;"&gt;{&lt;/div&gt;&lt;div style="color: #4f8187; font: 11.0px Menlo; margin: 0.0px 0.0px 0.0px 0.0px;"&gt;&lt;span style="color: black;"&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;[&lt;/span&gt;startDate&lt;span style="color: black;"&gt; &lt;/span&gt;&lt;span style="color: #3d1e81;"&gt;release&lt;/span&gt;&lt;span style="color: black;"&gt;];&lt;/span&gt;&lt;/div&gt;&lt;div style="color: #4f8187; font: 11.0px Menlo; margin: 0.0px 0.0px 0.0px 0.0px;"&gt;&lt;span style="color: black;"&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;[&lt;/span&gt;endDate&lt;span style="color: black;"&gt; &lt;/span&gt;&lt;span style="color: #3d1e81;"&gt;release&lt;/span&gt;&lt;span style="color: black;"&gt;];&lt;/span&gt;&lt;/div&gt;&lt;div style="color: #4f8187; font: 11.0px Menlo; margin: 0.0px 0.0px 0.0px 0.0px;"&gt;&lt;span style="color: black;"&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;[&lt;/span&gt;dateFormatter&lt;span style="color: black;"&gt; &lt;/span&gt;&lt;span style="color: #3d1e81;"&gt;release&lt;/span&gt;&lt;span style="color: black;"&gt;];&lt;/span&gt;&lt;/div&gt;&lt;div style="font: 11.0px Menlo; margin: 0.0px 0.0px 0.0px 0.0px; min-height: 13.0px;"&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;&lt;/div&gt;&lt;div style="color: #4f8187; font: 11.0px Menlo; margin: 0.0px 0.0px 0.0px 0.0px;"&gt;&lt;span style="color: black;"&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;[&lt;/span&gt;datePicker&lt;span style="color: black;"&gt; &lt;/span&gt;&lt;span style="color: #3d1e81;"&gt;release&lt;/span&gt;&lt;span style="color: black;"&gt;];&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style="color: #4f8187; font: 11.0px Menlo; margin: 0.0px 0.0px 0.0px 0.0px;"&gt;&lt;span style="color: black;"&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;[&lt;/span&gt;startDateLabel&lt;span style="color: black;"&gt; &lt;/span&gt;&lt;span style="color: #3d1e81;"&gt;release&lt;/span&gt;&lt;span style="color: black;"&gt;];&lt;/span&gt;&lt;/div&gt;&lt;div style="color: #4f8187; font: 11.0px Menlo; margin: 0.0px 0.0px 0.0px 0.0px;"&gt;&lt;span style="color: black;"&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;[&lt;/span&gt;endDateLabel&lt;span style="color: black;"&gt; &lt;/span&gt;&lt;span style="color: #3d1e81;"&gt;release&lt;/span&gt;&lt;span style="color: black;"&gt;];&lt;/span&gt;&lt;/div&gt;&lt;div style="color: #4f8187; font: 11.0px Menlo; margin: 0.0px 0.0px 0.0px 0.0px;"&gt;&lt;span style="color: black;"&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;[&lt;/span&gt;tableView&lt;span style="color: black;"&gt; &lt;/span&gt;&lt;span style="color: #3d1e81;"&gt;release&lt;/span&gt;&lt;span style="color: black;"&gt;];&lt;/span&gt;&lt;/div&gt;&lt;div style="font: 11.0px Menlo; margin: 0.0px 0.0px 0.0px 0.0px; min-height: 13.0px;"&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;&lt;/div&gt;&lt;div style="font: 11.0px Menlo; margin: 0.0px 0.0px 0.0px 0.0px;"&gt;&amp;nbsp; &amp;nbsp; [&lt;span style="color: #ba2da2;"&gt;super&lt;/span&gt; &lt;span style="color: #3d1e81;"&gt;dealloc&lt;/span&gt;];&lt;/div&gt;&lt;div style="font: 11.0px Menlo; margin: 0.0px 0.0px 0.0px 0.0px;"&gt;}&lt;/div&gt;&lt;div style="font: 11.0px Menlo; margin: 0.0px 0.0px 0.0px 0.0px; min-height: 13.0px;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="font: 11.0px Menlo; margin: 0.0px 0.0px 0.0px 0.0px;"&gt;- (&lt;span style="color: #ba2da2;"&gt;void&lt;/span&gt;)didReceiveMemoryWarning&lt;/div&gt;&lt;div style="font: 11.0px Menlo; margin: 0.0px 0.0px 0.0px 0.0px;"&gt;{&lt;/div&gt;&lt;div style="color: #3d1e81; font: 11.0px Menlo; margin: 0.0px 0.0px 0.0px 0.0px;"&gt;&lt;span style="color: black;"&gt;&amp;nbsp; &amp;nbsp; [&lt;/span&gt;&lt;span style="color: #ba2da2;"&gt;super&lt;/span&gt;&lt;span style="color: black;"&gt; &lt;/span&gt;didReceiveMemoryWarning&lt;span style="color: black;"&gt;];&lt;/span&gt;&lt;/div&gt;&lt;div style="font: 11.0px Menlo; margin: 0.0px 0.0px 0.0px 0.0px;"&gt;}&lt;/div&gt;&lt;div style="font: 11.0px Menlo; margin: 0.0px 0.0px 0.0px 0.0px; min-height: 13.0px;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="color: #78492a; font: 11.0px Menlo; margin: 0.0px 0.0px 0.0px 0.0px;"&gt;#pragma mark - View lifecycle&lt;/div&gt;&lt;div style="font: 11.0px Menlo; margin: 0.0px 0.0px 0.0px 0.0px; min-height: 13.0px;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="font: 11.0px Menlo; margin: 0.0px 0.0px 0.0px 0.0px;"&gt;- (&lt;span style="color: #ba2da2;"&gt;void&lt;/span&gt;) loadView {&lt;/div&gt;&lt;div style="color: #3d1e81; font: 11.0px Menlo; margin: 0.0px 0.0px 0.0px 0.0px;"&gt;&lt;span style="color: black;"&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style="color: #703daa;"&gt;CGFloat&lt;/span&gt;&lt;span style="color: black;"&gt; height = [[&lt;/span&gt;&lt;span style="color: #703daa;"&gt;UIScreen&lt;/span&gt;&lt;span style="color: black;"&gt; &lt;/span&gt;mainScreen&lt;span style="color: black;"&gt;] &lt;/span&gt;applicationFrame&lt;span style="color: black;"&gt;].&lt;/span&gt;&lt;span style="color: #703daa;"&gt;size&lt;/span&gt;&lt;span style="color: black;"&gt;.&lt;/span&gt;&lt;span style="color: #703daa;"&gt;height&lt;/span&gt;&lt;span style="color: black;"&gt;&amp;nbsp;&lt;/span&gt;&lt;/div&gt;&lt;div style="color: #008400; font: 11.0px Menlo; margin: 0.0px 0.0px 0.0px 0.0px;"&gt;//&lt;span class="Apple-tab-span" style="white-space: pre;"&gt;      &lt;/span&gt;- [UIApplication sharedApplication].statusBarFrame.size.height&lt;/div&gt;&lt;div style="color: #703daa; font: 11.0px Menlo; margin: 0.0px 0.0px 0.0px 0.0px;"&gt;&lt;span style="color: black;"&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt;      &lt;/span&gt;- &lt;/span&gt;&lt;span style="color: #ba2da2;"&gt;self&lt;/span&gt;&lt;span style="color: black;"&gt;.&lt;/span&gt;navigationController&lt;span style="color: black;"&gt;.&lt;/span&gt;navigationBar&lt;span style="color: black;"&gt;.&lt;/span&gt;frame&lt;span style="color: black;"&gt;.&lt;/span&gt;size&lt;span style="color: black;"&gt;.&lt;/span&gt;height&lt;span style="color: black;"&gt;;&lt;/span&gt;&lt;/div&gt;&lt;div style="color: #3d1e81; font: 11.0px Menlo; margin: 0.0px 0.0px 0.0px 0.0px;"&gt;&lt;span style="color: black;"&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style="color: #703daa;"&gt;CGFloat&lt;/span&gt;&lt;span style="color: black;"&gt; width = [[&lt;/span&gt;&lt;span style="color: #703daa;"&gt;UIScreen&lt;/span&gt;&lt;span style="color: black;"&gt; &lt;/span&gt;mainScreen&lt;span style="color: black;"&gt;] &lt;/span&gt;applicationFrame&lt;span style="color: black;"&gt;].&lt;/span&gt;&lt;span style="color: #703daa;"&gt;size&lt;/span&gt;&lt;span style="color: black;"&gt;.&lt;/span&gt;&lt;span style="color: #703daa;"&gt;width&lt;/span&gt;&lt;span style="color: black;"&gt;;&lt;/span&gt;&lt;/div&gt;&lt;div style="font: 11.0px Menlo; margin: 0.0px 0.0px 0.0px 0.0px; min-height: 13.0px;"&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;&lt;/div&gt;&lt;div style="color: #3d1e81; font: 11.0px Menlo; margin: 0.0px 0.0px 0.0px 0.0px;"&gt;&lt;span style="color: black;"&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style="color: #ba2da2;"&gt;self&lt;/span&gt;&lt;span style="color: black;"&gt;.&lt;/span&gt;&lt;span style="color: #703daa;"&gt;view&lt;/span&gt;&lt;span style="color: black;"&gt; = [[[&lt;/span&gt;&lt;span style="color: #703daa;"&gt;UIView&lt;/span&gt;&lt;span style="color: black;"&gt; &lt;/span&gt;alloc&lt;span style="color: black;"&gt;] &lt;/span&gt;initWithFrame&lt;span style="color: black;"&gt;:&lt;/span&gt;CGRectMake&lt;span style="color: black;"&gt;(&lt;/span&gt;&lt;span style="color: #252bd8;"&gt;0&lt;/span&gt;&lt;span style="color: black;"&gt;, &lt;/span&gt;&lt;span style="color: #252bd8;"&gt;0&lt;/span&gt;&lt;span style="color: black;"&gt;, width, height)] &lt;/span&gt;autorelease&lt;span style="color: black;"&gt;];&lt;/span&gt;&lt;/div&gt;&lt;div style="color: #3d1e81; font: 11.0px Menlo; margin: 0.0px 0.0px 0.0px 0.0px;"&gt;&lt;span style="color: black;"&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style="color: #ba2da2;"&gt;self&lt;/span&gt;&lt;span style="color: black;"&gt;.&lt;/span&gt;&lt;span style="color: #703daa;"&gt;view&lt;/span&gt;&lt;span style="color: black;"&gt;.&lt;/span&gt;&lt;span style="color: #703daa;"&gt;autoresizingMask&lt;/span&gt;&lt;span style="color: black;"&gt; = &lt;/span&gt;UIViewAutoresizingFlexibleWidth&lt;span style="color: black;"&gt; | &lt;/span&gt;UIViewAutoresizingFlexibleHeight&lt;span style="color: black;"&gt;;&lt;/span&gt;&lt;/div&gt;&lt;div style="color: #703daa; font: 11.0px Menlo; margin: 0.0px 0.0px 0.0px 0.0px;"&gt;&lt;span style="color: black;"&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style="color: #ba2da2;"&gt;self&lt;/span&gt;&lt;span style="color: black;"&gt;.&lt;/span&gt;view&lt;span style="color: black;"&gt;.&lt;/span&gt;autoresizesSubviews&lt;span style="color: black;"&gt; = &lt;/span&gt;&lt;span style="color: #ba2da2;"&gt;YES&lt;/span&gt;&lt;span style="color: black;"&gt;;&lt;/span&gt;&lt;/div&gt;&lt;div style="color: #3d1e81; font: 11.0px Menlo; margin: 0.0px 0.0px 0.0px 0.0px;"&gt;&lt;span style="color: black;"&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style="color: #ba2da2;"&gt;self&lt;/span&gt;&lt;span style="color: black;"&gt;.&lt;/span&gt;&lt;span style="color: #703daa;"&gt;view&lt;/span&gt;&lt;span style="color: black;"&gt;.&lt;/span&gt;&lt;span style="color: #703daa;"&gt;backgroundColor&lt;/span&gt;&lt;span style="color: black;"&gt; = [&lt;/span&gt;&lt;span style="color: #703daa;"&gt;UIColor&lt;/span&gt;&lt;span style="color: black;"&gt; &lt;/span&gt;groupTableViewBackgroundColor&lt;span style="color: black;"&gt;];&lt;/span&gt;&lt;/div&gt;&lt;div style="font: 11.0px Menlo; margin: 0.0px 0.0px 0.0px 0.0px; min-height: 13.0px;"&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;&lt;/div&gt;&lt;div style="font: 11.0px Menlo; margin: 0.0px 0.0px 0.0px 0.0px; min-height: 13.0px;"&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;&lt;/div&gt;&lt;div style="color: #3d1e81; font: 11.0px Menlo; margin: 0.0px 0.0px 0.0px 0.0px;"&gt;&lt;span style="color: black;"&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style="color: #703daa;"&gt;UIBarButtonItem&lt;/span&gt;&lt;span style="color: black;"&gt; * doneButton = [[&lt;/span&gt;&lt;span style="color: #703daa;"&gt;UIBarButtonItem&lt;/span&gt;&lt;span style="color: black;"&gt; &lt;/span&gt;alloc&lt;span style="color: black;"&gt;] &lt;/span&gt;initWithBarButtonSystemItem&lt;span style="color: black;"&gt;:&lt;/span&gt;UIBarButtonSystemItemDone&lt;/div&gt;&lt;div style="font: 11.0px Menlo; margin: 0.0px 0.0px 0.0px 0.0px;"&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt;               &lt;/span&gt;&lt;span style="color: #3d1e81;"&gt;target&lt;/span&gt;:&lt;span style="color: #ba2da2;"&gt;self&lt;/span&gt;&amp;nbsp;&lt;/div&gt;&lt;div style="font: 11.0px Menlo; margin: 0.0px 0.0px 0.0px 0.0px;"&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt;               &lt;/span&gt;&lt;span style="color: #3d1e81;"&gt;action&lt;/span&gt;: &lt;span style="color: #ba2da2;"&gt;@selector&lt;/span&gt;(didPressDoneButton)];&lt;/div&gt;&lt;div style="color: #703daa; font: 11.0px Menlo; margin: 0.0px 0.0px 0.0px 0.0px;"&gt;&lt;span style="color: black;"&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style="color: #ba2da2;"&gt;self&lt;/span&gt;&lt;span style="color: black;"&gt;.&lt;/span&gt;navigationItem&lt;span style="color: black;"&gt;.&lt;/span&gt;rightBarButtonItem&lt;span style="color: black;"&gt; = doneButton;&lt;/span&gt;&lt;/div&gt;&lt;div style="font: 11.0px Menlo; margin: 0.0px 0.0px 0.0px 0.0px;"&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;[doneButton &lt;span style="color: #3d1e81;"&gt;release&lt;/span&gt;];&lt;/div&gt;&lt;div style="font: 11.0px Menlo; margin: 0.0px 0.0px 0.0px 0.0px; min-height: 13.0px;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="color: #3d1e81; font: 11.0px Menlo; margin: 0.0px 0.0px 0.0px 0.0px;"&gt;&lt;span style="color: black;"&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style="color: #703daa;"&gt;UIBarButtonItem&lt;/span&gt;&lt;span style="color: black;"&gt; * cancelButton = [[&lt;/span&gt;&lt;span style="color: #703daa;"&gt;UIBarButtonItem&lt;/span&gt;&lt;span style="color: black;"&gt; &lt;/span&gt;alloc&lt;span style="color: black;"&gt;] &lt;/span&gt;initWithBarButtonSystemItem&lt;span style="color: black;"&gt;:&lt;/span&gt;UIBarButtonSystemItemCancel&lt;/div&gt;&lt;div style="font: 11.0px Menlo; margin: 0.0px 0.0px 0.0px 0.0px;"&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt;                    &lt;/span&gt; &lt;span style="color: #3d1e81;"&gt;target&lt;/span&gt;:&lt;span style="color: #ba2da2;"&gt;self&lt;/span&gt;&amp;nbsp;&lt;/div&gt;&lt;div style="font: 11.0px Menlo; margin: 0.0px 0.0px 0.0px 0.0px;"&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt;                    &lt;/span&gt; &lt;span style="color: #3d1e81;"&gt;action&lt;/span&gt;: &lt;span style="color: #ba2da2;"&gt;@selector&lt;/span&gt;(didPressCancelButton)];&lt;/div&gt;&lt;div style="color: #703daa; font: 11.0px Menlo; margin: 0.0px 0.0px 0.0px 0.0px;"&gt;&lt;span style="color: black;"&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style="color: #ba2da2;"&gt;self&lt;/span&gt;&lt;span style="color: black;"&gt;.&lt;/span&gt;navigationItem&lt;span style="color: black;"&gt;.&lt;/span&gt;leftBarButtonItem&lt;span style="color: black;"&gt; = cancelButton;&lt;/span&gt;&lt;/div&gt;&lt;div style="font: 11.0px Menlo; margin: 0.0px 0.0px 0.0px 0.0px;"&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;[cancelButton &lt;span style="color: #3d1e81;"&gt;release&lt;/span&gt;];&lt;/div&gt;&lt;div style="font: 11.0px Menlo; margin: 0.0px 0.0px 0.0px 0.0px; min-height: 13.0px;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="font: 11.0px Menlo; margin: 0.0px 0.0px 0.0px 0.0px;"&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;&lt;span style="color: #ba2da2;"&gt;if&lt;/span&gt; (&lt;span style="color: #ba2da2;"&gt;self&lt;/span&gt;.&lt;span style="color: #703daa;"&gt;title&lt;/span&gt; == &lt;span style="color: #ba2da2;"&gt;nil&lt;/span&gt;) {&lt;/div&gt;&lt;div style="color: #d12e1b; font: 11.0px Menlo; margin: 0.0px 0.0px 0.0px 0.0px;"&gt;&lt;span style="color: black;"&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt;  &lt;/span&gt;&lt;/span&gt;&lt;span style="color: #ba2da2;"&gt;self&lt;/span&gt;&lt;span style="color: black;"&gt;.&lt;/span&gt;&lt;span style="color: #703daa;"&gt;title&lt;/span&gt;&lt;span style="color: black;"&gt; = &lt;/span&gt;&lt;span style="color: #78492a;"&gt;NSLocalizedString&lt;/span&gt;&lt;span style="color: black;"&gt;(&lt;/span&gt;@"Choose dates"&lt;span style="color: black;"&gt;, &lt;/span&gt;@""&lt;span style="color: black;"&gt;);&lt;/span&gt;&lt;/div&gt;&lt;div style="font: 11.0px Menlo; margin: 0.0px 0.0px 0.0px 0.0px;"&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;}&lt;/div&gt;&lt;div style="font: 11.0px Menlo; margin: 0.0px 0.0px 0.0px 0.0px; min-height: 13.0px;"&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;&lt;/div&gt;&lt;div style="color: #4f8187; font: 11.0px Menlo; margin: 0.0px 0.0px 0.0px 0.0px;"&gt;&lt;span style="color: black;"&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style="color: #ba2da2;"&gt;if&lt;/span&gt;&lt;span style="color: black;"&gt; (&lt;/span&gt;&lt;span style="color: #ba2da2;"&gt;self&lt;/span&gt;&lt;span style="color: black;"&gt;.&lt;/span&gt;startDateLabel&lt;span style="color: black;"&gt; == &lt;/span&gt;&lt;span style="color: #ba2da2;"&gt;nil&lt;/span&gt;&lt;span style="color: black;"&gt;) {&lt;/span&gt;&lt;/div&gt;&lt;div style="color: #78492a; font: 11.0px Menlo; margin: 0.0px 0.0px 0.0px 0.0px;"&gt;&lt;span style="color: black;"&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt;  &lt;/span&gt;&lt;/span&gt;&lt;span style="color: #ba2da2;"&gt;self&lt;/span&gt;&lt;span style="color: black;"&gt;.&lt;/span&gt;&lt;span style="color: #4f8187;"&gt;startDateLabel&lt;/span&gt;&lt;span style="color: black;"&gt; = &lt;/span&gt;NSLocalizedString&lt;span style="color: black;"&gt;(&lt;/span&gt;&lt;span style="color: #d12e1b;"&gt;@"Start date:"&lt;/span&gt;&lt;span style="color: black;"&gt;, &lt;/span&gt;&lt;span style="color: #d12e1b;"&gt;@""&lt;/span&gt;&lt;span style="color: black;"&gt;);&lt;/span&gt;&lt;/div&gt;&lt;div style="font: 11.0px Menlo; margin: 0.0px 0.0px 0.0px 0.0px;"&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;}&lt;/div&gt;&lt;div style="font: 11.0px Menlo; margin: 0.0px 0.0px 0.0px 0.0px; min-height: 13.0px;"&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;&lt;/div&gt;&lt;div style="color: #4f8187; font: 11.0px Menlo; margin: 0.0px 0.0px 0.0px 0.0px;"&gt;&lt;span style="color: black;"&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style="color: #ba2da2;"&gt;if&lt;/span&gt;&lt;span style="color: black;"&gt; (&lt;/span&gt;&lt;span style="color: #ba2da2;"&gt;self&lt;/span&gt;&lt;span style="color: black;"&gt;.&lt;/span&gt;endDateLabel&lt;span style="color: black;"&gt; == &lt;/span&gt;&lt;span style="color: #ba2da2;"&gt;nil&lt;/span&gt;&lt;span style="color: black;"&gt;) {&lt;/span&gt;&lt;/div&gt;&lt;div style="color: #78492a; font: 11.0px Menlo; margin: 0.0px 0.0px 0.0px 0.0px;"&gt;&lt;span style="color: black;"&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt;  &lt;/span&gt;&lt;/span&gt;&lt;span style="color: #ba2da2;"&gt;self&lt;/span&gt;&lt;span style="color: black;"&gt;.&lt;/span&gt;&lt;span style="color: #4f8187;"&gt;endDateLabel&lt;/span&gt;&lt;span style="color: black;"&gt; = &lt;/span&gt;NSLocalizedString&lt;span style="color: black;"&gt;(&lt;/span&gt;&lt;span style="color: #d12e1b;"&gt;@"End date:"&lt;/span&gt;&lt;span style="color: black;"&gt;, &lt;/span&gt;&lt;span style="color: #d12e1b;"&gt;@""&lt;/span&gt;&lt;span style="color: black;"&gt;);&lt;/span&gt;&lt;/div&gt;&lt;div style="font: 11.0px Menlo; margin: 0.0px 0.0px 0.0px 0.0px;"&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;}&lt;/div&gt;&lt;div style="font: 11.0px Menlo; margin: 0.0px 0.0px 0.0px 0.0px; min-height: 13.0px;"&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;&lt;/div&gt;&lt;div style="font: 11.0px Menlo; margin: 0.0px 0.0px 0.0px 0.0px;"&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;&lt;span style="color: #ba2da2;"&gt;if&lt;/span&gt; (&lt;span style="color: #ba2da2;"&gt;self&lt;/span&gt;.&lt;span style="color: #4f8187;"&gt;datePicker&lt;/span&gt; == &lt;span style="color: #ba2da2;"&gt;nil&lt;/span&gt;) {&lt;/div&gt;&lt;div style="font: 11.0px Menlo; margin: 0.0px 0.0px 0.0px 0.0px;"&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt;  &lt;/span&gt;&lt;span style="color: #ba2da2;"&gt;self&lt;/span&gt;.&lt;span style="color: #4f8187;"&gt;datePicker&lt;/span&gt; = [[&lt;span style="color: #703daa;"&gt;UIDatePicker&lt;/span&gt; &lt;span style="color: #3d1e81;"&gt;alloc&lt;/span&gt;] &lt;span style="color: #3d1e81;"&gt;init&lt;/span&gt;];&lt;/div&gt;&lt;div style="color: #3d1e81; font: 11.0px Menlo; margin: 0.0px 0.0px 0.0px 0.0px;"&gt;&lt;span style="color: black;"&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt;  &lt;/span&gt;&lt;/span&gt;&lt;span style="color: #ba2da2;"&gt;self&lt;/span&gt;&lt;span style="color: black;"&gt;.&lt;/span&gt;&lt;span style="color: #4f8187;"&gt;datePicker&lt;/span&gt;&lt;span style="color: black;"&gt;.&lt;/span&gt;&lt;span style="color: #703daa;"&gt;datePickerMode&lt;/span&gt;&lt;span style="color: black;"&gt; = &lt;/span&gt;UIDatePickerModeDate&lt;span style="color: black;"&gt;;&lt;/span&gt;&lt;/div&gt;&lt;div style="font: 11.0px Menlo; margin: 0.0px 0.0px 0.0px 0.0px;"&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;}&lt;/div&gt;&lt;div style="font: 11.0px Menlo; margin: 0.0px 0.0px 0.0px 0.0px;"&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;[&lt;span style="color: #ba2da2;"&gt;self&lt;/span&gt;.&lt;span style="color: #4f8187;"&gt;datePicker&lt;/span&gt; &lt;span style="color: #3d1e81;"&gt;addTarget&lt;/span&gt;:&lt;span style="color: #ba2da2;"&gt;self&lt;/span&gt; &lt;span style="color: #3d1e81;"&gt;action&lt;/span&gt;:&lt;span style="color: #ba2da2;"&gt;@selector&lt;/span&gt;(dateChanged:)&amp;nbsp;&lt;/div&gt;&lt;div style="color: #3d1e81; font: 11.0px Menlo; margin: 0.0px 0.0px 0.0px 0.0px;"&gt;&lt;span style="color: black;"&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt;   &lt;/span&gt;&amp;nbsp; &lt;/span&gt;forControlEvents&lt;span style="color: black;"&gt;:&lt;/span&gt;UIControlEventValueChanged&lt;span style="color: black;"&gt;];&lt;/span&gt;&lt;/div&gt;&lt;div style="font: 11.0px Menlo; margin: 0.0px 0.0px 0.0px 0.0px; min-height: 13.0px;"&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;&lt;/div&gt;&lt;div style="color: #4f8187; font: 11.0px Menlo; margin: 0.0px 0.0px 0.0px 0.0px;"&gt;&lt;span style="color: black;"&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style="color: #ba2da2;"&gt;if&lt;/span&gt;&lt;span style="color: black;"&gt; (&lt;/span&gt;&lt;span style="color: #ba2da2;"&gt;self&lt;/span&gt;&lt;span style="color: black;"&gt;.&lt;/span&gt;dateFormatter&lt;span style="color: black;"&gt; == &lt;/span&gt;&lt;span style="color: #ba2da2;"&gt;nil&lt;/span&gt;&lt;span style="color: black;"&gt;) {&lt;/span&gt;&lt;/div&gt;&lt;div style="font: 11.0px Menlo; margin: 0.0px 0.0px 0.0px 0.0px;"&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt;  &lt;/span&gt;&lt;span style="color: #703daa;"&gt;NSString&lt;/span&gt; * dateFormatString = [&lt;span style="color: #703daa;"&gt;NSDateFormatter&lt;/span&gt; &lt;span style="color: #3d1e81;"&gt;dateFormatFromTemplate&lt;/span&gt;:&lt;span style="color: #d12e1b;"&gt;@"ddMMyyyy"&lt;/span&gt;&lt;/div&gt;&lt;div style="font: 11.0px Menlo; margin: 0.0px 0.0px 0.0px 0.0px;"&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt;              &lt;/span&gt;&lt;span style="color: #3d1e81;"&gt;options&lt;/span&gt;:&lt;span style="color: #252bd8;"&gt;0&lt;/span&gt;&lt;/div&gt;&lt;div style="font: 11.0px Menlo; margin: 0.0px 0.0px 0.0px 0.0px;"&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt;              &lt;/span&gt;&lt;span style="color: #3d1e81;"&gt;locale&lt;/span&gt;:[&lt;span style="color: #703daa;"&gt;NSLocale&lt;/span&gt; &lt;span style="color: #3d1e81;"&gt;currentLocale&lt;/span&gt;]];&lt;/div&gt;&lt;div style="color: #703daa; font: 11.0px Menlo; margin: 0.0px 0.0px 0.0px 0.0px;"&gt;&lt;span style="color: black;"&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt;  &lt;/span&gt;&lt;/span&gt;&lt;span style="color: #ba2da2;"&gt;self&lt;/span&gt;&lt;span style="color: black;"&gt;.&lt;/span&gt;&lt;span style="color: #4f8187;"&gt;dateFormatter&lt;/span&gt;&lt;span style="color: black;"&gt; = [[&lt;/span&gt;NSDateFormatter&lt;span style="color: black;"&gt; &lt;/span&gt;&lt;span style="color: #3d1e81;"&gt;alloc&lt;/span&gt;&lt;span style="color: black;"&gt;] &lt;/span&gt;&lt;span style="color: #3d1e81;"&gt;init&lt;/span&gt;&lt;span style="color: black;"&gt;];&lt;/span&gt;&lt;/div&gt;&lt;div style="font: 11.0px Menlo; margin: 0.0px 0.0px 0.0px 0.0px;"&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt;  &lt;/span&gt;[&lt;span style="color: #ba2da2;"&gt;self&lt;/span&gt;.&lt;span style="color: #4f8187;"&gt;dateFormatter&lt;/span&gt; &lt;span style="color: #3d1e81;"&gt;setDateFormat&lt;/span&gt;:dateFormatString];&lt;/div&gt;&lt;div style="font: 11.0px Menlo; margin: 0.0px 0.0px 0.0px 0.0px;"&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;}&lt;/div&gt;&lt;div style="font: 11.0px Menlo; margin: 0.0px 0.0px 0.0px 0.0px; min-height: 13.0px;"&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;&lt;/div&gt;&lt;div style="color: #3d1e81; font: 11.0px Menlo; margin: 0.0px 0.0px 0.0px 0.0px;"&gt;&lt;span style="color: black;"&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style="color: #ba2da2;"&gt;self&lt;/span&gt;&lt;span style="color: black;"&gt;.&lt;/span&gt;&lt;span style="color: #4f8187;"&gt;tableView&lt;/span&gt;&lt;span style="color: black;"&gt; = [[&lt;/span&gt;&lt;span style="color: #703daa;"&gt;UITableView&lt;/span&gt;&lt;span style="color: black;"&gt; &lt;/span&gt;alloc&lt;span style="color: black;"&gt;] &lt;/span&gt;initWithFrame&lt;span style="color: black;"&gt;:&lt;/span&gt;CGRectMake&lt;span style="color: black;"&gt;(&lt;/span&gt;&lt;span style="color: #252bd8;"&gt;0&lt;/span&gt;&lt;span style="color: black;"&gt;, &lt;/span&gt;&lt;span style="color: #252bd8;"&gt;0&lt;/span&gt;&lt;span style="color: black;"&gt;,&amp;nbsp;&lt;/span&gt;&lt;/div&gt;&lt;div style="color: #703daa; font: 11.0px Menlo; margin: 0.0px 0.0px 0.0px 0.0px;"&gt;&lt;span style="color: black;"&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt;         &lt;/span&gt;&lt;/span&gt;&lt;span style="color: #ba2da2;"&gt;self&lt;/span&gt;&lt;span style="color: black;"&gt;.&lt;/span&gt;view&lt;span style="color: black;"&gt;.&lt;/span&gt;frame&lt;span style="color: black;"&gt;.&lt;/span&gt;size&lt;span style="color: black;"&gt;.&lt;/span&gt;width&lt;span style="color: black;"&gt;,&amp;nbsp;&lt;/span&gt;&lt;/div&gt;&lt;div style="color: #703daa; font: 11.0px Menlo; margin: 0.0px 0.0px 0.0px 0.0px;"&gt;&lt;span style="color: black;"&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt;         &lt;/span&gt;&lt;/span&gt;&lt;span style="color: #ba2da2;"&gt;self&lt;/span&gt;&lt;span style="color: black;"&gt;.&lt;/span&gt;view&lt;span style="color: black;"&gt;.&lt;/span&gt;frame&lt;span style="color: black;"&gt;.&lt;/span&gt;size&lt;span style="color: black;"&gt;.&lt;/span&gt;height&lt;span style="color: black;"&gt; - &lt;/span&gt;&lt;span style="color: #ba2da2;"&gt;self&lt;/span&gt;&lt;span style="color: black;"&gt;.&lt;/span&gt;&lt;span style="color: #4f8187;"&gt;datePicker&lt;/span&gt;&lt;span style="color: black;"&gt;.&lt;/span&gt;frame&lt;span style="color: black;"&gt;.&lt;/span&gt;size&lt;span style="color: black;"&gt;.&lt;/span&gt;height&lt;span style="color: black;"&gt;)&amp;nbsp;&lt;/span&gt;&lt;/div&gt;&lt;div style="color: #3d1e81; font: 11.0px Menlo; margin: 0.0px 0.0px 0.0px 0.0px;"&gt;&lt;span style="color: black;"&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt;         &lt;/span&gt;&lt;/span&gt;style&lt;span style="color: black;"&gt;:&lt;/span&gt;UITableViewStyleGrouped&lt;span style="color: black;"&gt;];&lt;/span&gt;&lt;/div&gt;&lt;div style="color: #4f8187; font: 11.0px Menlo; margin: 0.0px 0.0px 0.0px 0.0px;"&gt;&lt;span style="color: black;"&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;&lt;/span&gt;tableView&lt;span style="color: black;"&gt;.&lt;/span&gt;&lt;span style="color: #703daa;"&gt;delegate&lt;/span&gt;&lt;span style="color: black;"&gt; = &lt;/span&gt;&lt;span style="color: #ba2da2;"&gt;self&lt;/span&gt;&lt;span style="color: black;"&gt;;&lt;/span&gt;&lt;/div&gt;&lt;div style="color: #703daa; font: 11.0px Menlo; margin: 0.0px 0.0px 0.0px 0.0px;"&gt;&lt;span style="color: black;"&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style="color: #4f8187;"&gt;tableView&lt;/span&gt;&lt;span style="color: black;"&gt;.&lt;/span&gt;dataSource&lt;span style="color: black;"&gt; = &lt;/span&gt;&lt;span style="color: #ba2da2;"&gt;self&lt;/span&gt;&lt;span style="color: black;"&gt;;&lt;/span&gt;&lt;/div&gt;&lt;div style="color: #3d1e81; font: 11.0px Menlo; margin: 0.0px 0.0px 0.0px 0.0px;"&gt;&lt;span style="color: black;"&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;[&lt;/span&gt;&lt;span style="color: #ba2da2;"&gt;self&lt;/span&gt;&lt;span style="color: black;"&gt;.&lt;/span&gt;&lt;span style="color: #703daa;"&gt;view&lt;/span&gt;&lt;span style="color: black;"&gt; &lt;/span&gt;addSubview&lt;span style="color: black;"&gt;:&lt;/span&gt;&lt;span style="color: #4f8187;"&gt;tableView&lt;/span&gt;&lt;span style="color: black;"&gt;];&lt;/span&gt;&lt;/div&gt;&lt;div style="color: #703daa; font: 11.0px Menlo; margin: 0.0px 0.0px 0.0px 0.0px;"&gt;&lt;span style="color: black;"&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style="color: #ba2da2;"&gt;self&lt;/span&gt;&lt;span style="color: black;"&gt;.&lt;/span&gt;&lt;span style="color: #4f8187;"&gt;datePicker&lt;/span&gt;&lt;span style="color: black;"&gt;.&lt;/span&gt;frame&lt;span style="color: black;"&gt; = &lt;/span&gt;&lt;span style="color: #3d1e81;"&gt;CGRectMake&lt;/span&gt;&lt;span style="color: black;"&gt;(&lt;/span&gt;&lt;span style="color: #252bd8;"&gt;0&lt;/span&gt;&lt;span style="color: black;"&gt;, &lt;/span&gt;&lt;span style="color: #4f8187;"&gt;tableView&lt;/span&gt;&lt;span style="color: black;"&gt;.&lt;/span&gt;frame&lt;span style="color: black;"&gt;.&lt;/span&gt;size&lt;span style="color: black;"&gt;.&lt;/span&gt;height&lt;span style="color: black;"&gt;, &lt;/span&gt;&lt;span style="color: #ba2da2;"&gt;self&lt;/span&gt;&lt;span style="color: black;"&gt;.&lt;/span&gt;view&lt;span style="color: black;"&gt;.&lt;/span&gt;frame&lt;span style="color: black;"&gt;.&lt;/span&gt;size&lt;span style="color: black;"&gt;.&lt;/span&gt;width&lt;span style="color: black;"&gt;, &lt;/span&gt;&lt;span style="color: #ba2da2;"&gt;self&lt;/span&gt;&lt;span style="color: black;"&gt;.&lt;/span&gt;&lt;span style="color: #4f8187;"&gt;datePicker&lt;/span&gt;&lt;span style="color: black;"&gt;.&lt;/span&gt;frame&lt;span style="color: black;"&gt;.&lt;/span&gt;size&lt;span style="color: black;"&gt;.&lt;/span&gt;height&lt;span style="color: black;"&gt;);&lt;/span&gt;&lt;/div&gt;&lt;div style="color: #3d1e81; font: 11.0px Menlo; margin: 0.0px 0.0px 0.0px 0.0px;"&gt;&lt;span style="color: black;"&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;[&lt;/span&gt;&lt;span style="color: #ba2da2;"&gt;self&lt;/span&gt;&lt;span style="color: black;"&gt;.&lt;/span&gt;&lt;span style="color: #703daa;"&gt;view&lt;/span&gt;&lt;span style="color: black;"&gt; &lt;/span&gt;addSubview&lt;span style="color: black;"&gt;:&lt;/span&gt;&lt;span style="color: #ba2da2;"&gt;self&lt;/span&gt;&lt;span style="color: black;"&gt;.&lt;/span&gt;&lt;span style="color: #4f8187;"&gt;datePicker&lt;/span&gt;&lt;span style="color: black;"&gt;];&lt;/span&gt;&lt;/div&gt;&lt;div style="font: 11.0px Menlo; margin: 0.0px 0.0px 0.0px 0.0px; min-height: 13.0px;"&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;&lt;/div&gt;&lt;div style="color: #008400; font: 11.0px Menlo; margin: 0.0px 0.0px 0.0px 0.0px;"&gt;&lt;span style="color: black;"&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;&lt;/span&gt;//NSLog(@"app = %@ View = %@, tableView = %@, picker = %@ ",&amp;nbsp; NSStringFromCGRect([[UIScreen mainScreen] applicationFrame]), NSStringFromCGRect(self.view.frame), NSStringFromCGRect(tableView.frame), NSStringFromCGRect(datePicker.frame));&lt;/div&gt;&lt;div style="font: 11.0px Menlo; margin: 0.0px 0.0px 0.0px 0.0px; min-height: 13.0px;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="font: 11.0px Menlo; margin: 0.0px 0.0px 0.0px 0.0px;"&gt;}&lt;/div&gt;&lt;div style="font: 11.0px Menlo; margin: 0.0px 0.0px 0.0px 0.0px; min-height: 13.0px;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="font: 11.0px Menlo; margin: 0.0px 0.0px 0.0px 0.0px; min-height: 13.0px;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="font: 11.0px Menlo; margin: 0.0px 0.0px 0.0px 0.0px;"&gt;- (&lt;span style="color: #ba2da2;"&gt;void&lt;/span&gt;)viewDidLoad&lt;/div&gt;&lt;div style="font: 11.0px Menlo; margin: 0.0px 0.0px 0.0px 0.0px;"&gt;{&lt;/div&gt;&lt;div style="color: #3d1e81; font: 11.0px Menlo; margin: 0.0px 0.0px 0.0px 0.0px;"&gt;&lt;span style="color: black;"&gt;&amp;nbsp; &amp;nbsp; [&lt;/span&gt;&lt;span style="color: #ba2da2;"&gt;super&lt;/span&gt;&lt;span style="color: black;"&gt; &lt;/span&gt;viewDidLoad&lt;span style="color: black;"&gt;];&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style="font: 11.0px Menlo; margin: 0.0px 0.0px 0.0px 0.0px;"&gt;}&lt;/div&gt;&lt;div style="font: 11.0px Menlo; margin: 0.0px 0.0px 0.0px 0.0px; min-height: 13.0px;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="font: 11.0px Menlo; margin: 0.0px 0.0px 0.0px 0.0px; min-height: 13.0px;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="font: 11.0px Menlo; margin: 0.0px 0.0px 0.0px 0.0px;"&gt;- (&lt;span style="color: #ba2da2;"&gt;void&lt;/span&gt;)viewDidUnload&lt;/div&gt;&lt;div style="font: 11.0px Menlo; margin: 0.0px 0.0px 0.0px 0.0px;"&gt;{&lt;/div&gt;&lt;div style="color: #3d1e81; font: 11.0px Menlo; margin: 0.0px 0.0px 0.0px 0.0px;"&gt;&lt;span style="color: black;"&gt;&amp;nbsp; &amp;nbsp; [&lt;/span&gt;&lt;span style="color: #ba2da2;"&gt;super&lt;/span&gt;&lt;span style="color: black;"&gt; &lt;/span&gt;viewDidUnload&lt;span style="color: black;"&gt;];&lt;/span&gt;&lt;/div&gt;&lt;div style="font: 11.0px Menlo; margin: 0.0px 0.0px 0.0px 0.0px;"&gt;}&lt;/div&gt;&lt;div style="font: 11.0px Menlo; margin: 0.0px 0.0px 0.0px 0.0px; min-height: 13.0px;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="font: 11.0px Menlo; margin: 0.0px 0.0px 0.0px 0.0px;"&gt;- (&lt;span style="color: #ba2da2;"&gt;BOOL&lt;/span&gt;)shouldAutorotateToInterfaceOrientation:(&lt;span style="color: #703daa;"&gt;UIInterfaceOrientation&lt;/span&gt;)interfaceOrientation&lt;/div&gt;&lt;div style="font: 11.0px Menlo; margin: 0.0px 0.0px 0.0px 0.0px;"&gt;{&lt;/div&gt;&lt;div style="color: #008400; font: 11.0px Menlo; margin: 0.0px 0.0px 0.0px 0.0px;"&gt;&lt;span style="color: black;"&gt;&amp;nbsp; &amp;nbsp; &lt;/span&gt;// Return YES for supported orientations&lt;/div&gt;&lt;div style="font: 11.0px Menlo; margin: 0.0px 0.0px 0.0px 0.0px;"&gt;&amp;nbsp; &amp;nbsp; &lt;span style="color: #ba2da2;"&gt;return&lt;/span&gt; (interfaceOrientation == &lt;span style="color: #3d1e81;"&gt;UIInterfaceOrientationPortrait&lt;/span&gt;);&lt;/div&gt;&lt;div style="font: 11.0px Menlo; margin: 0.0px 0.0px 0.0px 0.0px;"&gt;}&lt;/div&gt;&lt;div style="font: 11.0px Menlo; margin: 0.0px 0.0px 0.0px 0.0px; min-height: 13.0px;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="font: 11.0px Menlo; margin: 0.0px 0.0px 0.0px 0.0px; min-height: 13.0px;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="color: #78492a; font: 11.0px Menlo; margin: 0.0px 0.0px 0.0px 0.0px;"&gt;#pragma mark - Table view data source&lt;/div&gt;&lt;div style="font: 11.0px Menlo; margin: 0.0px 0.0px 0.0px 0.0px; min-height: 13.0px;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="font: 11.0px Menlo; margin: 0.0px 0.0px 0.0px 0.0px;"&gt;- (&lt;span style="color: #703daa;"&gt;NSInteger&lt;/span&gt;)numberOfSectionsInTableView:(&lt;span style="color: #703daa;"&gt;UITableView&lt;/span&gt; *)tableView&lt;/div&gt;&lt;div style="font: 11.0px Menlo; margin: 0.0px 0.0px 0.0px 0.0px;"&gt;{&lt;/div&gt;&lt;div style="font: 11.0px Menlo; margin: 0.0px 0.0px 0.0px 0.0px;"&gt;&amp;nbsp; &amp;nbsp; &lt;span style="color: #ba2da2;"&gt;return&lt;/span&gt; &lt;span style="color: #252bd8;"&gt;1&lt;/span&gt;;&lt;/div&gt;&lt;div style="font: 11.0px Menlo; margin: 0.0px 0.0px 0.0px 0.0px;"&gt;}&lt;/div&gt;&lt;div style="font: 11.0px Menlo; margin: 0.0px 0.0px 0.0px 0.0px; min-height: 13.0px;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="font: 11.0px Menlo; margin: 0.0px 0.0px 0.0px 0.0px;"&gt;- (&lt;span style="color: #703daa;"&gt;NSInteger&lt;/span&gt;)tableView:(&lt;span style="color: #703daa;"&gt;UITableView&lt;/span&gt; *)tableView numberOfRowsInSection:(&lt;span style="color: #703daa;"&gt;NSInteger&lt;/span&gt;)section&lt;/div&gt;&lt;div style="font: 11.0px Menlo; margin: 0.0px 0.0px 0.0px 0.0px;"&gt;{&lt;/div&gt;&lt;div style="font: 11.0px Menlo; margin: 0.0px 0.0px 0.0px 0.0px;"&gt;&amp;nbsp; &amp;nbsp; &lt;span style="color: #ba2da2;"&gt;return&lt;/span&gt; &lt;span style="color: #252bd8;"&gt;2&lt;/span&gt;;&lt;/div&gt;&lt;div style="font: 11.0px Menlo; margin: 0.0px 0.0px 0.0px 0.0px;"&gt;}&lt;/div&gt;&lt;div style="font: 11.0px Menlo; margin: 0.0px 0.0px 0.0px 0.0px; min-height: 13.0px;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="font: 11.0px Menlo; margin: 0.0px 0.0px 0.0px 0.0px;"&gt;- (&lt;span style="color: #703daa;"&gt;UITableViewCell&lt;/span&gt; *)tableView:(&lt;span style="color: #703daa;"&gt;UITableView&lt;/span&gt; *)tableView cellForRowAtIndexPath:(&lt;span style="color: #703daa;"&gt;NSIndexPath&lt;/span&gt; *)indexPath&lt;/div&gt;&lt;div style="font: 11.0px Menlo; margin: 0.0px 0.0px 0.0px 0.0px;"&gt;{&lt;/div&gt;&lt;div style="font: 11.0px Menlo; margin: 0.0px 0.0px 0.0px 0.0px;"&gt;&amp;nbsp; &amp;nbsp; &lt;span style="color: #ba2da2;"&gt;static&lt;/span&gt; &lt;span style="color: #703daa;"&gt;NSString&lt;/span&gt; *CellIdentifier = &lt;span style="color: #d12e1b;"&gt;@"Cell"&lt;/span&gt;;&lt;/div&gt;&lt;div style="font: 11.0px Menlo; margin: 0.0px 0.0px 0.0px 0.0px; min-height: 13.0px;"&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&lt;/div&gt;&lt;div style="font: 11.0px Menlo; margin: 0.0px 0.0px 0.0px 0.0px;"&gt;&amp;nbsp; &amp;nbsp; &lt;span style="color: #703daa;"&gt;UITableViewCell&lt;/span&gt; *cell = [&lt;span style="color: #ba2da2;"&gt;self&lt;/span&gt;.&lt;span style="color: #4f8187;"&gt;tableView&lt;/span&gt; &lt;span style="color: #3d1e81;"&gt;dequeueReusableCellWithIdentifier&lt;/span&gt;:CellIdentifier];&lt;/div&gt;&lt;div style="font: 11.0px Menlo; margin: 0.0px 0.0px 0.0px 0.0px;"&gt;&amp;nbsp; &amp;nbsp; &lt;span style="color: #ba2da2;"&gt;if&lt;/span&gt; (cell == &lt;span style="color: #ba2da2;"&gt;nil&lt;/span&gt;) {&lt;/div&gt;&lt;div style="color: #3d1e81; font: 11.0px Menlo; margin: 0.0px 0.0px 0.0px 0.0px;"&gt;&lt;span style="color: black;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; cell = [[[&lt;/span&gt;&lt;span style="color: #703daa;"&gt;UITableViewCell&lt;/span&gt;&lt;span style="color: black;"&gt; &lt;/span&gt;alloc&lt;span style="color: black;"&gt;] &lt;/span&gt;initWithStyle&lt;span style="color: black;"&gt;:&lt;/span&gt;UITableViewCellStyleValue1&lt;span style="color: black;"&gt; &lt;/span&gt;reuseIdentifier&lt;span style="color: black;"&gt;:CellIdentifier] &lt;/span&gt;autorelease&lt;span style="color: black;"&gt;];&lt;/span&gt;&lt;/div&gt;&lt;div style="font: 11.0px Menlo; margin: 0.0px 0.0px 0.0px 0.0px;"&gt;&amp;nbsp; &amp;nbsp; }&lt;/div&gt;&lt;div style="font: 11.0px Menlo; margin: 0.0px 0.0px 0.0px 0.0px; min-height: 13.0px;"&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&lt;/div&gt;&lt;div style="color: #008400; font: 11.0px Menlo; margin: 0.0px 0.0px 0.0px 0.0px;"&gt;&lt;span style="color: black;"&gt;&amp;nbsp; &amp;nbsp; &lt;/span&gt;// Configure the cell...&lt;/div&gt;&lt;div style="font: 11.0px Menlo; margin: 0.0px 0.0px 0.0px 0.0px;"&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;&lt;span style="color: #ba2da2;"&gt;if&lt;/span&gt; (indexPath.&lt;span style="color: #703daa;"&gt;row&lt;/span&gt; == &lt;span style="color: #252bd8;"&gt;0&lt;/span&gt;) {&lt;/div&gt;&lt;div style="color: #4f8187; font: 11.0px Menlo; margin: 0.0px 0.0px 0.0px 0.0px;"&gt;&lt;span style="color: black;"&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt;  &lt;/span&gt;cell.&lt;/span&gt;&lt;span style="color: #703daa;"&gt;textLabel&lt;/span&gt;&lt;span style="color: black;"&gt;.&lt;/span&gt;&lt;span style="color: #703daa;"&gt;text&lt;/span&gt;&lt;span style="color: black;"&gt; = &lt;/span&gt;startDateLabel&lt;span style="color: black;"&gt;;&lt;/span&gt;&lt;/div&gt;&lt;div style="font: 11.0px Menlo; margin: 0.0px 0.0px 0.0px 0.0px;"&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt;  &lt;/span&gt;&lt;span style="color: #ba2da2;"&gt;if&lt;/span&gt; (&lt;span style="color: #ba2da2;"&gt;self&lt;/span&gt;.&lt;span style="color: #4f8187;"&gt;startDate&lt;/span&gt; == &lt;span style="color: #ba2da2;"&gt;nil&lt;/span&gt;) {&lt;/div&gt;&lt;div style="color: #d12e1b; font: 11.0px Menlo; margin: 0.0px 0.0px 0.0px 0.0px;"&gt;&lt;span style="color: black;"&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt;   &lt;/span&gt;cell.&lt;/span&gt;&lt;span style="color: #703daa;"&gt;detailTextLabel&lt;/span&gt;&lt;span style="color: black;"&gt;.&lt;/span&gt;&lt;span style="color: #703daa;"&gt;text&lt;/span&gt;&lt;span style="color: black;"&gt; = &lt;/span&gt;&lt;span style="color: #78492a;"&gt;NSLocalizedString&lt;/span&gt;&lt;span style="color: black;"&gt;(&lt;/span&gt;@"select start date"&lt;span style="color: black;"&gt;, &lt;/span&gt;@""&lt;span style="color: black;"&gt;);&lt;/span&gt;&lt;/div&gt;&lt;div style="font: 11.0px Menlo; margin: 0.0px 0.0px 0.0px 0.0px;"&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt;  &lt;/span&gt;} &lt;span style="color: #ba2da2;"&gt;else&lt;/span&gt; {&lt;/div&gt;&lt;div style="color: #4f8187; font: 11.0px Menlo; margin: 0.0px 0.0px 0.0px 0.0px;"&gt;&lt;span style="color: black;"&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt;   &lt;/span&gt;cell.&lt;/span&gt;&lt;span style="color: #703daa;"&gt;detailTextLabel&lt;/span&gt;&lt;span style="color: black;"&gt;.&lt;/span&gt;&lt;span style="color: #703daa;"&gt;text&lt;/span&gt;&lt;span style="color: black;"&gt; = [&lt;/span&gt;&lt;span style="color: #ba2da2;"&gt;self&lt;/span&gt;&lt;span style="color: black;"&gt;.&lt;/span&gt;dateFormatter&lt;span style="color: black;"&gt; &lt;/span&gt;&lt;span style="color: #3d1e81;"&gt;stringFromDate&lt;/span&gt;&lt;span style="color: black;"&gt;:&lt;/span&gt;&lt;span style="color: #ba2da2;"&gt;self&lt;/span&gt;&lt;span style="color: black;"&gt;.&lt;/span&gt;startDate&lt;span style="color: black;"&gt;];&lt;/span&gt;&lt;/div&gt;&lt;div style="font: 11.0px Menlo; margin: 0.0px 0.0px 0.0px 0.0px;"&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt;  &lt;/span&gt;}&lt;/div&gt;&lt;div style="font: 11.0px Menlo; margin: 0.0px 0.0px 0.0px 0.0px; min-height: 13.0px;"&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt;  &lt;/span&gt;&lt;/div&gt;&lt;div style="font: 11.0px Menlo; margin: 0.0px 0.0px 0.0px 0.0px;"&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;} &lt;span style="color: #ba2da2;"&gt;else&lt;/span&gt; {&lt;/div&gt;&lt;div style="font: 11.0px Menlo; margin: 0.0px 0.0px 0.0px 0.0px;"&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt;  &lt;/span&gt;cell.&lt;span style="color: #703daa;"&gt;textLabel&lt;/span&gt;.&lt;span style="color: #703daa;"&gt;text&lt;/span&gt; = &lt;span style="color: #4f8187;"&gt;endDateLabel&lt;/span&gt;;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt;  &lt;/span&gt;&lt;/div&gt;&lt;div style="font: 11.0px Menlo; margin: 0.0px 0.0px 0.0px 0.0px;"&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt;  &lt;/span&gt;&lt;span style="color: #ba2da2;"&gt;if&lt;/span&gt; (&lt;span style="color: #ba2da2;"&gt;self&lt;/span&gt;.&lt;span style="color: #4f8187;"&gt;endDate&lt;/span&gt; == &lt;span style="color: #ba2da2;"&gt;nil&lt;/span&gt;) {&lt;/div&gt;&lt;div style="color: #d12e1b; font: 11.0px Menlo; margin: 0.0px 0.0px 0.0px 0.0px;"&gt;&lt;span style="color: black;"&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt;   &lt;/span&gt;cell.&lt;/span&gt;&lt;span style="color: #703daa;"&gt;detailTextLabel&lt;/span&gt;&lt;span style="color: black;"&gt;.&lt;/span&gt;&lt;span style="color: #703daa;"&gt;text&lt;/span&gt;&lt;span style="color: black;"&gt; = &lt;/span&gt;&lt;span style="color: #78492a;"&gt;NSLocalizedString&lt;/span&gt;&lt;span style="color: black;"&gt;(&lt;/span&gt;@"select end date"&lt;span style="color: black;"&gt;, &lt;/span&gt;@""&lt;span style="color: black;"&gt;);&lt;/span&gt;&lt;/div&gt;&lt;div style="font: 11.0px Menlo; margin: 0.0px 0.0px 0.0px 0.0px;"&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt;  &lt;/span&gt;} &lt;span style="color: #ba2da2;"&gt;else&lt;/span&gt; {&lt;/div&gt;&lt;div style="color: #4f8187; font: 11.0px Menlo; margin: 0.0px 0.0px 0.0px 0.0px;"&gt;&lt;span style="color: black;"&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt;   &lt;/span&gt;cell.&lt;/span&gt;&lt;span style="color: #703daa;"&gt;detailTextLabel&lt;/span&gt;&lt;span style="color: black;"&gt;.&lt;/span&gt;&lt;span style="color: #703daa;"&gt;text&lt;/span&gt;&lt;span style="color: black;"&gt; = [&lt;/span&gt;&lt;span style="color: #ba2da2;"&gt;self&lt;/span&gt;&lt;span style="color: black;"&gt;.&lt;/span&gt;dateFormatter&lt;span style="color: black;"&gt; &lt;/span&gt;&lt;span style="color: #3d1e81;"&gt;stringFromDate&lt;/span&gt;&lt;span style="color: black;"&gt;:&lt;/span&gt;&lt;span style="color: #ba2da2;"&gt;self&lt;/span&gt;&lt;span style="color: black;"&gt;.&lt;/span&gt;endDate&lt;span style="color: black;"&gt;];&lt;/span&gt;&lt;/div&gt;&lt;div style="font: 11.0px Menlo; margin: 0.0px 0.0px 0.0px 0.0px;"&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt;  &lt;/span&gt;}&lt;span class="Apple-tab-span" style="white-space: pre;"&gt;  &lt;/span&gt;&lt;/div&gt;&lt;div style="font: 11.0px Menlo; margin: 0.0px 0.0px 0.0px 0.0px;"&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;}&lt;/div&gt;&lt;div style="font: 11.0px Menlo; margin: 0.0px 0.0px 0.0px 0.0px; min-height: 13.0px;"&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&lt;/div&gt;&lt;div style="font: 11.0px Menlo; margin: 0.0px 0.0px 0.0px 0.0px;"&gt;&amp;nbsp; &amp;nbsp; &lt;span style="color: #ba2da2;"&gt;return&lt;/span&gt; cell;&lt;/div&gt;&lt;div style="font: 11.0px Menlo; margin: 0.0px 0.0px 0.0px 0.0px;"&gt;}&lt;/div&gt;&lt;div style="font: 11.0px Menlo; margin: 0.0px 0.0px 0.0px 0.0px; min-height: 13.0px;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="font: 11.0px Menlo; margin: 0.0px 0.0px 0.0px 0.0px;"&gt;- (&lt;span style="color: #703daa;"&gt;NSString&lt;/span&gt; *)tableView:(&lt;span style="color: #703daa;"&gt;UITableView&lt;/span&gt; *)tableView titleForHeaderInSection:(&lt;span style="color: #703daa;"&gt;NSInteger&lt;/span&gt;)section {&lt;/div&gt;&lt;div style="color: #d12e1b; font: 11.0px Menlo; margin: 0.0px 0.0px 0.0px 0.0px;"&gt;&lt;span style="color: black;"&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style="color: #ba2da2;"&gt;return&lt;/span&gt;&lt;span style="color: black;"&gt; &lt;/span&gt;&lt;span style="color: #78492a;"&gt;NSLocalizedString&lt;/span&gt;&lt;span style="color: black;"&gt;(&lt;/span&gt;@"Please choose dates: "&lt;span style="color: black;"&gt;, &lt;/span&gt;@""&lt;span style="color: black;"&gt;);&lt;/span&gt;&lt;/div&gt;&lt;div style="font: 11.0px Menlo; margin: 0.0px 0.0px 0.0px 0.0px;"&gt;}&lt;/div&gt;&lt;div style="font: 11.0px Menlo; margin: 0.0px 0.0px 0.0px 0.0px; min-height: 13.0px;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="font: 11.0px Menlo; margin: 0.0px 0.0px 0.0px 0.0px; min-height: 13.0px;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="color: #78492a; font: 11.0px Menlo; margin: 0.0px 0.0px 0.0px 0.0px;"&gt;#pragma mark - Table view delegate&lt;/div&gt;&lt;div style="font: 11.0px Menlo; margin: 0.0px 0.0px 0.0px 0.0px; min-height: 13.0px;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="font: 11.0px Menlo; margin: 0.0px 0.0px 0.0px 0.0px;"&gt;- (&lt;span style="color: #ba2da2;"&gt;void&lt;/span&gt;)tableView:(&lt;span style="color: #703daa;"&gt;UITableView&lt;/span&gt; *)tableView didSelectRowAtIndexPath:(&lt;span style="color: #703daa;"&gt;NSIndexPath&lt;/span&gt; *)indexPath&lt;/div&gt;&lt;div style="font: 11.0px Menlo; margin: 0.0px 0.0px 0.0px 0.0px;"&gt;{&lt;/div&gt;&lt;div style="font: 11.0px Menlo; margin: 0.0px 0.0px 0.0px 0.0px;"&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;&lt;span style="color: #ba2da2;"&gt;self&lt;/span&gt;.&lt;span style="color: #4f8187;"&gt;selectedRow&lt;/span&gt; = indexPath.&lt;span style="color: #703daa;"&gt;row&lt;/span&gt;;&lt;/div&gt;&lt;div style="color: #008400; font: 11.0px Menlo; margin: 0.0px 0.0px 0.0px 0.0px;"&gt;&lt;span style="color: black;"&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;&lt;/span&gt;//[self showDatePicker];&lt;/div&gt;&lt;div style="font: 11.0px Menlo; margin: 0.0px 0.0px 0.0px 0.0px;"&gt;}&lt;/div&gt;&lt;div style="font: 11.0px Menlo; margin: 0.0px 0.0px 0.0px 0.0px; min-height: 13.0px;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="font: 11.0px Menlo; margin: 0.0px 0.0px 0.0px 0.0px; min-height: 13.0px;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="color: #78492a; font: 11.0px Menlo; margin: 0.0px 0.0px 0.0px 0.0px;"&gt;#pragma mark - Action handlers&lt;/div&gt;&lt;div style="font: 11.0px Menlo; margin: 0.0px 0.0px 0.0px 0.0px; min-height: 13.0px;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="font: 11.0px Menlo; margin: 0.0px 0.0px 0.0px 0.0px;"&gt;- (&lt;span style="color: #ba2da2;"&gt;void&lt;/span&gt;) didPressDoneButton {&lt;/div&gt;&lt;div style="font: 11.0px Menlo; margin: 0.0px 0.0px 0.0px 0.0px; min-height: 13.0px;"&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;&lt;/div&gt;&lt;div style="font: 11.0px Menlo; margin: 0.0px 0.0px 0.0px 0.0px;"&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;&lt;span style="color: #703daa;"&gt;NSString&lt;/span&gt; * message;&lt;/div&gt;&lt;div style="font: 11.0px Menlo; margin: 0.0px 0.0px 0.0px 0.0px;"&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;&lt;span style="color: #ba2da2;"&gt;BOOL&lt;/span&gt; validationError = &lt;span style="color: #ba2da2;"&gt;NO&lt;/span&gt;;&lt;/div&gt;&lt;div style="font: 11.0px Menlo; margin: 0.0px 0.0px 0.0px 0.0px; min-height: 13.0px;"&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;&lt;/div&gt;&lt;div style="font: 11.0px Menlo; margin: 0.0px 0.0px 0.0px 0.0px;"&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;&lt;span style="color: #ba2da2;"&gt;if&lt;/span&gt; (&lt;span style="color: #ba2da2;"&gt;self&lt;/span&gt;.&lt;span style="color: #4f8187;"&gt;startDate&lt;/span&gt; == &lt;span style="color: #ba2da2;"&gt;nil&lt;/span&gt;) {&lt;/div&gt;&lt;div style="font: 11.0px Menlo; margin: 0.0px 0.0px 0.0px 0.0px;"&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt;  &lt;/span&gt;message = [&lt;span style="color: #703daa;"&gt;NSString&lt;/span&gt; &lt;span style="color: #3d1e81;"&gt;stringWithFormat&lt;/span&gt;:&lt;span style="color: #d12e1b;"&gt;@"%@ '%@'"&lt;/span&gt;,&amp;nbsp;&lt;/div&gt;&lt;div style="color: #d12e1b; font: 11.0px Menlo; margin: 0.0px 0.0px 0.0px 0.0px;"&gt;&lt;span style="color: black;"&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt;    &lt;/span&gt; &amp;nbsp; &lt;/span&gt;&lt;span style="color: #78492a;"&gt;NSLocalizedString&lt;/span&gt;&lt;span style="color: black;"&gt;(&lt;/span&gt;@"Please enter "&lt;span style="color: black;"&gt;, &lt;/span&gt;@""&lt;span style="color: black;"&gt;), &lt;/span&gt;&lt;span style="color: #ba2da2;"&gt;self&lt;/span&gt;&lt;span style="color: black;"&gt;.&lt;/span&gt;&lt;span style="color: #4f8187;"&gt;startDateLabel&lt;/span&gt;&lt;span style="color: black;"&gt;];&lt;/span&gt;&lt;/div&gt;&lt;div style="font: 11.0px Menlo; margin: 0.0px 0.0px 0.0px 0.0px;"&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt;  &lt;/span&gt;validationError = &lt;span style="color: #ba2da2;"&gt;YES&lt;/span&gt;;&lt;/div&gt;&lt;div style="font: 11.0px Menlo; margin: 0.0px 0.0px 0.0px 0.0px;"&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;} &lt;span style="color: #ba2da2;"&gt;else&lt;/span&gt; &lt;span style="color: #ba2da2;"&gt;if&lt;/span&gt; (&lt;span style="color: #ba2da2;"&gt;self&lt;/span&gt;.&lt;span style="color: #4f8187;"&gt;endDate&lt;/span&gt; == &lt;span style="color: #ba2da2;"&gt;nil&lt;/span&gt;) {&lt;/div&gt;&lt;div style="font: 11.0px Menlo; margin: 0.0px 0.0px 0.0px 0.0px;"&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt;  &lt;/span&gt;message = [&lt;span style="color: #703daa;"&gt;NSString&lt;/span&gt; &lt;span style="color: #3d1e81;"&gt;stringWithFormat&lt;/span&gt;:&lt;span style="color: #d12e1b;"&gt;@"%@ '%@'"&lt;/span&gt;,&amp;nbsp;&lt;/div&gt;&lt;div style="color: #d12e1b; font: 11.0px Menlo; margin: 0.0px 0.0px 0.0px 0.0px;"&gt;&lt;span style="color: black;"&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt;    &lt;/span&gt; &amp;nbsp; &lt;/span&gt;&lt;span style="color: #78492a;"&gt;NSLocalizedString&lt;/span&gt;&lt;span style="color: black;"&gt;(&lt;/span&gt;@"Please enter "&lt;span style="color: black;"&gt;, &lt;/span&gt;@""&lt;span style="color: black;"&gt;), &lt;/span&gt;&lt;span style="color: #ba2da2;"&gt;self&lt;/span&gt;&lt;span style="color: black;"&gt;.&lt;/span&gt;&lt;span style="color: #4f8187;"&gt;endDateLabel&lt;/span&gt;&lt;span style="color: black;"&gt;];&lt;/span&gt;&lt;/div&gt;&lt;div style="font: 11.0px Menlo; margin: 0.0px 0.0px 0.0px 0.0px; min-height: 13.0px;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="font: 11.0px Menlo; margin: 0.0px 0.0px 0.0px 0.0px;"&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt;  &lt;/span&gt;validationError = &lt;span style="color: #ba2da2;"&gt;YES&lt;/span&gt;;&lt;/div&gt;&lt;div style="font: 11.0px Menlo; margin: 0.0px 0.0px 0.0px 0.0px;"&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;}&lt;/div&gt;&lt;div style="font: 11.0px Menlo; margin: 0.0px 0.0px 0.0px 0.0px; min-height: 13.0px;"&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;&lt;/div&gt;&lt;div style="font: 11.0px Menlo; margin: 0.0px 0.0px 0.0px 0.0px;"&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;&lt;span style="color: #ba2da2;"&gt;if&lt;/span&gt; (validationError) {&lt;/div&gt;&lt;div style="font: 11.0px Menlo; margin: 0.0px 0.0px 0.0px 0.0px;"&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt;  &lt;/span&gt;&lt;span style="color: #703daa;"&gt;UIAlertView&lt;/span&gt; * alertView = [[&lt;span style="color: #703daa;"&gt;UIAlertView&lt;/span&gt; &lt;span style="color: #3d1e81;"&gt;alloc&lt;/span&gt;] &lt;span style="color: #3d1e81;"&gt;initWithTitle&lt;/span&gt;:&lt;span style="color: #78492a;"&gt;NSLocalizedString&lt;/span&gt;(&lt;span style="color: #d12e1b;"&gt;@"Enter date"&lt;/span&gt;, &lt;span style="color: #d12e1b;"&gt;@""&lt;/span&gt;)&amp;nbsp;&lt;/div&gt;&lt;div style="font: 11.0px Menlo; margin: 0.0px 0.0px 0.0px 0.0px;"&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt;            &lt;/span&gt;&lt;span style="color: #3d1e81;"&gt;message&lt;/span&gt;:message &lt;span style="color: #3d1e81;"&gt;delegate&lt;/span&gt;:&lt;span style="color: #ba2da2;"&gt;nil&lt;/span&gt;&amp;nbsp;&lt;/div&gt;&lt;div style="font: 11.0px Menlo; margin: 0.0px 0.0px 0.0px 0.0px;"&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt;            &lt;/span&gt;&lt;span style="color: #3d1e81;"&gt;cancelButtonTitle&lt;/span&gt;: &lt;span style="color: #78492a;"&gt;NSLocalizedString&lt;/span&gt;(&lt;span style="color: #d12e1b;"&gt;@"Cancel"&lt;/span&gt;, &lt;span style="color: #d12e1b;"&gt;@""&lt;/span&gt;)&amp;nbsp;&lt;/div&gt;&lt;div style="color: #3d1e81; font: 11.0px Menlo; margin: 0.0px 0.0px 0.0px 0.0px;"&gt;&lt;span style="color: black;"&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt;            &lt;/span&gt;&lt;/span&gt;otherButtonTitles&lt;span style="color: black;"&gt;:&lt;/span&gt;&lt;span style="color: #ba2da2;"&gt;nil&lt;/span&gt;&lt;span style="color: black;"&gt;];&lt;/span&gt;&lt;/div&gt;&lt;div style="font: 11.0px Menlo; margin: 0.0px 0.0px 0.0px 0.0px;"&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt;  &lt;/span&gt;[alertView &lt;span style="color: #3d1e81;"&gt;show&lt;/span&gt;];&lt;/div&gt;&lt;div style="font: 11.0px Menlo; margin: 0.0px 0.0px 0.0px 0.0px;"&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt;  &lt;/span&gt;[alertView &lt;span style="color: #3d1e81;"&gt;release&lt;/span&gt;];&lt;/div&gt;&lt;div style="color: #ba2da2; font: 11.0px Menlo; margin: 0.0px 0.0px 0.0px 0.0px;"&gt;&lt;span style="color: black;"&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt;  &lt;/span&gt;&lt;/span&gt;return&lt;span style="color: black;"&gt;;&lt;/span&gt;&lt;/div&gt;&lt;div style="font: 11.0px Menlo; margin: 0.0px 0.0px 0.0px 0.0px;"&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;}&amp;nbsp;&lt;/div&gt;&lt;div style="font: 11.0px Menlo; margin: 0.0px 0.0px 0.0px 0.0px; min-height: 13.0px;"&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;&lt;/div&gt;&lt;div style="font: 11.0px Menlo; margin: 0.0px 0.0px 0.0px 0.0px;"&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;&lt;span style="color: #ba2da2;"&gt;if&lt;/span&gt; (&lt;span style="color: #ba2da2;"&gt;self&lt;/span&gt;.&lt;span style="color: #4f8187;"&gt;delegate&lt;/span&gt; != &lt;span style="color: #ba2da2;"&gt;nil&lt;/span&gt;) {&lt;/div&gt;&lt;div style="font: 11.0px Menlo; margin: 0.0px 0.0px 0.0px 0.0px;"&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt;  &lt;/span&gt;&lt;span style="color: #ba2da2;"&gt;if&lt;/span&gt; ([&lt;span style="color: #ba2da2;"&gt;self&lt;/span&gt;.&lt;span style="color: #4f8187;"&gt;delegate&lt;/span&gt; &lt;span style="color: #3d1e81;"&gt;respondsToSelector&lt;/span&gt;: &lt;span style="color: #ba2da2;"&gt;@selector&lt;/span&gt;(datePickerController: didPickStartDate: endDate:)]) {&lt;/div&gt;&lt;div style="color: #31595e; font: 11.0px Menlo; margin: 0.0px 0.0px 0.0px 0.0px;"&gt;&lt;span style="color: black;"&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt;   &lt;/span&gt;[&lt;/span&gt;&lt;span style="color: #ba2da2;"&gt;self&lt;/span&gt;&lt;span style="color: black;"&gt;.&lt;/span&gt;&lt;span style="color: #4f8187;"&gt;delegate&lt;/span&gt;&lt;span style="color: black;"&gt; &lt;/span&gt;datePickerController&lt;span style="color: black;"&gt;:&lt;/span&gt;&lt;span style="color: #ba2da2;"&gt;self&lt;/span&gt;&lt;span style="color: black;"&gt; &lt;/span&gt;didPickStartDate&lt;span style="color: black;"&gt;:&lt;/span&gt;&lt;span style="color: #ba2da2;"&gt;self&lt;/span&gt;&lt;span style="color: black;"&gt;.&lt;/span&gt;&lt;span style="color: #4f8187;"&gt;startDate&lt;/span&gt;&lt;span style="color: black;"&gt; &lt;/span&gt;endDate&lt;span style="color: black;"&gt;:&lt;/span&gt;&lt;span style="color: #ba2da2;"&gt;self&lt;/span&gt;&lt;span style="color: black;"&gt;.&lt;/span&gt;&lt;span style="color: #4f8187;"&gt;endDate&lt;/span&gt;&lt;span style="color: black;"&gt;];&lt;/span&gt;&lt;/div&gt;&lt;div style="font: 11.0px Menlo; margin: 0.0px 0.0px 0.0px 0.0px;"&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt;  &lt;/span&gt;} &lt;span style="color: #ba2da2;"&gt;else&lt;/span&gt; {&lt;/div&gt;&lt;div style="color: #3d1e81; font: 11.0px Menlo; margin: 0.0px 0.0px 0.0px 0.0px;"&gt;&lt;span style="color: black;"&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt;   &lt;/span&gt;[&lt;/span&gt;&lt;span style="color: #ba2da2;"&gt;self&lt;/span&gt;&lt;span style="color: black;"&gt;.&lt;/span&gt;&lt;span style="color: #703daa;"&gt;navigationController&lt;/span&gt;&lt;span style="color: black;"&gt; &lt;/span&gt;dismissModalViewControllerAnimated&lt;span style="color: black;"&gt;:&lt;/span&gt;&lt;span style="color: #ba2da2;"&gt;YES&lt;/span&gt;&lt;span style="color: black;"&gt;];&lt;/span&gt;&lt;/div&gt;&lt;div style="font: 11.0px Menlo; margin: 0.0px 0.0px 0.0px 0.0px;"&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt;  &lt;/span&gt;}&lt;/div&gt;&lt;div style="font: 11.0px Menlo; margin: 0.0px 0.0px 0.0px 0.0px;"&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;}&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;&lt;/div&gt;&lt;div style="font: 11.0px Menlo; margin: 0.0px 0.0px 0.0px 0.0px;"&gt;}&lt;/div&gt;&lt;div style="font: 11.0px Menlo; margin: 0.0px 0.0px 0.0px 0.0px; min-height: 13.0px;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="font: 11.0px Menlo; margin: 0.0px 0.0px 0.0px 0.0px;"&gt;- (&lt;span style="color: #ba2da2;"&gt;void&lt;/span&gt;) didPressCancelButton {&lt;/div&gt;&lt;div style="color: #3d1e81; font: 11.0px Menlo; margin: 0.0px 0.0px 0.0px 0.0px;"&gt;&lt;span style="color: black;"&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;[&lt;/span&gt;&lt;span style="color: #ba2da2;"&gt;self&lt;/span&gt;&lt;span style="color: black;"&gt;.&lt;/span&gt;&lt;span style="color: #703daa;"&gt;navigationController&lt;/span&gt;&lt;span style="color: black;"&gt; &lt;/span&gt;dismissModalViewControllerAnimated&lt;span style="color: black;"&gt;:&lt;/span&gt;&lt;span style="color: #ba2da2;"&gt;YES&lt;/span&gt;&lt;span style="color: black;"&gt;];&lt;/span&gt;&lt;/div&gt;&lt;div style="font: 11.0px Menlo; margin: 0.0px 0.0px 0.0px 0.0px;"&gt;}&lt;/div&gt;&lt;div style="font: 11.0px Menlo; margin: 0.0px 0.0px 0.0px 0.0px; min-height: 13.0px;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="font: 11.0px Menlo; margin: 0.0px 0.0px 0.0px 0.0px;"&gt;- (&lt;span style="color: #ba2da2;"&gt;void&lt;/span&gt;) dateChanged:(&lt;span style="color: #ba2da2;"&gt;id&lt;/span&gt;)sender {&lt;/div&gt;&lt;div style="color: #4f8187; font: 11.0px Menlo; margin: 0.0px 0.0px 0.0px 0.0px;"&gt;&lt;span style="color: black;"&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style="color: #ba2da2;"&gt;if&lt;/span&gt;&lt;span style="color: black;"&gt; (&lt;/span&gt;selectedRow&lt;span style="color: black;"&gt; == &lt;/span&gt;&lt;span style="color: #252bd8;"&gt;0&lt;/span&gt;&lt;span style="color: black;"&gt;) {&lt;/span&gt;&lt;/div&gt;&lt;div style="color: #4f8187; font: 11.0px Menlo; margin: 0.0px 0.0px 0.0px 0.0px;"&gt;&lt;span style="color: black;"&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt;  &lt;/span&gt;&lt;/span&gt;&lt;span style="color: #ba2da2;"&gt;self&lt;/span&gt;&lt;span style="color: black;"&gt;.&lt;/span&gt;startDate&lt;span style="color: black;"&gt; = &lt;/span&gt;&lt;span style="color: #ba2da2;"&gt;self&lt;/span&gt;&lt;span style="color: black;"&gt;.&lt;/span&gt;datePicker&lt;span style="color: black;"&gt;.&lt;/span&gt;&lt;span style="color: #703daa;"&gt;date&lt;/span&gt;&lt;span style="color: black;"&gt;;&lt;/span&gt;&lt;/div&gt;&lt;div style="font: 11.0px Menlo; margin: 0.0px 0.0px 0.0px 0.0px;"&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;} &lt;span style="color: #ba2da2;"&gt;else&lt;/span&gt; &lt;span style="color: #ba2da2;"&gt;if&lt;/span&gt; (&lt;span style="color: #4f8187;"&gt;selectedRow&lt;/span&gt; == &lt;span style="color: #252bd8;"&gt;1&lt;/span&gt;) {&lt;/div&gt;&lt;div style="color: #4f8187; font: 11.0px Menlo; margin: 0.0px 0.0px 0.0px 0.0px;"&gt;&lt;span style="color: black;"&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt;  &lt;/span&gt;&lt;/span&gt;&lt;span style="color: #ba2da2;"&gt;self&lt;/span&gt;&lt;span style="color: black;"&gt;.&lt;/span&gt;endDate&lt;span style="color: black;"&gt; = &lt;/span&gt;&lt;span style="color: #ba2da2;"&gt;self&lt;/span&gt;&lt;span style="color: black;"&gt;.&lt;/span&gt;datePicker&lt;span style="color: black;"&gt;.&lt;/span&gt;&lt;span style="color: #703daa;"&gt;date&lt;/span&gt;&lt;span style="color: black;"&gt;;&lt;/span&gt;&lt;/div&gt;&lt;div style="font: 11.0px Menlo; margin: 0.0px 0.0px 0.0px 0.0px;"&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;}&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;&lt;/div&gt;&lt;div style="color: #3d1e81; font: 11.0px Menlo; margin: 0.0px 0.0px 0.0px 0.0px;"&gt;&lt;span style="color: black;"&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;[&lt;/span&gt;&lt;span style="color: #ba2da2;"&gt;self&lt;/span&gt;&lt;span style="color: black;"&gt;.&lt;/span&gt;&lt;span style="color: #4f8187;"&gt;tableView&lt;/span&gt;&lt;span style="color: black;"&gt; &lt;/span&gt;reloadData&lt;span style="color: black;"&gt;];&lt;/span&gt;&lt;/div&gt;&lt;div style="font: 11.0px Menlo; margin: 0.0px 0.0px 0.0px 0.0px;"&gt;}&lt;/div&gt;&lt;div style="color: #ba2da2; font: 11.0px Menlo; margin: 0.0px 0.0px 0.0px 0.0px;"&gt;@end&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&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/4996441835700536347-6332084291382982167?l=i-phone-dev.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://i-phone-dev.blogspot.com/feeds/6332084291382982167/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://i-phone-dev.blogspot.com/2011/12/uidatepicker-advanced-tutoial.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4996441835700536347/posts/default/6332084291382982167'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4996441835700536347/posts/default/6332084291382982167'/><link rel='alternate' type='text/html' href='http://i-phone-dev.blogspot.com/2011/12/uidatepicker-advanced-tutoial.html' title='UIDatePicker advanced Tutoial'/><author><name>Anon</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4996441835700536347.post-8461522242602916817</id><published>2011-12-04T23:57:00.001-08:00</published><updated>2011-12-05T01:30:03.033-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='pin'/><category scheme='http://www.blogger.com/atom/ns#' term='cluster'/><category scheme='http://www.blogger.com/atom/ns#' term='animation'/><category scheme='http://www.blogger.com/atom/ns#' term='uimapview'/><category scheme='http://www.blogger.com/atom/ns#' term='map view'/><category scheme='http://www.blogger.com/atom/ns#' term='iphone'/><title type='text'>iPhone Map kit cluster, pin and animation</title><content type='html'>In one of my project, I need to have clustering in the map view. I tried to collect information and document here step by step what I have found.&lt;br /&gt;&lt;br /&gt;1. Easiest way is to buy a framework found here cost $199. &amp;nbsp;&lt;a href="http://getsuperpin.com/"&gt;http://getsuperpin.com/&lt;/a&gt;.&lt;br /&gt;2. An open source implementation is found &lt;a href="http://revolver.be/blog/mapkit-clustering-with-ios/"&gt;here&lt;/a&gt;&amp;nbsp;from the same developer above.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;To develop it yourself, you need to implement&lt;br /&gt;&lt;ul&gt;&lt;li&gt;a clustering algorithm and&lt;/li&gt;&lt;li&gt;animation to expand a clustered pin into multiple&lt;/li&gt;&lt;/ul&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-size: large;"&gt;Clustering algorithm&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="border-collapse: collapse; font-size: 14px; line-height: 18px;"&gt;&lt;span class="Apple-style-span" style="font-family: Arial, 'Liberation Sans', 'DejaVu Sans', sans-serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="border-collapse: collapse; font-size: 14px; line-height: 18px;"&gt;&lt;span class="Apple-style-span" style="font-family: Arial, 'Liberation Sans', 'DejaVu Sans', sans-serif;"&gt;1.&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="border-collapse: collapse; font-size: 14px; line-height: 18px;"&gt;&lt;span class="Apple-style-span" style="font-family: Arial, 'Liberation Sans', 'DejaVu Sans', sans-serif;"&gt;Simple approach can be to divide the MapView into a number of grids. e.g. 5x5 = 25 squares region. Any collection of points inside the grid will make a cluster. Optionally if the number of points in cluster is to a minimum value of 2 or 5, we will avoid clustering and show all the pins.&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="border-collapse: collapse; font-size: 14px; line-height: 18px;"&gt;&lt;span class="Apple-style-span" style="font-family: Arial, 'Liberation Sans', 'DejaVu Sans', sans-serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="border-collapse: collapse; font-size: 14px; line-height: 18px;"&gt;&lt;span class="Apple-style-span" style="font-family: Arial, 'Liberation Sans', 'DejaVu Sans', sans-serif;"&gt;2.&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="border-collapse: collapse; font-size: 14px; line-height: 18px;"&gt;&lt;span class="Apple-style-span" style="font-family: Arial, 'Liberation Sans', 'DejaVu Sans', sans-serif;"&gt;One approach is that before placing a new pin, check if there's another pin already placed within distance &lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="border-collapse: collapse; font-size: 14px; line-height: 18px;"&gt;&lt;i&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;d&lt;/span&gt;&lt;/i&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="border-collapse: collapse; font-size: 14px; line-height: 18px;"&gt;&lt;span class="Apple-style-span" style="font-family: Arial, 'Liberation Sans', 'DejaVu Sans', sans-serif;"&gt; of the new pin. If there is, don't place the new pin. You need to vary &lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="border-collapse: collapse; font-size: 14px; line-height: 18px;"&gt;&lt;i&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;d&lt;/span&gt;&lt;/i&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="border-collapse: collapse; font-size: 14px; line-height: 18px;"&gt;&lt;span class="Apple-style-span" style="font-family: Arial, 'Liberation Sans', 'DejaVu Sans', sans-serif;"&gt; based on the current zoom level.&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: Arial, 'Liberation Sans', 'DejaVu Sans', sans-serif;"&gt;&lt;span class="Apple-style-span" style="border-collapse: collapse; font-size: 14px; line-height: 18px;"&gt;You can reduce the number of pins you check against by considering only pins in a bounding box centered on the new pin. The box could be &lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="border-collapse: collapse; font-family: 'Courier New', Courier, monospace; font-size: 14px; line-height: 18px;"&gt;d x d&lt;/span&gt;&lt;span class="Apple-style-span" style="border-collapse: collapse; font-family: Arial, 'Liberation Sans', 'DejaVu Sans', sans-serif; font-size: 14px; line-height: 18px;"&gt; degrees on a side (with &lt;/span&gt;&lt;span class="Apple-style-span" style="border-collapse: collapse; font-family: 'Courier New', Courier, monospace; font-size: 14px; line-height: 18px;"&gt;&lt;i&gt;d&lt;/i&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="border-collapse: collapse; font-family: Arial, 'Liberation Sans', 'DejaVu Sans', sans-serif; font-size: 14px; line-height: 18px;"&gt; varying based on zoom level).&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="border-collapse: collapse; font-family: Arial, 'Liberation Sans', 'DejaVu Sans', sans-serif; font-size: 14px; line-height: 18px;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="border-collapse: collapse; font-family: Arial, 'Liberation Sans', 'DejaVu Sans', sans-serif; font-size: 14px; line-height: 18px;"&gt;3.&amp;nbsp;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="border-collapse: collapse; font-family: Arial, 'Liberation Sans', 'DejaVu Sans', sans-serif; font-size: 14px; line-height: 18px;"&gt;You can use&amp;nbsp;&lt;a href="http://en.wikipedia.org/wiki/K-means_algorithm" rel="nofollow" style="background-attachment: initial; background-clip: initial; background-color: transparent; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial; border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; color: #0077cc; cursor: pointer; font-size: 14px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-decoration: none; vertical-align: baseline;"&gt;K-means clustering&lt;/a&gt;&amp;nbsp;to group pins into clusters and represent them with a midpoint pin.&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="border-collapse: collapse; font-family: Arial, 'Liberation Sans', 'DejaVu Sans', sans-serif; font-size: 14px; line-height: 18px;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="border-collapse: collapse; font-family: Arial, 'Liberation Sans', 'DejaVu Sans', sans-serif; font-size: 14px; line-height: 18px;"&gt;4.&amp;nbsp;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="border-collapse: collapse; font-family: Arial, 'Liberation Sans', 'DejaVu Sans', sans-serif; font-size: 14px; line-height: 18px;"&gt;Not so elegant solution.&amp;nbsp;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="border-collapse: collapse; font-family: Arial, 'Liberation Sans', 'DejaVu Sans', sans-serif; font-size: 14px; line-height: 18px;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="border-collapse: collapse; font-family: Arial, 'Liberation Sans', 'DejaVu Sans', sans-serif; font-size: 14px; line-height: 18px;"&gt;Here's a code snippet that takes an MKAnnotation's coordinates, convert it to a CGPoint relative to the MKMapView, and logs what's the underlying view at that CGPoint.&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;ol&gt;&lt;li&gt;&lt;span class="Apple-style-span" style="border-collapse: collapse; font-family: Arial, 'Liberation Sans', 'DejaVu Sans', sans-serif; font-size: 14px; line-height: 18px;"&gt;&lt;pre class="lang-c prettyprint" style="background-attachment: initial; background-clip: initial; background-color: #eeeeee; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial; border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; font-family: Consolas, Menlo, Monaco, 'Lucida Console', 'Liberation Mono', 'DejaVu Sans Mono', 'Bitstream Vera Sans Mono', 'Courier New', monospace, serif; font-size: 14px; margin-bottom: 10px; margin-left: 0px; margin-right: 0px; margin-top: 0px; max-height: 600px; overflow-x: auto; overflow-y: auto; padding-bottom: 5px; padding-left: 5px; padding-right: 5px; padding-top: 5px; vertical-align: baseline; width: auto;"&gt;&lt;code style="background-attachment: initial; background-clip: initial; background-color: #eeeeee; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial; border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; font-family: Consolas, Menlo, Monaco, 'Lucida Console', 'Liberation Mono', 'DejaVu Sans Mono', 'Bitstream Vera Sans Mono', 'Courier New', monospace, serif; font-size: 14px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;"&gt;&lt;span class="typ" style="background-attachment: initial; background-clip: initial; background-color: transparent; background-image: initial; background-origin: initial; border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; color: #2b91af; font-size: 14px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;"&gt;CGPoint&lt;/span&gt;&lt;span class="pln" style="background-attachment: initial; background-clip: initial; background-color: transparent; background-image: initial; background-origin: initial; border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; color: black; font-size: 14px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;"&gt; pinPoint &lt;/span&gt;&lt;span class="pun" style="background-attachment: initial; background-clip: initial; background-color: transparent; background-image: initial; background-origin: initial; border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; color: black; font-size: 14px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;"&gt;=&lt;/span&gt;&lt;span class="pln" style="background-attachment: initial; background-clip: initial; background-color: transparent; background-image: initial; background-origin: initial; border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; color: black; font-size: 14px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;"&gt; &lt;/span&gt;&lt;span class="pun" style="background-attachment: initial; background-clip: initial; background-color: transparent; background-image: initial; background-origin: initial; border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; color: black; font-size: 14px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;"&gt;[&lt;/span&gt;&lt;span class="pln" style="background-attachment: initial; background-clip: initial; background-color: transparent; background-image: initial; background-origin: initial; border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; color: black; font-size: 14px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;"&gt;mapView convertCoordinate&lt;/span&gt;&lt;span class="pun" style="background-attachment: initial; background-clip: initial; background-color: transparent; background-image: initial; background-origin: initial; border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; color: black; font-size: 14px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;"&gt;:&lt;/span&gt;&lt;span class="pln" style="background-attachment: initial; background-clip: initial; background-color: transparent; background-image: initial; background-origin: initial; border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; color: black; font-size: 14px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;"&gt;pinView&lt;/span&gt;&lt;span class="pun" style="background-attachment: initial; background-clip: initial; background-color: transparent; background-image: initial; background-origin: initial; border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; color: black; font-size: 14px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;"&gt;.&lt;/span&gt;&lt;span class="pln" style="background-attachment: initial; background-clip: initial; background-color: transparent; background-image: initial; background-origin: initial; border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; color: black; font-size: 14px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;"&gt;annotation&lt;/span&gt;&lt;span class="pun" style="background-attachment: initial; background-clip: initial; background-color: transparent; background-image: initial; background-origin: initial; border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; color: black; font-size: 14px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;"&gt;.&lt;/span&gt;&lt;span class="pln" style="background-attachment: initial; background-clip: initial; background-color: transparent; background-image: initial; background-origin: initial; border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; color: black; font-size: 14px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;"&gt;coordinate toPointToView&lt;/span&gt;&lt;span class="pun" style="background-attachment: initial; background-clip: initial; background-color: transparent; background-image: initial; background-origin: initial; border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; color: black; font-size: 14px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;"&gt;:&lt;/span&gt;&lt;span class="pln" style="background-attachment: initial; background-clip: initial; background-color: transparent; background-image: initial; background-origin: initial; border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; color: black; font-size: 14px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;"&gt;mapView&lt;/span&gt;&lt;span class="pun" style="background-attachment: initial; background-clip: initial; background-color: transparent; background-image: initial; background-origin: initial; border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; color: black; font-size: 14px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;"&gt;];&lt;/span&gt;&lt;span class="pln" style="background-attachment: initial; background-clip: initial; background-color: transparent; background-image: initial; background-origin: initial; border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; color: black; font-size: 14px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span class="typ" style="background-attachment: initial; background-clip: initial; background-color: transparent; background-image: initial; background-origin: initial; border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; color: #2b91af; font-size: 14px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;"&gt;NSLog&lt;/span&gt;&lt;span class="pun" style="background-attachment: initial; background-clip: initial; background-color: transparent; background-image: initial; background-origin: initial; border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; color: black; font-size: 14px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;"&gt;(@&lt;/span&gt;&lt;span class="str" style="background-attachment: initial; background-clip: initial; background-color: transparent; background-image: initial; background-origin: initial; border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; color: maroon; font-size: 14px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;"&gt;"pointing to %@"&lt;/span&gt;&lt;span class="pun" style="background-attachment: initial; background-clip: initial; background-color: transparent; background-image: initial; background-origin: initial; border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; color: black; font-size: 14px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;"&gt;,&lt;/span&gt;&lt;span class="pln" style="background-attachment: initial; background-clip: initial; background-color: transparent; background-image: initial; background-origin: initial; border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; color: black; font-size: 14px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;"&gt; &lt;/span&gt;&lt;span class="pun" style="background-attachment: initial; background-clip: initial; background-color: transparent; background-image: initial; background-origin: initial; border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; color: black; font-size: 14px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;"&gt;[[&lt;/span&gt;&lt;span class="pln" style="background-attachment: initial; background-clip: initial; background-color: transparent; background-image: initial; background-origin: initial; border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; color: black; font-size: 14px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;"&gt;mapView hitTest&lt;/span&gt;&lt;span class="pun" style="background-attachment: initial; background-clip: initial; background-color: transparent; background-image: initial; background-origin: initial; border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; color: black; font-size: 14px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;"&gt;:&lt;/span&gt;&lt;span class="pln" style="background-attachment: initial; background-clip: initial; background-color: transparent; background-image: initial; background-origin: initial; border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; color: black; font-size: 14px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;"&gt;pinPoint withEvent&lt;/span&gt;&lt;span class="pun" style="background-attachment: initial; background-clip: initial; background-color: transparent; background-image: initial; background-origin: initial; border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; color: black; font-size: 14px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;"&gt;:&lt;/span&gt;&lt;span class="pln" style="background-attachment: initial; background-clip: initial; background-color: transparent; background-image: initial; background-origin: initial; border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; color: black; font-size: 14px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;"&gt;nil&lt;/span&gt;&lt;span class="pun" style="background-attachment: initial; background-clip: initial; background-color: transparent; background-image: initial; background-origin: initial; border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; color: black; font-size: 14px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;"&gt;]&lt;/span&gt;&lt;span class="pln" style="background-attachment: initial; background-clip: initial; background-color: transparent; background-image: initial; background-origin: initial; border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; color: black; font-size: 14px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;"&gt; description&lt;/span&gt;&lt;span class="pun" style="background-attachment: initial; background-clip: initial; background-color: transparent; background-image: initial; background-origin: initial; border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; color: black; font-size: 14px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;"&gt;]);&lt;/span&gt;&lt;span class="pln" style="background-attachment: initial; background-clip: initial; background-color: transparent; background-image: initial; background-origin: initial; border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; color: black; font-size: 14px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;div style="background-attachment: initial; background-clip: initial; background-color: transparent; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial; border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; clear: both; font-size: 14px; margin-bottom: 1em; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline; word-wrap: break-word;"&gt;Put that inside a loop that iterates through all your pins. If the underlying view is another MKAnnotation instance, then hide that pin.&lt;/div&gt;&lt;pre class="lang-c prettyprint" style="background-attachment: initial; background-clip: initial; background-color: #eeeeee; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial; border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; font-family: Consolas, Menlo, Monaco, 'Lucida Console', 'Liberation Mono', 'DejaVu Sans Mono', 'Bitstream Vera Sans Mono', 'Courier New', monospace, serif; font-size: 14px; margin-bottom: 10px; margin-left: 0px; margin-right: 0px; margin-top: 0px; max-height: 600px; overflow-x: auto; overflow-y: auto; padding-bottom: 5px; padding-left: 5px; padding-right: 5px; padding-top: 5px; vertical-align: baseline; width: auto;"&gt;&lt;code style="background-attachment: initial; background-clip: initial; background-color: #eeeeee; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial; border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; font-family: Consolas, Menlo, Monaco, 'Lucida Console', 'Liberation Mono', 'DejaVu Sans Mono', 'Bitstream Vera Sans Mono', 'Courier New', monospace, serif; font-size: 14px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;"&gt;&lt;span class="kwd" style="background-attachment: initial; background-clip: initial; background-color: transparent; background-image: initial; background-origin: initial; border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; color: darkblue; font-size: 14px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;"&gt;if&lt;/span&gt;&lt;span class="pun" style="background-attachment: initial; background-clip: initial; background-color: transparent; background-image: initial; background-origin: initial; border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; color: black; font-size: 14px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;"&gt;([[&lt;/span&gt;&lt;span class="pln" style="background-attachment: initial; background-clip: initial; background-color: transparent; background-image: initial; background-origin: initial; border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; color: black; font-size: 14px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;"&gt;mapView hitTest&lt;/span&gt;&lt;span class="pun" style="background-attachment: initial; background-clip: initial; background-color: transparent; background-image: initial; background-origin: initial; border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; color: black; font-size: 14px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;"&gt;:&lt;/span&gt;&lt;span class="pln" style="background-attachment: initial; background-clip: initial; background-color: transparent; background-image: initial; background-origin: initial; border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; color: black; font-size: 14px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;"&gt;pinPoint withEvent&lt;/span&gt;&lt;span class="pun" style="background-attachment: initial; background-clip: initial; background-color: transparent; background-image: initial; background-origin: initial; border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; color: black; font-size: 14px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;"&gt;:&lt;/span&gt;&lt;span class="pln" style="background-attachment: initial; background-clip: initial; background-color: transparent; background-image: initial; background-origin: initial; border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; color: black; font-size: 14px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;"&gt;nil&lt;/span&gt;&lt;span class="pun" style="background-attachment: initial; background-clip: initial; background-color: transparent; background-image: initial; background-origin: initial; border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; color: black; font-size: 14px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;"&gt;]&lt;/span&gt;&lt;span class="pln" style="background-attachment: initial; background-clip: initial; background-color: transparent; background-image: initial; background-origin: initial; border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; color: black; font-size: 14px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;"&gt; isKindOfClass&lt;/span&gt;&lt;span class="pun" style="background-attachment: initial; background-clip: initial; background-color: transparent; background-image: initial; background-origin: initial; border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; color: black; font-size: 14px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;"&gt;:[&lt;/span&gt;&lt;span class="typ" style="background-attachment: initial; background-clip: initial; background-color: transparent; background-image: initial; background-origin: initial; border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; color: #2b91af; font-size: 14px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;"&gt;FFMapPinView&lt;/span&gt;&lt;span class="pln" style="background-attachment: initial; background-clip: initial; background-color: transparent; background-image: initial; background-origin: initial; border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; color: black; font-size: 14px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;"&gt; &lt;/span&gt;&lt;span class="kwd" style="background-attachment: initial; background-clip: initial; background-color: transparent; background-image: initial; background-origin: initial; border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; color: darkblue; font-size: 14px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;"&gt;class&lt;/span&gt;&lt;span class="pun" style="background-attachment: initial; background-clip: initial; background-color: transparent; background-image: initial; background-origin: initial; border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; color: black; font-size: 14px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;"&gt;]])&lt;/span&gt;&lt;span class="pln" style="background-attachment: initial; background-clip: initial; background-color: transparent; background-image: initial; background-origin: initial; border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; color: black; font-size: 14px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;"&gt;&lt;br /&gt;&amp;nbsp; &amp;nbsp; pinView&lt;/span&gt;&lt;span class="pun" style="background-attachment: initial; background-clip: initial; background-color: transparent; background-image: initial; background-origin: initial; border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; color: black; font-size: 14px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;"&gt;.&lt;/span&gt;&lt;span class="pln" style="background-attachment: initial; background-clip: initial; background-color: transparent; background-image: initial; background-origin: initial; border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; color: black; font-size: 14px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;"&gt;hidden &lt;/span&gt;&lt;span class="pun" style="background-attachment: initial; background-clip: initial; background-color: transparent; background-image: initial; background-origin: initial; border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; color: black; font-size: 14px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;"&gt;=&lt;/span&gt;&lt;span class="pln" style="background-attachment: initial; background-clip: initial; background-color: transparent; background-image: initial; background-origin: initial; border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; color: black; font-size: 14px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;"&gt; YES&lt;/span&gt;&lt;span class="pun" style="background-attachment: initial; background-clip: initial; background-color: transparent; background-image: initial; background-origin: initial; border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; color: black; font-size: 14px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;"&gt;;&lt;/span&gt;&lt;span class="pln" style="background-attachment: initial; background-clip: initial; background-color: transparent; background-image: initial; background-origin: initial; border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; color: black; font-size: 14px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;div style="background-attachment: initial; background-clip: initial; background-color: transparent; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial; border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; clear: both; font-size: 14px; margin-bottom: 1em; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline; word-wrap: break-word;"&gt;For this to work properly, you need the pinsArray to be ordered so that index 0 is the frontmost pin&lt;/div&gt;&lt;/span&gt;&lt;/li&gt;&lt;/ol&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: Arial, 'Liberation Sans', 'DejaVu Sans', sans-serif;"&gt;&lt;span class="Apple-style-span" style="border-collapse: collapse; font-size: 14px; line-height: 18px;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: Arial, 'Liberation Sans', 'DejaVu Sans', sans-serif;"&gt;&lt;span class="Apple-style-span" style="border-collapse: collapse; font-size: 14px; line-height: 18px;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-size: large;"&gt;Animation to expand a pin&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="border-collapse: collapse; font-family: Arial, 'Liberation Sans', 'DejaVu Sans', sans-serif; font-size: 14px; line-height: 18px;"&gt;Making the pins expand from the cluster center is actually pretty easy. When you make the new single-pin annotations, set their coordinates to the cluster center:&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="border-collapse: collapse; font-family: Arial, 'Liberation Sans', 'DejaVu Sans', sans-serif; font-size: 14px; line-height: 18px;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="border-collapse: collapse; font-family: Arial, 'Liberation Sans', 'DejaVu Sans', sans-serif; font-size: 14px; line-height: 18px;"&gt;&lt;/span&gt;&lt;br /&gt;&lt;pre class="default prettyprint" style="background-attachment: initial; background-clip: initial; background-color: #eeeeee; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial; border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; font-family: Consolas, Menlo, Monaco, 'Lucida Console', 'Liberation Mono', 'DejaVu Sans Mono', 'Bitstream Vera Sans Mono', 'Courier New', monospace, serif; font-size: 14px; margin-bottom: 10px; margin-left: 0px; margin-right: 0px; margin-top: 0px; max-height: 600px; overflow-x: auto; overflow-y: auto; padding-bottom: 5px; padding-left: 5px; padding-right: 5px; padding-top: 5px; vertical-align: baseline; width: auto;"&gt;&lt;span class="Apple-style-span" style="border-collapse: collapse; font-family: Arial, 'Liberation Sans', 'DejaVu Sans', sans-serif; font-size: 14px; line-height: 18px;"&gt;&lt;code style="background-attachment: initial; background-clip: initial; background-color: #eeeeee; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial; border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; font-family: Consolas, Menlo, Monaco, 'Lucida Console', 'Liberation Mono', 'DejaVu Sans Mono', 'Bitstream Vera Sans Mono', 'Courier New', monospace, serif; font-size: 14px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;"&gt;&lt;span class="pln" style="background-attachment: initial; background-clip: initial; background-color: transparent; background-image: initial; background-origin: initial; border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; color: black; font-size: 14px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;"&gt;id &lt;/span&gt;&lt;span class="pun" style="background-attachment: initial; background-clip: initial; background-color: transparent; background-image: initial; background-origin: initial; border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; color: black; font-size: 14px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;"&gt;&amp;lt;&lt;/span&gt;&lt;span class="typ" style="background-attachment: initial; background-clip: initial; background-color: transparent; background-image: initial; background-origin: initial; border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; color: #2b91af; font-size: 14px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;"&gt;MKAnnotation&lt;/span&gt;&lt;span class="pun" style="background-attachment: initial; background-clip: initial; background-color: transparent; background-image: initial; background-origin: initial; border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; color: black; font-size: 14px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;"&gt;&amp;gt;&lt;/span&gt;&lt;span class="pln" style="background-attachment: initial; background-clip: initial; background-color: transparent; background-image: initial; background-origin: initial; border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; color: black; font-size: 14px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;"&gt; pin&lt;/span&gt;&lt;span class="pun" style="background-attachment: initial; background-clip: initial; background-color: transparent; background-image: initial; background-origin: initial; border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; color: black; font-size: 14px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;"&gt;;&lt;/span&gt;&lt;span class="pln" style="background-attachment: initial; background-clip: initial; background-color: transparent; background-image: initial; background-origin: initial; border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; color: black; font-size: 14px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span class="typ" style="background-attachment: initial; background-clip: initial; background-color: transparent; background-image: initial; background-origin: initial; border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; color: #2b91af; font-size: 14px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;"&gt;CLLocationCoordinate2D&lt;/span&gt;&lt;span class="pln" style="background-attachment: initial; background-clip: initial; background-color: transparent; background-image: initial; background-origin: initial; border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; color: black; font-size: 14px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;"&gt; clusterCenter&lt;/span&gt;&lt;span class="pun" style="background-attachment: initial; background-clip: initial; background-color: transparent; background-image: initial; background-origin: initial; border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; color: black; font-size: 14px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;"&gt;;&lt;/span&gt;&lt;span class="pln" style="background-attachment: initial; background-clip: initial; background-color: transparent; background-image: initial; background-origin: initial; border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; color: black; font-size: 14px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span class="com" style="background-attachment: initial; background-clip: initial; background-color: transparent; background-image: initial; background-origin: initial; border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; color: grey; font-size: 14px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;"&gt;// ...&lt;/span&gt;&lt;span class="pln" style="background-attachment: initial; background-clip: initial; background-color: transparent; background-image: initial; background-origin: initial; border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; color: black; font-size: 14px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;"&gt;&lt;br /&gt;pin&lt;/span&gt;&lt;span class="pun" style="background-attachment: initial; background-clip: initial; background-color: transparent; background-image: initial; background-origin: initial; border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; color: black; font-size: 14px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;"&gt;.&lt;/span&gt;&lt;span class="pln" style="background-attachment: initial; background-clip: initial; background-color: transparent; background-image: initial; background-origin: initial; border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; color: black; font-size: 14px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;"&gt;coordinate &lt;/span&gt;&lt;span class="pun" style="background-attachment: initial; background-clip: initial; background-color: transparent; background-image: initial; background-origin: initial; border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; color: black; font-size: 14px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;"&gt;=&lt;/span&gt;&lt;span class="pln" style="background-attachment: initial; background-clip: initial; background-color: transparent; background-image: initial; background-origin: initial; border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; color: black; font-size: 14px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;"&gt; clusterCenter&lt;/span&gt;&lt;span class="pun" style="background-attachment: initial; background-clip: initial; background-color: transparent; background-image: initial; background-origin: initial; border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; color: black; font-size: 14px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;"&gt;;&lt;/span&gt;&lt;/code&gt;&lt;/span&gt;&lt;/pre&gt;&lt;span class="Apple-style-span" style="border-collapse: collapse; font-family: Arial, 'Liberation Sans', 'DejaVu Sans', sans-serif; font-size: 14px; line-height: 18px;"&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="border-collapse: collapse; font-family: Arial, 'Liberation Sans', 'DejaVu Sans', sans-serif; font-size: 14px; line-height: 18px;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="border-collapse: collapse; font-family: Arial, 'Liberation Sans', 'DejaVu Sans', sans-serif; font-size: 14px; line-height: 18px;"&gt;&lt;span class="Apple-style-span" style="font-size: 13px; line-height: 12px;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;div class="post-text" style="background-attachment: initial; background-clip: initial; background-color: transparent; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial; border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; font-size: 14px; line-height: 18px; margin-bottom: 5px; margin-left: 0px; margin-right: 5px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline; width: 660px;"&gt;&lt;div style="background-attachment: initial; background-clip: initial; background-color: transparent; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial; border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; clear: both; font-size: 14px; margin-bottom: 1em; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline; word-wrap: break-word;"&gt;&lt;span class="Apple-style-span" style="border-collapse: collapse; font-family: Arial, 'Liberation Sans', 'DejaVu Sans', sans-serif; font-size: 14px; line-height: 18px;"&gt;&lt;span class="Apple-style-span" style="font-size: 13px; line-height: 12px;"&gt;In&amp;nbsp;&lt;code style="background-attachment: initial; background-clip: initial; background-color: #eeeeee; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial; border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; font-family: Consolas, Menlo, Monaco, 'Lucida Console', 'Liberation Mono', 'DejaVu Sans Mono', 'Bitstream Vera Sans Mono', 'Courier New', monospace, serif; font-size: 14px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 1px; padding-left: 5px; padding-right: 5px; padding-top: 1px; vertical-align: baseline;"&gt;viewForAnnotation:&lt;/code&gt;, don't animate the new pins:&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;pre class="default prettyprint" style="background-attachment: initial; background-clip: initial; background-color: #eeeeee; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial; border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; font-family: Consolas, Menlo, Monaco, 'Lucida Console', 'Liberation Mono', 'DejaVu Sans Mono', 'Bitstream Vera Sans Mono', 'Courier New', monospace, serif; font-size: 14px; margin-bottom: 10px; margin-left: 0px; margin-right: 0px; margin-top: 0px; max-height: 600px; overflow-x: auto; overflow-y: auto; padding-bottom: 5px; padding-left: 5px; padding-right: 5px; padding-top: 5px; vertical-align: baseline; width: auto;"&gt;&lt;span class="Apple-style-span" style="border-collapse: collapse; font-family: Arial, 'Liberation Sans', 'DejaVu Sans', sans-serif; font-size: 14px; line-height: 18px;"&gt;&lt;span class="Apple-style-span" style="font-size: 13px; line-height: 12px;"&gt;&lt;code style="background-attachment: initial; background-clip: initial; background-color: #eeeeee; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial; border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; font-family: Consolas, Menlo, Monaco, 'Lucida Console', 'Liberation Mono', 'DejaVu Sans Mono', 'Bitstream Vera Sans Mono', 'Courier New', monospace, serif; font-size: 14px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;"&gt;&lt;span class="typ" style="background-attachment: initial; background-clip: initial; background-color: transparent; background-image: initial; background-origin: initial; border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; color: #2b91af; font-size: 14px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;"&gt;MKPinAnnotationView&lt;/span&gt;&lt;span class="pln" style="background-attachment: initial; background-clip: initial; background-color: transparent; background-image: initial; background-origin: initial; border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; color: black; font-size: 14px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;"&gt; &lt;/span&gt;&lt;span class="pun" style="background-attachment: initial; background-clip: initial; background-color: transparent; background-image: initial; background-origin: initial; border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; color: black; font-size: 14px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;"&gt;*&lt;/span&gt;&lt;span class="pln" style="background-attachment: initial; background-clip: initial; background-color: transparent; background-image: initial; background-origin: initial; border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; color: black; font-size: 14px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;"&gt;pinView&lt;/span&gt;&lt;span class="pun" style="background-attachment: initial; background-clip: initial; background-color: transparent; background-image: initial; background-origin: initial; border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; color: black; font-size: 14px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;"&gt;;&lt;/span&gt;&lt;span class="pln" style="background-attachment: initial; background-clip: initial; background-color: transparent; background-image: initial; background-origin: initial; border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; color: black; font-size: 14px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span class="com" style="background-attachment: initial; background-clip: initial; background-color: transparent; background-image: initial; background-origin: initial; border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; color: grey; font-size: 14px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;"&gt;// ...&lt;/span&gt;&lt;span class="pln" style="background-attachment: initial; background-clip: initial; background-color: transparent; background-image: initial; background-origin: initial; border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; color: black; font-size: 14px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;"&gt;&lt;br /&gt;pinView&lt;/span&gt;&lt;span class="pun" style="background-attachment: initial; background-clip: initial; background-color: transparent; background-image: initial; background-origin: initial; border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; color: black; font-size: 14px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;"&gt;.&lt;/span&gt;&lt;span class="pln" style="background-attachment: initial; background-clip: initial; background-color: transparent; background-image: initial; background-origin: initial; border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; color: black; font-size: 14px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;"&gt;animatesDrop &lt;/span&gt;&lt;span class="pun" style="background-attachment: initial; background-clip: initial; background-color: transparent; background-image: initial; background-origin: initial; border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; color: black; font-size: 14px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;"&gt;=&lt;/span&gt;&lt;span class="pln" style="background-attachment: initial; background-clip: initial; background-color: transparent; background-image: initial; background-origin: initial; border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; color: black; font-size: 14px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;"&gt; NO&lt;/span&gt;&lt;span class="pun" style="background-attachment: initial; background-clip: initial; background-color: transparent; background-image: initial; background-origin: initial; border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; color: black; font-size: 14px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;"&gt;;&lt;/span&gt;&lt;span class="pln" style="background-attachment: initial; background-clip: initial; background-color: transparent; background-image: initial; background-origin: initial; border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; color: black; font-size: 14px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/code&gt;&lt;/span&gt;&lt;/span&gt;&lt;/pre&gt;&lt;div style="background-attachment: initial; background-clip: initial; background-color: transparent; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial; border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; clear: both; font-size: 14px; margin-bottom: 1em; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline; word-wrap: break-word;"&gt;&lt;span class="Apple-style-span" style="border-collapse: collapse; font-family: Arial, 'Liberation Sans', 'DejaVu Sans', sans-serif; font-size: 14px; line-height: 18px;"&gt;&lt;span class="Apple-style-span" style="font-size: 13px; line-height: 12px;"&gt;Then, after you've added the pins to the map view, you'll animate moving them to their real positions:&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;pre class="default prettyprint" style="background-attachment: initial; background-clip: initial; background-color: #eeeeee; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial; border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; font-family: Consolas, Menlo, Monaco, 'Lucida Console', 'Liberation Mono', 'DejaVu Sans Mono', 'Bitstream Vera Sans Mono', 'Courier New', monospace, serif; font-size: 14px; margin-bottom: 10px; margin-left: 0px; margin-right: 0px; margin-top: 0px; max-height: 600px; overflow-x: auto; overflow-y: auto; padding-bottom: 5px; padding-left: 5px; padding-right: 5px; padding-top: 5px; vertical-align: baseline; width: auto;"&gt;&lt;span class="Apple-style-span" style="border-collapse: collapse; font-family: Arial, 'Liberation Sans', 'DejaVu Sans', sans-serif; font-size: 14px; line-height: 18px;"&gt;&lt;span class="Apple-style-span" style="font-size: 13px; line-height: 12px;"&gt;&lt;code style="background-attachment: initial; background-clip: initial; background-color: #eeeeee; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial; border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; font-family: Consolas, Menlo, Monaco, 'Lucida Console', 'Liberation Mono', 'DejaVu Sans Mono', 'Bitstream Vera Sans Mono', 'Courier New', monospace, serif; font-size: 14px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;"&gt;&lt;span class="typ" style="background-attachment: initial; background-clip: initial; background-color: transparent; background-image: initial; background-origin: initial; border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; color: #2b91af; font-size: 14px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;"&gt;MKMapView&lt;/span&gt;&lt;span class="pln" style="background-attachment: initial; background-clip: initial; background-color: transparent; background-image: initial; background-origin: initial; border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; color: black; font-size: 14px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;"&gt; &lt;/span&gt;&lt;span class="pun" style="background-attachment: initial; background-clip: initial; background-color: transparent; background-image: initial; background-origin: initial; border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; color: black; font-size: 14px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;"&gt;*&lt;/span&gt;&lt;span class="pln" style="background-attachment: initial; background-clip: initial; background-color: transparent; background-image: initial; background-origin: initial; border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; color: black; font-size: 14px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;"&gt;mapView&lt;/span&gt;&lt;span class="pun" style="background-attachment: initial; background-clip: initial; background-color: transparent; background-image: initial; background-origin: initial; border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; color: black; font-size: 14px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;"&gt;;&lt;/span&gt;&lt;span class="pln" style="background-attachment: initial; background-clip: initial; background-color: transparent; background-image: initial; background-origin: initial; border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; color: black; font-size: 14px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;"&gt;&lt;br /&gt;id &lt;/span&gt;&lt;span class="pun" style="background-attachment: initial; background-clip: initial; background-color: transparent; background-image: initial; background-origin: initial; border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; color: black; font-size: 14px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;"&gt;&amp;lt;&lt;/span&gt;&lt;span class="typ" style="background-attachment: initial; background-clip: initial; background-color: transparent; background-image: initial; background-origin: initial; border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; color: #2b91af; font-size: 14px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;"&gt;MKAnnotation&lt;/span&gt;&lt;span class="pun" style="background-attachment: initial; background-clip: initial; background-color: transparent; background-image: initial; background-origin: initial; border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; color: black; font-size: 14px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;"&gt;&amp;gt;&lt;/span&gt;&lt;span class="pln" style="background-attachment: initial; background-clip: initial; background-color: transparent; background-image: initial; background-origin: initial; border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; color: black; font-size: 14px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;"&gt; pin&lt;/span&gt;&lt;span class="pun" style="background-attachment: initial; background-clip: initial; background-color: transparent; background-image: initial; background-origin: initial; border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; color: black; font-size: 14px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;"&gt;;&lt;/span&gt;&lt;span class="pln" style="background-attachment: initial; background-clip: initial; background-color: transparent; background-image: initial; background-origin: initial; border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; color: black; font-size: 14px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span class="com" style="background-attachment: initial; background-clip: initial; background-color: transparent; background-image: initial; background-origin: initial; border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; color: grey; font-size: 14px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;"&gt;// ...&lt;/span&gt;&lt;span class="pln" style="background-attachment: initial; background-clip: initial; background-color: transparent; background-image: initial; background-origin: initial; border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; color: black; font-size: 14px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span class="com" style="background-attachment: initial; background-clip: initial; background-color: transparent; background-image: initial; background-origin: initial; border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; color: grey; font-size: 14px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;"&gt;// probably loop over annotations&lt;/span&gt;&lt;span class="pln" style="background-attachment: initial; background-clip: initial; background-color: transparent; background-image: initial; background-origin: initial; border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; color: black; font-size: 14px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span class="pun" style="background-attachment: initial; background-clip: initial; background-color: transparent; background-image: initial; background-origin: initial; border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; color: black; font-size: 14px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;"&gt;[&lt;/span&gt;&lt;span class="pln" style="background-attachment: initial; background-clip: initial; background-color: transparent; background-image: initial; background-origin: initial; border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; color: black; font-size: 14px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;"&gt;mapView addAnnotation&lt;/span&gt;&lt;span class="pun" style="background-attachment: initial; background-clip: initial; background-color: transparent; background-image: initial; background-origin: initial; border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; color: black; font-size: 14px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;"&gt;:&lt;/span&gt;&lt;span class="pln" style="background-attachment: initial; background-clip: initial; background-color: transparent; background-image: initial; background-origin: initial; border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; color: black; font-size: 14px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;"&gt;pin&lt;/span&gt;&lt;span class="pun" style="background-attachment: initial; background-clip: initial; background-color: transparent; background-image: initial; background-origin: initial; border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; color: black; font-size: 14px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;"&gt;];&lt;/span&gt;&lt;span class="pln" style="background-attachment: initial; background-clip: initial; background-color: transparent; background-image: initial; background-origin: initial; border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; color: black; font-size: 14px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span class="typ" style="background-attachment: initial; background-clip: initial; background-color: transparent; background-image: initial; background-origin: initial; border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; color: #2b91af; font-size: 14px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;"&gt;NSTimeInterval&lt;/span&gt;&lt;span class="pln" style="background-attachment: initial; background-clip: initial; background-color: transparent; background-image: initial; background-origin: initial; border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; color: black; font-size: 14px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;"&gt; interval &lt;/span&gt;&lt;span class="pun" style="background-attachment: initial; background-clip: initial; background-color: transparent; background-image: initial; background-origin: initial; border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; color: black; font-size: 14px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;"&gt;=&lt;/span&gt;&lt;span class="pln" style="background-attachment: initial; background-clip: initial; background-color: transparent; background-image: initial; background-origin: initial; border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; color: black; font-size: 14px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;"&gt; &lt;/span&gt;&lt;span class="lit" style="background-attachment: initial; background-clip: initial; background-color: transparent; background-image: initial; background-origin: initial; border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; color: maroon; font-size: 14px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;"&gt;1.0&lt;/span&gt;&lt;span class="pun" style="background-attachment: initial; background-clip: initial; background-color: transparent; background-image: initial; background-origin: initial; border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; color: black; font-size: 14px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;"&gt;;&lt;/span&gt;&lt;span class="pln" style="background-attachment: initial; background-clip: initial; background-color: transparent; background-image: initial; background-origin: initial; border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; color: black; font-size: 14px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;"&gt; &lt;/span&gt;&lt;span class="com" style="background-attachment: initial; background-clip: initial; background-color: transparent; background-image: initial; background-origin: initial; border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; color: grey; font-size: 14px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;"&gt;// or whatever&lt;/span&gt;&lt;span class="pln" style="background-attachment: initial; background-clip: initial; background-color: transparent; background-image: initial; background-origin: initial; border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; color: black; font-size: 14px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span class="pun" style="background-attachment: initial; background-clip: initial; background-color: transparent; background-image: initial; background-origin: initial; border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; color: black; font-size: 14px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;"&gt;[&lt;/span&gt;&lt;span class="typ" style="background-attachment: initial; background-clip: initial; background-color: transparent; background-image: initial; background-origin: initial; border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; color: #2b91af; font-size: 14px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;"&gt;UIView&lt;/span&gt;&lt;span class="pln" style="background-attachment: initial; background-clip: initial; background-color: transparent; background-image: initial; background-origin: initial; border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; color: black; font-size: 14px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;"&gt; animateWithDuration&lt;/span&gt;&lt;span class="pun" style="background-attachment: initial; background-clip: initial; background-color: transparent; background-image: initial; background-origin: initial; border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; color: black; font-size: 14px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;"&gt;:&lt;/span&gt;&lt;span class="pln" style="background-attachment: initial; background-clip: initial; background-color: transparent; background-image: initial; background-origin: initial; border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; color: black; font-size: 14px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;"&gt;interval animations&lt;/span&gt;&lt;span class="pun" style="background-attachment: initial; background-clip: initial; background-color: transparent; background-image: initial; background-origin: initial; border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; color: black; font-size: 14px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;"&gt;:^{&lt;/span&gt;&lt;span class="pln" style="background-attachment: initial; background-clip: initial; background-color: transparent; background-image: initial; background-origin: initial; border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; color: black; font-size: 14px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;"&gt;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span class="com" style="background-attachment: initial; background-clip: initial; background-color: transparent; background-image: initial; background-origin: initial; border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; color: grey; font-size: 14px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;"&gt;// probably loop over annotations here again&lt;/span&gt;&lt;span class="pln" style="background-attachment: initial; background-clip: initial; background-color: transparent; background-image: initial; background-origin: initial; border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; color: black; font-size: 14px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;"&gt;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span class="typ" style="background-attachment: initial; background-clip: initial; background-color: transparent; background-image: initial; background-origin: initial; border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; color: #2b91af; font-size: 14px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;"&gt;CLLocationCoordinate2D&lt;/span&gt;&lt;span class="pln" style="background-attachment: initial; background-clip: initial; background-color: transparent; background-image: initial; background-origin: initial; border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; color: black; font-size: 14px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;"&gt; realCoord&lt;/span&gt;&lt;span class="pun" style="background-attachment: initial; background-clip: initial; background-color: transparent; background-image: initial; background-origin: initial; border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; color: black; font-size: 14px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;"&gt;;&lt;/span&gt;&lt;span class="pln" style="background-attachment: initial; background-clip: initial; background-color: transparent; background-image: initial; background-origin: initial; border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; color: black; font-size: 14px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;"&gt;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span class="com" style="background-attachment: initial; background-clip: initial; background-color: transparent; background-image: initial; background-origin: initial; border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; color: grey; font-size: 14px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;"&gt;// ...&lt;/span&gt;&lt;span class="pln" style="background-attachment: initial; background-clip: initial; background-color: transparent; background-image: initial; background-origin: initial; border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; color: black; font-size: 14px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;"&gt;&lt;br /&gt;&amp;nbsp; &amp;nbsp; pin&lt;/span&gt;&lt;span class="pun" style="background-attachment: initial; background-clip: initial; background-color: transparent; background-image: initial; background-origin: initial; border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; color: black; font-size: 14px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;"&gt;.&lt;/span&gt;&lt;span class="pln" style="background-attachment: initial; background-clip: initial; background-color: transparent; background-image: initial; background-origin: initial; border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; color: black; font-size: 14px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;"&gt;coordinate &lt;/span&gt;&lt;span class="pun" style="background-attachment: initial; background-clip: initial; background-color: transparent; background-image: initial; background-origin: initial; border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; color: black; font-size: 14px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;"&gt;=&lt;/span&gt;&lt;span class="pln" style="background-attachment: initial; background-clip: initial; background-color: transparent; background-image: initial; background-origin: initial; border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; color: black; font-size: 14px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;"&gt; realCoord&lt;/span&gt;&lt;span class="pun" style="background-attachment: initial; background-clip: initial; background-color: transparent; background-image: initial; background-origin: initial; border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; color: black; font-size: 14px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;"&gt;;&lt;/span&gt;&lt;span class="pln" style="background-attachment: initial; background-clip: initial; background-color: transparent; background-image: initial; background-origin: initial; border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; color: black; font-size: 14px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span class="pun" style="background-attachment: initial; background-clip: initial; background-color: transparent; background-image: initial; background-origin: initial; border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; color: black; font-size: 14px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;"&gt;}];&lt;/span&gt;&lt;span class="pln" style="background-attachment: initial; background-clip: initial; background-color: transparent; background-image: initial; background-origin: initial; border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; color: black; font-size: 14px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/code&gt;&lt;/span&gt;&lt;/span&gt;&lt;/pre&gt;&lt;div style="background-attachment: initial; background-clip: initial; background-color: transparent; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial; border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; clear: both; font-size: 14px; margin-bottom: 1em; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline; word-wrap: break-word;"&gt;&lt;span class="Apple-style-span" style="border-collapse: collapse; font-family: Arial, 'Liberation Sans', 'DejaVu Sans', sans-serif; font-size: 14px; line-height: 18px;"&gt;&lt;span class="Apple-style-span" style="font-size: 13px; line-height: 12px;"&gt;As for the problem of non-clustered pins, that's harder to answer without knowing the implementation in detail, but I think there are lots of possibilities. You could just have a simple flag that skips the animation. Or you could just treat them exactly the same, and still "cluster" them even when they're solo, and still animate them ... not maximally efficient, but it would work and your code would be cleaner.&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="border-collapse: collapse; font-family: Arial, 'Liberation Sans', 'DejaVu Sans', sans-serif; font-size: 14px; line-height: 18px;"&gt;&lt;span class="Apple-style-span" style="font-size: 13px; line-height: 12px;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;span class="Apple-style-span" style="border-collapse: collapse; font-family: Arial, 'Liberation Sans', 'DejaVu Sans', sans-serif; font-size: 14px; line-height: 18px;"&gt;&lt;span class="Apple-style-span" style="font-size: 13px; line-height: 12px;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="border-collapse: collapse; font-family: Arial, 'Liberation Sans', 'DejaVu Sans', sans-serif; font-size: 14px; line-height: 18px;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="border-collapse: collapse; font-family: Arial, 'Liberation Sans', 'DejaVu Sans', sans-serif; font-size: 14px; line-height: 18px;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="border-collapse: collapse; font-family: Arial, 'Liberation Sans', 'DejaVu Sans', sans-serif; font-size: 14px; line-height: 18px;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4996441835700536347-8461522242602916817?l=i-phone-dev.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://i-phone-dev.blogspot.com/feeds/8461522242602916817/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://i-phone-dev.blogspot.com/2011/12/iphone-map-kit-cluster-pin-and.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4996441835700536347/posts/default/8461522242602916817'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4996441835700536347/posts/default/8461522242602916817'/><link rel='alternate' type='text/html' href='http://i-phone-dev.blogspot.com/2011/12/iphone-map-kit-cluster-pin-and.html' title='iPhone Map kit cluster, pin and animation'/><author><name>Anon</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4996441835700536347.post-990168906440454408</id><published>2011-11-30T04:54:00.001-08:00</published><updated>2011-12-09T01:17:36.149-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='memory allocation'/><category scheme='http://www.blogger.com/atom/ns#' term='debug'/><category scheme='http://www.blogger.com/atom/ns#' term='xcode'/><category scheme='http://www.blogger.com/atom/ns#' term='gdb'/><category scheme='http://www.blogger.com/atom/ns#' term='iphone'/><category scheme='http://www.blogger.com/atom/ns#' term='objective c'/><title type='text'>Debugging iPhone program in XCode</title><content type='html'>A programmer need to debug his program constantly. Debugging in Xcode seems quite complicated. Sometimes in the log output it gives a comprehensible output about a crash or problem, but when you go to the advance level of the program, you may not find all the things you want to debug your program.&lt;br /&gt;Here I will try to document some tips to debug in Xcode. Starting from basic to advanced.&lt;br /&gt;&lt;br /&gt;I am using XCode 4.2&lt;br /&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-size: x-large;"&gt;&lt;b&gt;Console output&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;The first thing to do in debug is to use the console output. You can use NSLog() for this purpose.&lt;br /&gt;Remember to enable the console screen on top right corner of Xcode editor.&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://4.bp.blogspot.com/-uv2kaSUStFI/TtYpWrU8StI/AAAAAAAAAKE/-7CFse6K_20/s1600/Screen+shot+2011-11-30+at+13.59.14.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://4.bp.blogspot.com/-uv2kaSUStFI/TtYpWrU8StI/AAAAAAAAAKE/-7CFse6K_20/s1600/Screen+shot+2011-11-30+at+13.59.14.png" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;You get output screen below your editor. Play with options "Local", "All output" etc. &lt;br /&gt;&lt;br /&gt;&lt;table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td style="text-align: center;"&gt;&lt;a href="http://4.bp.blogspot.com/-dGQYoVDzvIM/TtYpiL_cI0I/AAAAAAAAAKM/FmygNwjQ7zY/s1600/Screen+shot+2011-11-30+at+14.00.08+1.png" imageanchor="1" style="margin-left: auto; margin-right: auto;"&gt;&lt;img border="0" src="http://4.bp.blogspot.com/-dGQYoVDzvIM/TtYpiL_cI0I/AAAAAAAAAKM/FmygNwjQ7zY/s1600/Screen+shot+2011-11-30+at+14.00.08+1.png" /&gt;&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td class="tr-caption" style="text-align: center;"&gt;Xcode console&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;br /&gt;&lt;div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;"&gt;You can run the debugger with the output screen each you run the app, for this you have to a little configuration.&amp;nbsp;&lt;/div&gt;&lt;div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;"&gt;Go to Product -&amp;gt; Edit scheme -&amp;gt; Select Run in the left pane -&amp;gt; Choose Info tab -&amp;gt; Debugger should be GDB or LLDB, do not set None.&amp;nbsp;&lt;/div&gt;&lt;div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;"&gt;Also choose Diagnostics tab and Select "Enable Zombie Objects" to see unwanted memory release crashes.&lt;br /&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-size: large;"&gt;Breakpoint and Global breakpoint&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: inherit;"&gt;It is handy to debug by setting a breakpoint to&amp;nbsp;&lt;span class="Apple-style-span" style="color: #333333; line-height: 18px;"&gt;&lt;b&gt;objc_exception_throw&lt;/b&gt;(). In the breakpoint navigator &amp;nbsp;pane (Meta-6) you can add a &amp;nbsp;new symbolic breakpoint to&amp;nbsp;&lt;/span&gt;&lt;span class="Apple-style-span" style="color: #333333; line-height: 18px;"&gt;objc_exception_throw. You can make it project level or workspace level. The location can be&amp;nbsp;&lt;/span&gt;&lt;span class="Apple-style-span" style="border-collapse: collapse; font-size: 14px; line-height: 18px;"&gt;"libobjc.A.dylib".&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="color: #333333; font-size: 12px; line-height: 18px;"&gt;&lt;span class="Apple-style-span" style="font-family: inherit;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="border-collapse: collapse; font-family: Arial, 'Liberation Sans', 'DejaVu Sans', sans-serif; font-size: 14px; line-height: 18px;"&gt;Another one is the "+[NSException raise:format:arguments:]" breakpoint and its location should be "CoreFoundation"&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="border-collapse: collapse; font-family: Arial, 'Liberation Sans', 'DejaVu Sans', sans-serif; font-size: 14px; line-height: 18px;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-size: large;"&gt;Using gdb&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="border-collapse: collapse; line-height: 18px;"&gt;&lt;/span&gt;&lt;br /&gt;&lt;div style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; clear: both; margin-bottom: 1em; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline; word-wrap: break-word;"&gt;&lt;code style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 1px; padding-left: 5px; padding-right: 5px; padding-top: 1px; vertical-align: baseline;"&gt;&lt;span class="Apple-style-span" style="background-color: white; font-family: Times, 'Times New Roman', serif;"&gt;You can use po - print object to print the symbol in a particular memory location.&amp;nbsp;&lt;/span&gt;&lt;/code&gt;&lt;/div&gt;&lt;div style="background-attachment: initial; background-clip: initial; background-color: transparent; background-image: initial; background-origin: initial; border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; clear: both; font-family: Arial, 'Liberation Sans', 'DejaVu Sans', sans-serif; font-size: 14px; margin-bottom: 1em; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline; word-wrap: break-word;"&gt;&lt;code style="background-attachment: initial; background-clip: initial; background-color: #eeeeee; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial; border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; font-family: Consolas, Menlo, Monaco, 'Lucida Console', 'Liberation Mono', 'DejaVu Sans Mono', 'Bitstream Vera Sans Mono', 'Courier New', monospace, serif; font-size: 14px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 1px; padding-left: 5px; padding-right: 5px; padding-top: 1px; vertical-align: baseline;"&gt;po 0x112d0&lt;/code&gt;&lt;/div&gt;&lt;span class="Apple-style-span" style="border-collapse: collapse; font-family: Arial, 'Liberation Sans', 'DejaVu Sans', sans-serif; font-size: 14px; line-height: 18px;"&gt;You can even call methods, like&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="border-collapse: collapse; font-family: Arial, 'Liberation Sans', 'DejaVu Sans', sans-serif; font-size: 14px; line-height: 18px;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="border-collapse: collapse; font-family: Arial, 'Liberation Sans', 'DejaVu Sans', sans-serif; font-size: 13px; line-height: 12px;"&gt;&lt;/span&gt;&lt;br /&gt;&lt;div class="post-text" style="background-attachment: initial; background-clip: initial; background-color: transparent; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial; border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; font-size: 14px; line-height: 18px; margin-bottom: 5px; margin-left: 0px; margin-right: 5px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline; width: 660px;"&gt;&lt;div style="background-attachment: initial; background-clip: initial; background-color: transparent; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial; border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; clear: both; font-size: 14px; margin-bottom: 1em; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline; word-wrap: break-word;"&gt;&lt;span class="Apple-style-span" style="border-collapse: collapse; font-family: Arial, 'Liberation Sans', 'DejaVu Sans', sans-serif; font-size: 13px; line-height: 12px;"&gt;&lt;code style="background-attachment: initial; background-clip: initial; background-color: #eeeeee; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial; border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; font-family: Consolas, Menlo, Monaco, 'Lucida Console', 'Liberation Mono', 'DejaVu Sans Mono', 'Bitstream Vera Sans Mono', 'Courier New', monospace, serif; font-size: 14px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 1px; padding-left: 5px; padding-right: 5px; padding-top: 1px; vertical-align: baseline;"&gt;po [myArray objectAtIndex:0]&lt;/code&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style="background-attachment: initial; background-clip: initial; background-color: transparent; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial; border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; clear: both; font-size: 14px; margin-bottom: 1em; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline; word-wrap: break-word;"&gt;&lt;span class="Apple-style-span" style="border-collapse: collapse; font-family: Arial, 'Liberation Sans', 'DejaVu Sans', sans-serif; font-size: 13px; line-height: 12px;"&gt;Note that it only works on objects, no for non-object stuffs. For non object stuffs use, p :&amp;nbsp;&lt;/span&gt;&lt;/div&gt;&lt;div style="background-attachment: initial; background-clip: initial; background-color: transparent; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial; border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; clear: both; font-size: 14px; margin-bottom: 1em; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline; word-wrap: break-word;"&gt;&lt;span class="Apple-style-span" style="border-collapse: collapse; font-family: Arial, 'Liberation Sans', 'DejaVu Sans', sans-serif; font-size: 13px; line-height: 12px;"&gt;&lt;code style="background-attachment: initial; background-clip: initial; background-color: #eeeeee; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial; border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; font-family: Consolas, Menlo, Monaco, 'Lucida Console', 'Liberation Mono', 'DejaVu Sans Mono', 'Bitstream Vera Sans Mono', 'Courier New', monospace, serif; font-size: 14px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 1px; padding-left: 5px; padding-right: 5px; padding-top: 1px; vertical-align: baseline;"&gt;'p 1'&lt;/code&gt;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;span class="Apple-style-span" style="color: #333333;"&gt;&lt;/span&gt;&lt;br /&gt;&lt;h4 style="color: black; font-weight: lighter; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 4px; padding-left: 0px; padding-right: 0px; padding-top: 8px;"&gt;&lt;span class="Apple-style-span" style="color: #333333;"&gt;&lt;span class="Apple-style-span" style="font-family: inherit; font-size: large;"&gt;"info symbol": get the symbolic name for an address&lt;/span&gt;&lt;/span&gt;&lt;/h4&gt;&lt;div style="font-size: 13px;"&gt;&lt;span class="Apple-style-span" style="color: #333333;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;The gdb command I'm going to discuss here is info symbol address which returns the name of any variable or code associated with the memory location given by address.&lt;br /&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;info symbol 0xa0b05174&lt;/span&gt;&lt;/div&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;list *1106&lt;/span&gt;&lt;br /&gt;&lt;div&gt;is useful too as it will list your code around the line number associated with address 11706.&lt;br /&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-size: x-large;"&gt;&lt;b&gt;Enable NSZombie&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;Enabling zombie can trace the allocated object that is deallocated and you are still referencing to that object. This one of the main reason for app crash.&lt;br /&gt;Earlier in xcode you have to enable NSZombie as an environment variable. Now you can do that by Product -&amp;gt; Edit Scheme, select Run options, then in the Diagnostic tab check the "Enable Zombie Objects".&lt;br /&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://3.bp.blogspot.com/-OxE86PLBnJc/TuHRwgPH_SI/AAAAAAAAAKU/nFfORZbZmMo/s1600/Screen+shot+2011-12-09+at+10.07.52.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="433" src="http://3.bp.blogspot.com/-OxE86PLBnJc/TuHRwgPH_SI/AAAAAAAAAKU/nFfORZbZmMo/s640/Screen+shot+2011-12-09+at+10.07.52.png" width="640" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;div style="font: 12.0px Helvetica; margin: 0.0px 0.0px 0.0px 0.0px;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="font: 12.0px Helvetica; margin: 0.0px 0.0px 0.0px 0.0px;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="background-attachment: initial; background-clip: initial; background-color: #ffffbf; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial; border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; color: black; direction: ltr; font-family: arial, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; height: auto; line-height: normal; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-align: left; width: auto; z-index: 99995;"&gt;&lt;/div&gt;&lt;div style="background-attachment: initial; background-clip: initial; background-color: #ffffbf; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial; border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; color: black; direction: ltr; font-family: arial, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; height: auto; line-height: normal; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-align: left; width: auto; z-index: 99995;"&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4996441835700536347-990168906440454408?l=i-phone-dev.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://i-phone-dev.blogspot.com/feeds/990168906440454408/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://i-phone-dev.blogspot.com/2011/11/debugging-iphone-program-in-xcode.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4996441835700536347/posts/default/990168906440454408'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4996441835700536347/posts/default/990168906440454408'/><link rel='alternate' type='text/html' href='http://i-phone-dev.blogspot.com/2011/11/debugging-iphone-program-in-xcode.html' title='Debugging iPhone program in XCode'/><author><name>Anon</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://4.bp.blogspot.com/-uv2kaSUStFI/TtYpWrU8StI/AAAAAAAAAKE/-7CFse6K_20/s72-c/Screen+shot+2011-11-30+at+13.59.14.png' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4996441835700536347.post-831074814927615317</id><published>2011-11-24T00:59:00.001-08:00</published><updated>2011-12-16T07:37:36.021-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='mapview'/><category scheme='http://www.blogger.com/atom/ns#' term='iphone programming'/><category scheme='http://www.blogger.com/atom/ns#' term='map'/><category scheme='http://www.blogger.com/atom/ns#' term='location'/><category scheme='http://www.blogger.com/atom/ns#' term='geocoder'/><category scheme='http://www.blogger.com/atom/ns#' term='mapkit'/><category scheme='http://www.blogger.com/atom/ns#' term='mapviewcontroller'/><category scheme='http://www.blogger.com/atom/ns#' term='gps'/><title type='text'>iPhone UIMapView tips and tricks</title><content type='html'>&lt;div style="text-align: center;"&gt;&lt;span class="Apple-style-span" style="font-size: x-large;"&gt;&lt;u&gt;&lt;br /&gt;&lt;/u&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-size: x-large;"&gt;&lt;u&gt;Tips and tricks related to UIMapView in iPhone&lt;/u&gt;&lt;/span&gt;&lt;/div&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-size: large;"&gt;Maximum values for latitude and longitude delta&lt;/span&gt;&lt;br /&gt;When you set a region in the map view you have specify the span in distance or degrees using latitude and longitude delta.&amp;nbsp;The maximum values allows (as &lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;CLLocationDegree&lt;/span&gt;) is &lt;b&gt;180.0&lt;/b&gt; only. If you use more than that value, the map view will cause a crash to your application. But I never found that its documented in the API reference documentation.&lt;br /&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;span class="Apple-style-span" style="color: blue;"&gt;From apple's documentations, one degree of longitude spans a distance of approximately 111 kilometers (69 miles) .&lt;/span&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="color: blue;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="color: blue;"&gt;Radius: Distances from points on the surface to the center range from &lt;/span&gt;&lt;span class="Apple-style-span" style="color: blue;"&gt;&lt;a href="http://en.wikipedia.org/wiki/Earth_radius#Notable_radii"&gt;6,353 km&lt;/a&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="color: blue;"&gt; to &lt;/span&gt;&lt;span class="Apple-style-span" style="color: blue;"&gt;&lt;a href="http://en.wikipedia.org/wiki/Earth_radius#Notable_radii"&gt;6,384 km&lt;/a&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="color: blue;"&gt; (≈3,947–3,968 mi). Several different ways of modeling the Earth as a sphere each yield a convenient &lt;/span&gt;&lt;span class="Apple-style-span" style="color: blue;"&gt;&lt;a href="http://en.wikipedia.org/wiki/Earth_radius#Mean_radii"&gt;mean radius&lt;/a&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="color: blue;"&gt; of 6,371 km (≈3,959 mi).&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="color: blue;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="color: blue;"&gt;Circumference 40,075.017 km (equatorial) and&amp;nbsp;40,007.86 km (meridional)&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Heading values&lt;div&gt;&lt;div&gt;Heading values is between 0 to 360 degrees. 0 degrees for North, 90 degrees for East, 180 degrees for South and 270 degrees for West. To get the values in radians divide this value by 180 and then multiply by PI (3.1415926).&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-size: large;"&gt;Current user location&lt;/span&gt;&lt;br /&gt;Map view inherently uses CLLocation to get user location and it have callback. But its the developer's responsibility to show the correct zoom level and user's current location in the map view.&lt;br /&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-size: large;"&gt;&lt;u&gt;&lt;span class="Apple-style-span" style="font-family: Menlo;"&gt;didUpdateUserLocation &lt;/span&gt;&lt;span class="Apple-style-span" style="font-family: Times, 'Times New Roman', serif;"&gt;callback&lt;/span&gt;&lt;/u&gt;&lt;/span&gt;&lt;br /&gt;Map view can have several call to the&amp;nbsp;&lt;span class="Apple-style-span" style="font-family: Menlo; font-size: 11px;"&gt;didUpdateUserLocation &lt;/span&gt;&lt;span class="Apple-style-span" style="font-family: Times, 'Times New Roman', serif;"&gt;so its better to flag when do not need any more user location update. I found it pretty accurate on the first update. But you can check for accuracy values until you get the desired accuracy.&amp;nbsp;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: Times, 'Times New Roman', serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: Times, 'Times New Roman', serif;"&gt;&lt;/span&gt;&lt;br /&gt;&lt;div style="font: 11.0px Menlo; margin: 0.0px 0.0px 0.0px 0.0px;"&gt;&lt;span class="Apple-style-span" style="font-family: Times, 'Times New Roman', serif;"&gt;- (&lt;span style="color: #ba2da2;"&gt;void&lt;/span&gt;)mapView:(&lt;span style="color: #703daa;"&gt;MKMapView&lt;/span&gt; *)_mapView didUpdateUserLocation:(&lt;span style="color: #703daa;"&gt;MKUserLocation&lt;/span&gt; *)_userLocation {&lt;/span&gt;&lt;/div&gt;&lt;span class="Apple-style-span" style="font-family: Times, 'Times New Roman', serif;"&gt; &lt;/span&gt;&lt;br /&gt;&lt;div style="font: 11.0px Menlo; margin: 0.0px 0.0px 0.0px 0.0px;"&gt;&lt;span class="Apple-style-span" style="font-family: Times, 'Times New Roman', serif;"&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;&lt;span style="color: #ba2da2;"&gt;self&lt;/span&gt;.&lt;span style="color: #4f8187;"&gt;userLocation&lt;/span&gt; = _userLocation;&lt;/span&gt;&lt;/div&gt;&lt;div style="color: #703daa; font: 11.0px Menlo; margin: 0.0px 0.0px 0.0px 0.0px;"&gt;&lt;span class="Apple-style-span" style="font-family: Times, 'Times New Roman', serif;"&gt;&lt;span style="color: black;"&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style="color: #3d1e81;"&gt;NSLog&lt;/span&gt;&lt;span style="color: black;"&gt;(&lt;/span&gt;&lt;span style="color: #d12e1b;"&gt;@"%f"&lt;/span&gt;&lt;span style="color: black;"&gt;,&lt;/span&gt;&lt;span style="color: #ba2da2;"&gt;self&lt;/span&gt;&lt;span style="color: black;"&gt;.&lt;/span&gt;&lt;span style="color: #4f8187;"&gt;currentRegion&lt;/span&gt;&lt;span style="color: black;"&gt;.&lt;/span&gt;span&lt;span style="color: black;"&gt;.&lt;/span&gt;latitudeDelta&lt;span style="color: black;"&gt;);&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style="color: #d12e1b; font: 11.0px Menlo; margin: 0.0px 0.0px 0.0px 0.0px;"&gt;&lt;span class="Apple-style-span" style="font-family: Times, 'Times New Roman', serif;"&gt;&lt;span style="color: black;"&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style="color: #3d1e81;"&gt;NSLog&lt;/span&gt;&lt;span style="color: black;"&gt;(&lt;/span&gt;@"updated user location: %f, %f"&lt;span style="color: black;"&gt;, &lt;/span&gt;&lt;span style="color: #ba2da2;"&gt;self&lt;/span&gt;&lt;span style="color: black;"&gt;.&lt;/span&gt;&lt;span style="color: #4f8187;"&gt;userLocation&lt;/span&gt;&lt;span style="color: black;"&gt;.&lt;/span&gt;&lt;span style="color: #703daa;"&gt;location&lt;/span&gt;&lt;span style="color: black;"&gt;.&lt;/span&gt;&lt;span style="color: #703daa;"&gt;coordinate&lt;/span&gt;&lt;span style="color: black;"&gt;.&lt;/span&gt;&lt;span style="color: #703daa;"&gt;latitude&lt;/span&gt;&lt;span style="color: black;"&gt;,&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style="color: #703daa; font: 11.0px Menlo; margin: 0.0px 0.0px 0.0px 0.0px;"&gt;&lt;span class="Apple-style-span" style="font-family: Times, 'Times New Roman', serif;"&gt;&lt;span style="color: black;"&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt;  &lt;/span&gt;&amp;nbsp; &lt;/span&gt;&lt;span style="color: #ba2da2;"&gt;self&lt;/span&gt;&lt;span style="color: black;"&gt;.&lt;/span&gt;&lt;span style="color: #4f8187;"&gt;userLocation&lt;/span&gt;&lt;span style="color: black;"&gt;.&lt;/span&gt;location&lt;span style="color: black;"&gt;.&lt;/span&gt;coordinate&lt;span style="color: black;"&gt;.&lt;/span&gt;longitude&lt;span style="color: black;"&gt;);&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style="font: 11.0px Menlo; margin: 0.0px 0.0px 0.0px 0.0px; min-height: 13.0px;"&gt;&lt;span class="Apple-style-span" style="font-family: Times, 'Times New Roman', serif;"&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style="color: #4f8187; font: 11.0px Menlo; margin: 0.0px 0.0px 0.0px 0.0px;"&gt;&lt;span class="Apple-style-span" style="font-family: Times, 'Times New Roman', serif;"&gt;&lt;span style="color: black;"&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style="color: #ba2da2;"&gt;if&lt;/span&gt;&lt;span style="color: black;"&gt; (&lt;b&gt;!&lt;/b&gt;&lt;/span&gt;&lt;b&gt;isSpanInitialized&lt;/b&gt;&lt;span style="color: black;"&gt;) {&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style="font: 11.0px Menlo; margin: 0.0px 0.0px 0.0px 0.0px; min-height: 13.0px;"&gt;&lt;span class="Apple-style-span" style="font-family: Times, 'Times New Roman', serif;"&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt;  &lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style="color: #008400; font: 11.0px Menlo; margin: 0.0px 0.0px 0.0px 0.0px;"&gt;&lt;span class="Apple-style-span" style="font-family: Times, 'Times New Roman', serif;"&gt;&lt;span style="color: black;"&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt;  &lt;/span&gt;&lt;/span&gt;//find the nearest branch and ATM, then calculate span to show&lt;/span&gt;&lt;/div&gt;&lt;div style="font: 11.0px Menlo; margin: 0.0px 0.0px 0.0px 0.0px;"&gt;&lt;span class="Apple-style-span" style="font-family: Times, 'Times New Roman', serif;"&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt;  &lt;/span&gt;&lt;span style="color: #4f8187;"&gt;MapAnnotation&lt;/span&gt; * nearestATM = &lt;span style="color: #ba2da2;"&gt;nil&lt;/span&gt;, * nearestBranch = &lt;span style="color: #ba2da2;"&gt;nil&lt;/span&gt;;&lt;/span&gt;&lt;/div&gt;&lt;div style="font: 11.0px Menlo; margin: 0.0px 0.0px 0.0px 0.0px;"&gt;&lt;span class="Apple-style-span" style="font-family: Times, 'Times New Roman', serif;"&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt;  &lt;/span&gt;[&lt;span style="color: #ba2da2;"&gt;self&lt;/span&gt; &lt;span style="color: #31595e;"&gt;findNearestATM&lt;/span&gt;:&amp;amp;nearestATM &lt;span style="color: #31595e;"&gt;andBranch&lt;/span&gt;:&amp;amp;nearestBranch &lt;span style="color: #31595e;"&gt;fromLocation&lt;/span&gt;:&lt;span style="color: #ba2da2;"&gt;self&lt;/span&gt;.&lt;span style="color: #4f8187;"&gt;userLocation&lt;/span&gt;.&lt;span style="color: #703daa;"&gt;location&lt;/span&gt;];&lt;/span&gt;&lt;/div&gt;&lt;div style="font: 11.0px Menlo; margin: 0.0px 0.0px 0.0px 0.0px;"&gt;&lt;span class="Apple-style-span" style="font-family: Times, 'Times New Roman', serif;"&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt;  &lt;/span&gt;&lt;span style="color: #3d1e81;"&gt;CFShow&lt;/span&gt;(nearestATM);&lt;/span&gt;&lt;/div&gt;&lt;div style="font: 11.0px Menlo; margin: 0.0px 0.0px 0.0px 0.0px;"&gt;&lt;span class="Apple-style-span" style="font-family: Times, 'Times New Roman', serif;"&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt;  &lt;/span&gt;&lt;span style="color: #3d1e81;"&gt;CFShow&lt;/span&gt;(nearestBranch);&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style="color: #3d1e81; font: 11.0px Menlo; margin: 0.0px 0.0px 0.0px 0.0px;"&gt;&lt;span class="Apple-style-span" style="font-family: Times, 'Times New Roman', serif;"&gt;&lt;span style="color: black;"&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt;  &lt;/span&gt;&lt;/span&gt;&lt;span style="color: #703daa;"&gt;CLLocationDistance&lt;/span&gt;&lt;span style="color: black;"&gt; atmDist = &lt;/span&gt;MKMetersBetweenMapPoints&lt;span style="color: black;"&gt;(&lt;/span&gt;MKMapPointForCoordinate&lt;span style="color: black;"&gt;(nearestATM.&lt;/span&gt;&lt;span style="color: #4f8187;"&gt;coordinate&lt;/span&gt;&lt;span style="color: black;"&gt;),&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style="font: 11.0px Menlo; margin: 0.0px 0.0px 0.0px 0.0px;"&gt;&lt;span class="Apple-style-span" style="font-family: Times, 'Times New Roman', serif;"&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt;               &lt;/span&gt;&amp;nbsp; &lt;span style="color: #3d1e81;"&gt;MKMapPointForCoordinate&lt;/span&gt;(&lt;span style="color: #4f8187;"&gt;userLocation&lt;/span&gt;.&lt;span style="color: #703daa;"&gt;location&lt;/span&gt;.&lt;span style="color: #703daa;"&gt;coordinate&lt;/span&gt;));&lt;/span&gt;&lt;/div&gt;&lt;div style="color: #3d1e81; font: 11.0px Menlo; margin: 0.0px 0.0px 0.0px 0.0px;"&gt;&lt;span class="Apple-style-span" style="font-family: Times, 'Times New Roman', serif;"&gt;&lt;span style="color: black;"&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt;  &lt;/span&gt;&lt;/span&gt;&lt;span style="color: #703daa;"&gt;CLLocationDistance&lt;/span&gt;&lt;span style="color: black;"&gt; branchDist = &lt;/span&gt;MKMetersBetweenMapPoints&lt;span style="color: black;"&gt;(&lt;/span&gt;MKMapPointForCoordinate&lt;span style="color: black;"&gt;(nearestBranch.&lt;/span&gt;&lt;span style="color: #4f8187;"&gt;coordinate&lt;/span&gt;&lt;span style="color: black;"&gt;),&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style="font: 11.0px Menlo; margin: 0.0px 0.0px 0.0px 0.0px;"&gt;&lt;span class="Apple-style-span" style="font-family: Times, 'Times New Roman', serif;"&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt;                &lt;/span&gt; &lt;span style="color: #3d1e81;"&gt;MKMapPointForCoordinate&lt;/span&gt;(&lt;span style="color: #4f8187;"&gt;userLocation&lt;/span&gt;.&lt;span style="color: #703daa;"&gt;location&lt;/span&gt;.&lt;span style="color: #703daa;"&gt;coordinate&lt;/span&gt;));&lt;/span&gt;&lt;/div&gt;&lt;div style="color: #703daa; font: 11.0px Menlo; margin: 0.0px 0.0px 0.0px 0.0px;"&gt;&lt;span class="Apple-style-span" style="font-family: Times, 'Times New Roman', serif;"&gt;&lt;span style="color: black;"&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt;  &lt;/span&gt;&lt;/span&gt;CLLocationDistance&lt;span style="color: black;"&gt; maxDist;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style="font: 11.0px Menlo; margin: 0.0px 0.0px 0.0px 0.0px;"&gt;&lt;span class="Apple-style-span" style="font-family: Times, 'Times New Roman', serif;"&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt;  &lt;/span&gt;&lt;span style="color: #ba2da2;"&gt;if&lt;/span&gt; (atmDist &amp;gt; branchDist) &lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;maxDist = atmDist;&lt;/span&gt;&lt;/div&gt;&lt;div style="font: 11.0px Menlo; margin: 0.0px 0.0px 0.0px 0.0px;"&gt;&lt;span class="Apple-style-span" style="font-family: Times, 'Times New Roman', serif;"&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt;  &lt;/span&gt;&lt;span style="color: #ba2da2;"&gt;else&lt;/span&gt;&amp;nbsp; maxDist = branchDist;&lt;/span&gt;&lt;/div&gt;&lt;div style="font: 11.0px Menlo; margin: 0.0px 0.0px 0.0px 0.0px;"&gt;&lt;span class="Apple-style-span" style="font-family: Times, 'Times New Roman', serif;"&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt;  &lt;/span&gt;&lt;span style="color: #703daa;"&gt;MKCoordinateRegion&lt;/span&gt; targetRegion = &lt;span style="color: #3d1e81;"&gt;MKCoordinateRegionMakeWithDistance&lt;/span&gt;(&lt;span style="color: #4f8187;"&gt;userLocation&lt;/span&gt;.&lt;span style="color: #703daa;"&gt;location&lt;/span&gt;.&lt;span style="color: #703daa;"&gt;coordinate&lt;/span&gt;, maxDist * &lt;span style="color: #252bd8;"&gt;2&lt;/span&gt;, maxDist * &lt;span style="color: #252bd8;"&gt;2&lt;/span&gt;);&lt;/span&gt;&lt;/div&gt;&lt;div style="font: 11.0px Menlo; margin: 0.0px 0.0px 0.0px 0.0px;"&gt;&lt;span class="Apple-style-span" style="font-family: Times, 'Times New Roman', serif;"&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt;  &lt;/span&gt;&lt;span style="color: #4f8187;"&gt;currentRegion&lt;/span&gt; = targetRegion;&lt;/span&gt;&lt;/div&gt;&lt;span class="Apple-style-span" style="color: #4f8187; font-family: Menlo; font-size: 11px;"&gt;&lt;b&gt;&lt;span style="color: black;"&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt;  &lt;/span&gt;&lt;/span&gt;isSpanInitialized&lt;span style="color: black;"&gt; = &lt;/span&gt;&lt;span style="color: #ba2da2;"&gt;YES&lt;/span&gt;&lt;span style="color: black;"&gt;;&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="font-family: Times, 'Times New Roman', serif;"&gt; &lt;/span&gt;&lt;br /&gt;&lt;div style="font: 11.0px Menlo; margin: 0.0px 0.0px 0.0px 0.0px;"&gt;&lt;span class="Apple-style-span" style="font-family: Times, 'Times New Roman', serif;"&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt;  &lt;/span&gt;[_mapView &lt;span style="color: #3d1e81;"&gt;setRegion&lt;/span&gt;:&lt;span style="color: #4f8187;"&gt;currentRegion&lt;/span&gt; &lt;span style="color: #3d1e81;"&gt;animated&lt;/span&gt;:&lt;span style="color: #ba2da2;"&gt;YES&lt;/span&gt;];&lt;/span&gt;&lt;/div&gt;&lt;div style="font: 11.0px Menlo; margin: 0.0px 0.0px 0.0px 0.0px;"&gt;&lt;span class="Apple-style-span" style="font-family: Times, 'Times New Roman', serif;"&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;}&lt;/span&gt;&lt;/div&gt;&lt;div style="font: 11.0px Menlo; margin: 0.0px 0.0px 0.0px 0.0px; min-height: 13.0px;"&gt;&lt;span class="Apple-style-span" style="font-family: Times, 'Times New Roman', serif;"&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style="font: 11.0px Menlo; margin: 0.0px 0.0px 0.0px 0.0px; min-height: 13.0px;"&gt;&lt;span class="Apple-style-span" style="font-family: Times, 'Times New Roman', serif;"&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style="color: #d12e1b; font: 11.0px Menlo; margin: 0.0px 0.0px 0.0px 0.0px;"&gt;&lt;span class="Apple-style-span" style="font-family: Times, 'Times New Roman', serif;"&gt;&lt;span style="color: black;"&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style="color: #ba2da2;"&gt;self&lt;/span&gt;&lt;span style="color: black;"&gt;.&lt;/span&gt;&lt;span style="color: #4f8187;"&gt;userLocation&lt;/span&gt;&lt;span style="color: black;"&gt;.&lt;/span&gt;&lt;span style="color: #703daa;"&gt;title&lt;/span&gt;&lt;span style="color: black;"&gt; = &lt;/span&gt;@"Your location"&lt;span style="color: black;"&gt;;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style="color: #d12e1b; font: 11.0px Menlo; margin: 0.0px 0.0px 0.0px 0.0px;"&gt;&lt;span class="Apple-style-span" style="font-family: Times, 'Times New Roman', serif;"&gt;&lt;span style="color: black;"&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style="color: #ba2da2;"&gt;self&lt;/span&gt;&lt;span style="color: black;"&gt;.&lt;/span&gt;&lt;span style="color: #4f8187;"&gt;userLocation&lt;/span&gt;&lt;span style="color: black;"&gt;.&lt;/span&gt;&lt;span style="color: #703daa;"&gt;subtitle&lt;/span&gt;&lt;span style="color: black;"&gt; = [&lt;/span&gt;&lt;span style="color: #703daa;"&gt;NSString&lt;/span&gt;&lt;span style="color: black;"&gt; &lt;/span&gt;&lt;span style="color: #3d1e81;"&gt;stringWithFormat&lt;/span&gt;&lt;span style="color: black;"&gt;:&lt;/span&gt;@"(long, lat)=(%.4f %.4f)"&lt;span style="color: black;"&gt;,&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style="color: #703daa; font: 11.0px Menlo; margin: 0.0px 0.0px 0.0px 0.0px;"&gt;&lt;span class="Apple-style-span" style="font-family: Times, 'Times New Roman', serif;"&gt;&lt;span style="color: black;"&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt;        &lt;/span&gt;&amp;nbsp; &lt;/span&gt;&lt;span style="color: #ba2da2;"&gt;self&lt;/span&gt;&lt;span style="color: black;"&gt;.&lt;/span&gt;&lt;span style="color: #4f8187;"&gt;userLocation&lt;/span&gt;&lt;span style="color: black;"&gt;.&lt;/span&gt;coordinate&lt;span style="color: black;"&gt;.&lt;/span&gt;longitude&lt;span style="color: black;"&gt;,&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style="color: #703daa; font: 11.0px Menlo; margin: 0.0px 0.0px 0.0px 0.0px;"&gt;&lt;span class="Apple-style-span" style="font-family: Times, 'Times New Roman', serif;"&gt;&lt;span style="color: black;"&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt;        &lt;/span&gt;&amp;nbsp; &lt;/span&gt;&lt;span style="color: #ba2da2;"&gt;self&lt;/span&gt;&lt;span style="color: black;"&gt;.&lt;/span&gt;&lt;span style="color: #4f8187;"&gt;userLocation&lt;/span&gt;&lt;span style="color: black;"&gt;.&lt;/span&gt;coordinate&lt;span style="color: black;"&gt;.&lt;/span&gt;latitude&lt;span style="color: black;"&gt;];&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style="font: 11.0px Menlo; margin: 0.0px 0.0px 0.0px 0.0px; min-height: 13.0px;"&gt;&lt;span class="Apple-style-span" style="font-family: Times, 'Times New Roman', serif;"&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style="font: 11.0px Menlo; margin: 0.0px 0.0px 0.0px 0.0px;"&gt;&lt;span class="Apple-style-span" style="font-family: Times, 'Times New Roman', serif;"&gt;}&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: Times, 'Times New Roman', serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: Times, 'Times New Roman', serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: Times, 'Times New Roman', serif;"&gt;&lt;span class="Apple-style-span" style="font-size: large;"&gt;&lt;u&gt;Geocoder and reverse geocoder&lt;/u&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: Times, 'Times New Roman', serif;"&gt;The built in mapkit geocode sometimes fail to decode the user's current location. It seems it have limitation on the number of calls. In that case, we can use maps.google.com services directly to get the address.&amp;nbsp;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: Times, 'Times New Roman', serif;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;div style="font: 11.0px Menlo; margin: 0.0px 0.0px 0.0px 0.0px;"&gt;&lt;span class="Apple-style-span" style="font-family: Times, 'Times New Roman', serif;"&gt;- (&lt;span style="color: #ba2da2;"&gt;void&lt;/span&gt;)reverseGeocoder:(&lt;span style="color: #703daa;"&gt;MKReverseGeocoder&lt;/span&gt; *)geocoder didFailWithError:(&lt;span style="color: #703daa;"&gt;NSError&lt;/span&gt; *)error {&lt;/span&gt;&lt;/div&gt;&lt;div style="color: #d12e1b; font: 11.0px Menlo; margin: 0.0px 0.0px 0.0px 0.0px;"&gt;&lt;span class="Apple-style-span" style="font-family: Times, 'Times New Roman', serif;"&gt;&lt;span style="color: black;"&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style="color: #3d1e81;"&gt;NSLog&lt;/span&gt;&lt;span style="color: black;"&gt;(&lt;/span&gt;@"Geocoder error: %@"&lt;span style="color: black;"&gt;, [error &lt;/span&gt;&lt;span style="color: #3d1e81;"&gt;description&lt;/span&gt;&lt;span style="color: black;"&gt;]);&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style="font: 11.0px Menlo; margin: 0.0px 0.0px 0.0px 0.0px;"&gt;&lt;span class="Apple-style-span" style="font-family: Times, 'Times New Roman', serif;"&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;geocoder.&lt;span style="color: #703daa;"&gt;delegate&lt;/span&gt; = &lt;span style="color: #ba2da2;"&gt;nil&lt;/span&gt;;&lt;/span&gt;&lt;/div&gt;&lt;div style="font: 11.0px Menlo; margin: 0.0px 0.0px 0.0px 0.0px;"&gt;&lt;span class="Apple-style-span" style="font-family: Times, 'Times New Roman', serif;"&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;[geocoder &lt;span style="color: #3d1e81;"&gt;release&lt;/span&gt;];&lt;/span&gt;&lt;/div&gt;&lt;div style="font: 11.0px Menlo; margin: 0.0px 0.0px 0.0px 0.0px; min-height: 13.0px;"&gt;&lt;span class="Apple-style-span" style="font-family: Times, 'Times New Roman', serif;"&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style="color: #d12e1b; font: 11.0px Menlo; margin: 0.0px 0.0px 0.0px 0.0px;"&gt;&lt;span class="Apple-style-span" style="font-family: Times, 'Times New Roman', serif;"&gt;&lt;span style="color: black;"&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style="color: #703daa;"&gt;NSString&lt;/span&gt;&lt;span style="color: black;"&gt; *fetchURL = [&lt;/span&gt;&lt;span style="color: #703daa;"&gt;NSString&lt;/span&gt;&lt;span style="color: black;"&gt; &lt;/span&gt;&lt;span style="color: #3d1e81;"&gt;stringWithFormat&lt;/span&gt;&lt;span style="color: black;"&gt;:&lt;/span&gt;@"http://maps.google.com/maps/geo?q=%@,%@&amp;amp;amp;output=json&amp;amp;amp;sensor=true"&lt;span style="color: black;"&gt;,&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style="color: #703daa; font: 11.0px Menlo; margin: 0.0px 0.0px 0.0px 0.0px;"&gt;&lt;span class="Apple-style-span" style="font-family: Times, 'Times New Roman', serif;"&gt;&lt;span style="color: black;"&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt;      &lt;/span&gt;&amp;nbsp; [&lt;/span&gt;NSString&lt;span style="color: black;"&gt; &lt;/span&gt;&lt;span style="color: #3d1e81;"&gt;stringWithFormat&lt;/span&gt;&lt;span style="color: black;"&gt;:&lt;/span&gt;&lt;span style="color: #d12e1b;"&gt;@"%f"&lt;/span&gt;&lt;span style="color: black;"&gt;,&lt;/span&gt;&lt;span style="color: #ba2da2;"&gt;self&lt;/span&gt;&lt;span style="color: black;"&gt;.&lt;/span&gt;&lt;span style="color: #4f8187;"&gt;userLocation&lt;/span&gt;&lt;span style="color: black;"&gt;.&lt;/span&gt;location&lt;span style="color: black;"&gt;.&lt;/span&gt;coordinate&lt;span style="color: black;"&gt;.&lt;/span&gt;latitude&lt;span style="color: black;"&gt;],&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style="color: #703daa; font: 11.0px Menlo; margin: 0.0px 0.0px 0.0px 0.0px;"&gt;&lt;span class="Apple-style-span" style="font-family: Times, 'Times New Roman', serif;"&gt;&lt;span style="color: black;"&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt;      &lt;/span&gt;&amp;nbsp; [&lt;/span&gt;NSString&lt;span style="color: black;"&gt; &lt;/span&gt;&lt;span style="color: #3d1e81;"&gt;stringWithFormat&lt;/span&gt;&lt;span style="color: black;"&gt;:&lt;/span&gt;&lt;span style="color: #d12e1b;"&gt;@"%f"&lt;/span&gt;&lt;span style="color: black;"&gt;,&lt;/span&gt;&lt;span style="color: #4f8187;"&gt;mapView&lt;/span&gt;&lt;span style="color: black;"&gt;.&lt;/span&gt;userLocation&lt;span style="color: black;"&gt;.&lt;/span&gt;location&lt;span style="color: black;"&gt;.&lt;/span&gt;coordinate&lt;span style="color: black;"&gt;.&lt;/span&gt;longitude&lt;span style="color: black;"&gt;]];&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style="font: 11.0px Menlo; margin: 0.0px 0.0px 0.0px 0.0px;"&gt;&lt;span class="Apple-style-span" style="font-family: Times, 'Times New Roman', serif;"&gt;&amp;nbsp; &amp;nbsp; &lt;span style="color: #703daa;"&gt;NSURL&lt;/span&gt; *url = [&lt;span style="color: #703daa;"&gt;NSURL&lt;/span&gt; &lt;span style="color: #3d1e81;"&gt;URLWithString&lt;/span&gt;:fetchURL];&lt;/span&gt;&lt;/div&gt;&lt;div style="font: 11.0px Menlo; margin: 0.0px 0.0px 0.0px 0.0px;"&gt;&lt;span class="Apple-style-span" style="font-family: Times, 'Times New Roman', serif;"&gt;&amp;nbsp; &amp;nbsp; &lt;span style="color: #703daa;"&gt;NSString&lt;/span&gt; *htmlData = [&lt;span style="color: #703daa;"&gt;NSString&lt;/span&gt; &lt;span style="color: #3d1e81;"&gt;stringWithContentsOfURL&lt;/span&gt;:url];&lt;/span&gt;&lt;/div&gt;&lt;div style="font: 11.0px Menlo; margin: 0.0px 0.0px 0.0px 0.0px; min-height: 13.0px;"&gt;&lt;span class="Apple-style-span" style="font-family: Times, 'Times New Roman', serif;"&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style="color: #4f8187; font: 11.0px Menlo; margin: 0.0px 0.0px 0.0px 0.0px;"&gt;&lt;span class="Apple-style-span" style="font-family: Times, 'Times New Roman', serif;"&gt;&lt;span style="color: black;"&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;&lt;/span&gt;SBJsonParser&lt;span style="color: black;"&gt; *parser = [[&lt;/span&gt;SBJsonParser&lt;span style="color: black;"&gt; &lt;/span&gt;&lt;span style="color: #3d1e81;"&gt;alloc&lt;/span&gt;&lt;span style="color: black;"&gt;] &lt;/span&gt;&lt;span style="color: #3d1e81;"&gt;init&lt;/span&gt;&lt;span style="color: black;"&gt;];&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style="font: 11.0px Menlo; margin: 0.0px 0.0px 0.0px 0.0px;"&gt;&lt;span class="Apple-style-span" style="font-family: Times, 'Times New Roman', serif;"&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;&lt;span style="color: #703daa;"&gt;NSDictionary&lt;/span&gt; *json = [parser &lt;span style="color: #31595e;"&gt;objectWithString&lt;/span&gt;:htmlData &lt;span style="color: #31595e;"&gt;error&lt;/span&gt;:&lt;span style="color: #ba2da2;"&gt;nil&lt;/span&gt;];&lt;/span&gt;&lt;/div&gt;&lt;div style="font: 11.0px Menlo; margin: 0.0px 0.0px 0.0px 0.0px;"&gt;&lt;span class="Apple-style-span" style="font-family: Times, 'Times New Roman', serif;"&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;&lt;span style="color: #703daa;"&gt;NSArray&lt;/span&gt; *placemark = [json &lt;span style="color: #3d1e81;"&gt;objectForKey&lt;/span&gt;:&lt;span style="color: #d12e1b;"&gt;@"Placemark"&lt;/span&gt;];&lt;/span&gt;&lt;/div&gt;&lt;div style="font: 11.0px Menlo; margin: 0.0px 0.0px 0.0px 0.0px;"&gt;&lt;span class="Apple-style-span" style="font-family: Times, 'Times New Roman', serif;"&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;&lt;span style="color: #3d1e81;"&gt;CFShow&lt;/span&gt;(json);&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;span class="Apple-style-span" style="font-family: Menlo; font-size: 11px;"&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="font-family: Times, 'Times New Roman', serif;"&gt;&lt;div&gt;&lt;div style="font: 11.0px Menlo; margin: 0.0px 0.0px 0.0px 0.0px;"&gt;}&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;/span&gt;&lt;br /&gt;&lt;div style="background-attachment: initial; background-clip: initial; background-color: #ffffbf; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial; border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; color: black; direction: ltr; font-family: arial, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; height: auto; line-height: normal; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-align: left; width: auto; z-index: 99995;"&gt;&lt;/div&gt;&lt;div style="background-attachment: initial; background-clip: initial; background-color: #ffffbf; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial; border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; color: black; direction: ltr; font-family: arial, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; height: auto; line-height: normal; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-align: left; width: auto; z-index: 99995;"&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/4996441835700536347-831074814927615317?l=i-phone-dev.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://i-phone-dev.blogspot.com/feeds/831074814927615317/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://i-phone-dev.blogspot.com/2011/11/iphone-uimapview-tips-and-tricks.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4996441835700536347/posts/default/831074814927615317'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4996441835700536347/posts/default/831074814927615317'/><link rel='alternate' type='text/html' href='http://i-phone-dev.blogspot.com/2011/11/iphone-uimapview-tips-and-tricks.html' title='iPhone UIMapView tips and tricks'/><author><name>Anon</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4996441835700536347.post-1232072638632768063</id><published>2011-11-23T05:09:00.001-08:00</published><updated>2011-11-23T05:13:50.688-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='autoresize'/><category scheme='http://www.blogger.com/atom/ns#' term='UILabel'/><category scheme='http://www.blogger.com/atom/ns#' term='layout'/><category scheme='http://www.blogger.com/atom/ns#' term='fontsize'/><category scheme='http://www.blogger.com/atom/ns#' term='font'/><category scheme='http://www.blogger.com/atom/ns#' term='resize'/><category scheme='http://www.blogger.com/atom/ns#' term='iphone'/><title type='text'>UILabel - resizing facts</title><content type='html'>Tags: iPhone, UILabel, resize, autoresize, font, layout&lt;br /&gt;&lt;br /&gt;Apple UILabel component have some missing property.&lt;br /&gt;Two of the mostly needed for me is&lt;br /&gt;&lt;br /&gt;&lt;ul&gt;&lt;li&gt;Top Left alignment of the text and&amp;nbsp;&lt;/li&gt;&lt;li&gt;Text autoresize with UILabel size.&amp;nbsp;&lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-size: large;"&gt;Font resize with the size of the Label&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;div style="color: #008400; font: 11.0px Menlo; margin: 0.0px 0.0px 0.0px 0.0px;"&gt;// resize the font in the label.&lt;/div&gt;&lt;div style="font: 11.0px Menlo; margin: 0.0px 0.0px 0.0px 0.0px;"&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;&lt;span style="color: #703daa;"&gt;UIFont&lt;/span&gt; * font = &lt;span style="color: #4f8187;"&gt;theLabel&lt;/span&gt;.&lt;span style="color: #703daa;"&gt;font&lt;/span&gt;;&lt;/div&gt;&lt;div style="font: 11.0px Menlo; margin: 0.0px 0.0px 0.0px 0.0px;"&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;&lt;span style="color: #ba2da2;"&gt;int&lt;/span&gt; fontSize, lowestSize = &lt;span style="color: #252bd8;"&gt;8&lt;/span&gt;;&lt;/div&gt;&lt;div style="font: 11.0px Menlo; margin: 0.0px 0.0px 0.0px 0.0px;"&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;&lt;span style="color: #ba2da2;"&gt;for&lt;/span&gt; (fontSize = font.&lt;span style="color: #703daa;"&gt;pointSize&lt;/span&gt;; fontSize &amp;gt; lowestSize; fontSize --) {&lt;/div&gt;&lt;div style="font: 11.0px Menlo; margin: 0.0px 0.0px 0.0px 0.0px;"&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt;  &lt;/span&gt;font = [font &lt;span style="color: #3d1e81;"&gt;fontWithSize&lt;/span&gt;:fontSize];&lt;/div&gt;&lt;div style="font: 11.0px Menlo; margin: 0.0px 0.0px 0.0px 0.0px;"&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt;  &lt;/span&gt;&lt;span style="color: #703daa;"&gt;CGSize&lt;/span&gt; constraintSize = &lt;span style="color: #3d1e81;"&gt;CGSizeMake&lt;/span&gt;(&lt;span class="Apple-style-span" style="color: #4f8187;"&gt;theLabel&lt;/span&gt;.&lt;span style="color: #703daa;"&gt;frame&lt;/span&gt;.&lt;span style="color: #703daa;"&gt;size&lt;/span&gt;.&lt;span style="color: #703daa;"&gt;width&lt;/span&gt;, &lt;span style="color: #78492a;"&gt;MAXFLOAT&lt;/span&gt;);&lt;/div&gt;&lt;div style="color: #3d1e81; font: 11.0px Menlo; margin: 0.0px 0.0px 0.0px 0.0px;"&gt;&lt;span style="color: black;"&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt;  &lt;/span&gt;&lt;/span&gt;&lt;span style="color: #703daa;"&gt;CGSize&lt;/span&gt;&lt;span style="color: black;"&gt; labelSize = [&lt;/span&gt;&lt;span class="Apple-style-span" style="color: #4f8187;"&gt;theLabel&lt;/span&gt;&lt;span style="color: black;"&gt;.&lt;/span&gt;&lt;span style="color: #703daa;"&gt;text&lt;/span&gt;&lt;span style="color: black;"&gt; &lt;/span&gt;sizeWithFont&lt;span style="color: black;"&gt;:font &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/span&gt;constrainedToSize&lt;span style="color: black;"&gt;:constraintSize &lt;/span&gt;lineBreakMode&lt;span style="color: black;"&gt;:&lt;/span&gt;UILineBreakModeWordWrap&lt;span style="color: black;"&gt;];&lt;/span&gt;&lt;/div&gt;&lt;div style="font: 11.0px Menlo; margin: 0.0px 0.0px 0.0px 0.0px;"&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt;  &lt;/span&gt;&lt;span style="color: #ba2da2;"&gt;if&lt;/span&gt; (labelSize.&lt;span style="color: #703daa;"&gt;height&lt;/span&gt; &amp;lt;=&amp;nbsp;&lt;span class="Apple-style-span" style="color: #4f8187;"&gt;theLabel&lt;/span&gt;.&lt;span style="color: #703daa;"&gt;frame&lt;/span&gt;.&lt;span style="color: #703daa;"&gt;size&lt;/span&gt;.&lt;span style="color: #703daa;"&gt;height&lt;/span&gt;) {&lt;/div&gt;&lt;div style="color: #ba2da2; font: 11.0px Menlo; margin: 0.0px 0.0px 0.0px 0.0px;"&gt;&lt;span style="color: black;"&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt;   &lt;/span&gt;&lt;/span&gt;break&lt;span style="color: black;"&gt;;&lt;/span&gt;&lt;/div&gt;&lt;div style="font: 11.0px Menlo; margin: 0.0px 0.0px 0.0px 0.0px;"&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt;  &lt;/span&gt;}&lt;/div&gt;&lt;div style="font: 11.0px Menlo; margin: 0.0px 0.0px 0.0px 0.0px;"&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;}&lt;/div&gt;&lt;div style="color: #4f8187; font: 11.0px Menlo; margin: 0.0px 0.0px 0.0px 0.0px;"&gt;&lt;span style="color: black;"&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;&lt;/span&gt;theLabel&lt;span style="color: black;"&gt;.&lt;/span&gt;&lt;span style="color: #703daa;"&gt;font&lt;/span&gt;&lt;span style="color: black;"&gt; = font;&lt;/span&gt;&lt;/div&gt;&lt;div style="color: #4f8187; font: 11.0px Menlo; margin: 0.0px 0.0px 0.0px 0.0px;"&gt;&lt;span style="color: black;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4996441835700536347-1232072638632768063?l=i-phone-dev.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://i-phone-dev.blogspot.com/feeds/1232072638632768063/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://i-phone-dev.blogspot.com/2011/11/uilabel-resizing-facts.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4996441835700536347/posts/default/1232072638632768063'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4996441835700536347/posts/default/1232072638632768063'/><link rel='alternate' type='text/html' href='http://i-phone-dev.blogspot.com/2011/11/uilabel-resizing-facts.html' title='UILabel - resizing facts'/><author><name>Anon</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4996441835700536347.post-3924877230030678935</id><published>2011-11-05T02:23:00.000-07:00</published><updated>2011-11-05T04:15:12.205-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='comparison'/><category scheme='http://www.blogger.com/atom/ns#' term='split nsstring'/><category scheme='http://www.blogger.com/atom/ns#' term='nsstring'/><category scheme='http://www.blogger.com/atom/ns#' term='string compare'/><category scheme='http://www.blogger.com/atom/ns#' term='non english charcter'/><category scheme='http://www.blogger.com/atom/ns#' term='advance string operation'/><category scheme='http://www.blogger.com/atom/ns#' term='string'/><category scheme='http://www.blogger.com/atom/ns#' term='iphone'/><category scheme='http://www.blogger.com/atom/ns#' term='empty nsstring'/><category scheme='http://www.blogger.com/atom/ns#' term='objective c'/><title type='text'>iPhone NSString operations in Objective C</title><content type='html'>&lt;br /&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-size: x-large;"&gt;Empty String&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;In the objective C there not an intuitive way to check if the string is empty.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;div style="font: 11.0px Menlo; margin: 0.0px 0.0px 0.0px 0.0px;"&gt;+ (&lt;span style="color: #ba2da2;"&gt;BOOL&lt;/span&gt; ) stringIsEmpty:(&lt;span style="color: #703daa;"&gt;NSString&lt;/span&gt; *) aString {&lt;/div&gt;&lt;div style="font: 11.0px Menlo; margin: 0.0px 0.0px 0.0px 0.0px; min-height: 13.0px;"&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;&lt;/div&gt;&lt;div style="font: 11.0px Menlo; margin: 0.0px 0.0px 0.0px 0.0px;"&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;&lt;span style="color: #ba2da2;"&gt;if&lt;/span&gt; ((&lt;span style="color: #703daa;"&gt;NSNull&lt;/span&gt; *) aString == [&lt;span style="color: #703daa;"&gt;NSNull&lt;/span&gt; &lt;span style="color: #3d1e81;"&gt;null&lt;/span&gt;]) {&lt;/div&gt;&lt;div style="color: #ba2da2; font: 11.0px Menlo; margin: 0.0px 0.0px 0.0px 0.0px;"&gt;&lt;span style="color: black;"&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt;  &lt;/span&gt;&lt;/span&gt;return&lt;span style="color: black;"&gt; &lt;/span&gt;YES&lt;span style="color: black;"&gt;;&lt;/span&gt;&lt;/div&gt;&lt;div style="font: 11.0px Menlo; margin: 0.0px 0.0px 0.0px 0.0px;"&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;}&lt;/div&gt;&lt;div style="font: 11.0px Menlo; margin: 0.0px 0.0px 0.0px 0.0px; min-height: 13.0px;"&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;&lt;/div&gt;&lt;div style="font: 11.0px Menlo; margin: 0.0px 0.0px 0.0px 0.0px;"&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;&lt;span style="color: #ba2da2;"&gt;if&lt;/span&gt; (aString == &lt;span style="color: #ba2da2;"&gt;nil&lt;/span&gt;) {&lt;/div&gt;&lt;div style="color: #ba2da2; font: 11.0px Menlo; margin: 0.0px 0.0px 0.0px 0.0px;"&gt;&lt;span style="color: black;"&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt;  &lt;/span&gt;&lt;/span&gt;return&lt;span style="color: black;"&gt; &lt;/span&gt;YES&lt;span style="color: black;"&gt;;&lt;/span&gt;&lt;/div&gt;&lt;div style="font: 11.0px Menlo; margin: 0.0px 0.0px 0.0px 0.0px;"&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;} &lt;span style="color: #ba2da2;"&gt;else&lt;/span&gt; &lt;span style="color: #ba2da2;"&gt;if&lt;/span&gt; ([aString &lt;span style="color: #3d1e81;"&gt;length&lt;/span&gt;] == &lt;span style="color: #252bd8;"&gt;0&lt;/span&gt;) {&lt;/div&gt;&lt;div style="color: #ba2da2; font: 11.0px Menlo; margin: 0.0px 0.0px 0.0px 0.0px;"&gt;&lt;span style="color: black;"&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt;  &lt;/span&gt;&lt;/span&gt;return&lt;span style="color: black;"&gt; &lt;/span&gt;YES&lt;span style="color: black;"&gt;;&lt;/span&gt;&lt;/div&gt;&lt;div style="font: 11.0px Menlo; margin: 0.0px 0.0px 0.0px 0.0px;"&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;} &lt;span style="color: #ba2da2;"&gt;else&lt;/span&gt; {&lt;/div&gt;&lt;div style="color: #3d1e81; font: 11.0px Menlo; margin: 0.0px 0.0px 0.0px 0.0px;"&gt;&lt;span style="color: black;"&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt;  &lt;/span&gt;aString = [aString &lt;/span&gt;stringByTrimmingCharactersInSet&lt;span style="color: black;"&gt;: [&lt;/span&gt;&lt;span style="color: #703daa;"&gt;NSCharacterSet&lt;/span&gt;&lt;span style="color: black;"&gt; &lt;/span&gt;whitespaceAndNewlineCharacterSet&lt;span style="color: black;"&gt;]];&lt;/span&gt;&lt;/div&gt;&lt;div style="font: 11.0px Menlo; margin: 0.0px 0.0px 0.0px 0.0px;"&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt;  &lt;/span&gt;&lt;span style="color: #ba2da2;"&gt;if&lt;/span&gt; ([aString &lt;span style="color: #3d1e81;"&gt;length&lt;/span&gt;] == &lt;span style="color: #252bd8;"&gt;0&lt;/span&gt;) {&lt;/div&gt;&lt;div style="color: #ba2da2; font: 11.0px Menlo; margin: 0.0px 0.0px 0.0px 0.0px;"&gt;&lt;span style="color: black;"&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt;   &lt;/span&gt;&lt;/span&gt;return&lt;span style="color: black;"&gt; &lt;/span&gt;YES&lt;span style="color: black;"&gt;;&lt;/span&gt;&lt;/div&gt;&lt;div style="font: 11.0px Menlo; margin: 0.0px 0.0px 0.0px 0.0px;"&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt;  &lt;/span&gt;}&lt;/div&gt;&lt;div style="font: 11.0px Menlo; margin: 0.0px 0.0px 0.0px 0.0px;"&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;}&lt;/div&gt;&lt;div style="font: 11.0px Menlo; margin: 0.0px 0.0px 0.0px 0.0px; min-height: 13.0px;"&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;&lt;/div&gt;&lt;div style="color: #ba2da2; font: 11.0px Menlo; margin: 0.0px 0.0px 0.0px 0.0px;"&gt;&lt;span style="color: black;"&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;&lt;/span&gt;return&lt;span style="color: black;"&gt; &lt;/span&gt;NO&lt;span style="color: black;"&gt;;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style="font: 11.0px Menlo; margin: 0.0px 0.0px 0.0px 0.0px;"&gt;}&lt;/div&gt;&lt;div style="font: 11.0px Menlo; margin: 0.0px 0.0px 0.0px 0.0px; min-height: 13.0px;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="font: 11.0px Menlo; margin: 0.0px 0.0px 0.0px 0.0px;"&gt;+ (&lt;span style="color: #ba2da2;"&gt;BOOL&lt;/span&gt; ) stringIsEmpty:(&lt;span style="color: #703daa;"&gt;NSString&lt;/span&gt; *) aString shouldCleanWhiteSpace:(&lt;span style="color: #ba2da2;"&gt;BOOL&lt;/span&gt;)cleanWhileSpace {&lt;/div&gt;&lt;div style="font: 11.0px Menlo; margin: 0.0px 0.0px 0.0px 0.0px; min-height: 13.0px;"&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;&lt;/div&gt;&lt;div style="font: 11.0px Menlo; margin: 0.0px 0.0px 0.0px 0.0px;"&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;&lt;span style="color: #ba2da2;"&gt;if&lt;/span&gt; ((&lt;span style="color: #703daa;"&gt;NSNull&lt;/span&gt; *) aString == [&lt;span style="color: #703daa;"&gt;NSNull&lt;/span&gt; &lt;span style="color: #3d1e81;"&gt;null&lt;/span&gt;]) {&lt;/div&gt;&lt;div style="color: #ba2da2; font: 11.0px Menlo; margin: 0.0px 0.0px 0.0px 0.0px;"&gt;&lt;span style="color: black;"&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt;  &lt;/span&gt;&lt;/span&gt;return&lt;span style="color: black;"&gt; &lt;/span&gt;YES&lt;span style="color: black;"&gt;;&lt;/span&gt;&lt;/div&gt;&lt;div style="font: 11.0px Menlo; margin: 0.0px 0.0px 0.0px 0.0px;"&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;}&lt;/div&gt;&lt;div style="font: 11.0px Menlo; margin: 0.0px 0.0px 0.0px 0.0px; min-height: 13.0px;"&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;&lt;/div&gt;&lt;div style="font: 11.0px Menlo; margin: 0.0px 0.0px 0.0px 0.0px;"&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;&lt;span style="color: #ba2da2;"&gt;if&lt;/span&gt; (aString == &lt;span style="color: #ba2da2;"&gt;nil&lt;/span&gt;) {&lt;/div&gt;&lt;div style="color: #ba2da2; font: 11.0px Menlo; margin: 0.0px 0.0px 0.0px 0.0px;"&gt;&lt;span style="color: black;"&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt;  &lt;/span&gt;&lt;/span&gt;return&lt;span style="color: black;"&gt; &lt;/span&gt;YES&lt;span style="color: black;"&gt;;&lt;/span&gt;&lt;/div&gt;&lt;div style="font: 11.0px Menlo; margin: 0.0px 0.0px 0.0px 0.0px;"&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;} &lt;span style="color: #ba2da2;"&gt;else&lt;/span&gt; &lt;span style="color: #ba2da2;"&gt;if&lt;/span&gt; ([aString &lt;span style="color: #3d1e81;"&gt;length&lt;/span&gt;] == &lt;span style="color: #252bd8;"&gt;0&lt;/span&gt;) {&lt;/div&gt;&lt;div style="color: #ba2da2; font: 11.0px Menlo; margin: 0.0px 0.0px 0.0px 0.0px;"&gt;&lt;span style="color: black;"&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt;  &lt;/span&gt;&lt;/span&gt;return&lt;span style="color: black;"&gt; &lt;/span&gt;YES&lt;span style="color: black;"&gt;;&lt;/span&gt;&lt;/div&gt;&lt;div style="font: 11.0px Menlo; margin: 0.0px 0.0px 0.0px 0.0px;"&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;}&amp;nbsp;&lt;/div&gt;&lt;div style="font: 11.0px Menlo; margin: 0.0px 0.0px 0.0px 0.0px; min-height: 13.0px;"&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;&lt;/div&gt;&lt;div style="font: 11.0px Menlo; margin: 0.0px 0.0px 0.0px 0.0px;"&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;&lt;span style="color: #ba2da2;"&gt;if&lt;/span&gt; (cleanWhileSpace) {&lt;/div&gt;&lt;div style="color: #3d1e81; font: 11.0px Menlo; margin: 0.0px 0.0px 0.0px 0.0px;"&gt;&lt;span style="color: black;"&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt;  &lt;/span&gt;aString = [aString &lt;/span&gt;stringByTrimmingCharactersInSet&lt;span style="color: black;"&gt;: [&lt;/span&gt;&lt;span style="color: #703daa;"&gt;NSCharacterSet&lt;/span&gt;&lt;span style="color: black;"&gt; &lt;/span&gt;whitespaceAndNewlineCharacterSet&lt;span style="color: black;"&gt;]];&lt;/span&gt;&lt;/div&gt;&lt;div style="font: 11.0px Menlo; margin: 0.0px 0.0px 0.0px 0.0px;"&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt;  &lt;/span&gt;&lt;span style="color: #ba2da2;"&gt;if&lt;/span&gt; ([aString &lt;span style="color: #3d1e81;"&gt;length&lt;/span&gt;] == &lt;span style="color: #252bd8;"&gt;0&lt;/span&gt;) {&lt;/div&gt;&lt;div style="color: #ba2da2; font: 11.0px Menlo; margin: 0.0px 0.0px 0.0px 0.0px;"&gt;&lt;span style="color: black;"&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt;   &lt;/span&gt;&lt;/span&gt;return&lt;span style="color: black;"&gt; &lt;/span&gt;YES&lt;span style="color: black;"&gt;;&lt;/span&gt;&lt;/div&gt;&lt;div style="font: 11.0px Menlo; margin: 0.0px 0.0px 0.0px 0.0px;"&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt;  &lt;/span&gt;}&lt;/div&gt;&lt;div style="font: 11.0px Menlo; margin: 0.0px 0.0px 0.0px 0.0px;"&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;}&lt;/div&gt;&lt;div style="font: 11.0px Menlo; margin: 0.0px 0.0px 0.0px 0.0px; min-height: 13.0px;"&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;&lt;/div&gt;&lt;div style="color: #ba2da2; font: 11.0px Menlo; margin: 0.0px 0.0px 0.0px 0.0px;"&gt;&lt;span style="color: black;"&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;&lt;/span&gt;return&lt;span style="color: black;"&gt; &lt;/span&gt;NO&lt;span style="color: black;"&gt;;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style="font: 11.0px Menlo; margin: 0.0px 0.0px 0.0px 0.0px;"&gt;}&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-size: x-large;"&gt;String splitter&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;In one of my latest project, I need to split a string by comma (,) but not all the commas. e.g. If the commas are inside a brackets like () or [], I should not split them.&lt;br /&gt;I can use the API&amp;nbsp;&lt;span class="Apple-style-span" style="font-family: 'Lucida Grande', Geneva, Helvetica, Arial, sans-serif; font-size: 13px;"&gt;- (&lt;/span&gt;&lt;span class="Apple-style-span" style="font-family: 'Lucida Grande', Geneva, Helvetica, Arial, sans-serif; font-size: 13px;"&gt;&lt;a href="file:///Library/Developer/Documentation/DocSets/com.apple.adc.documentation.AppleiOS4_3.iOSLibrary.docset/Contents/Resources/Documents/documentation/Cocoa/Reference/Foundation/Classes/NSArray_Class/NSArray.html#//apple_ref/doc/c_ref/NSArray" style="color: #3366cc; text-decoration: none;"&gt;NSArray&lt;/a&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="font-family: 'Lucida Grande', Geneva, Helvetica, Arial, sans-serif; font-size: 13px;"&gt;&amp;nbsp;*)componentsSeparatedByString:(NSString *)&lt;/span&gt;&lt;span class="Apple-style-span" style="font-family: 'Lucida Grande', Geneva, Helvetica, Arial, sans-serif; font-size: 13px;"&gt;&lt;em style="font-family: 'Lucida Grande', Geneva, Helvetica, Arial, sans-serif; font-size: 13px; font-style: italic;"&gt;separator , but i does not server my pupose. So I had to write a custom splitter for my use.&amp;nbsp;&lt;/em&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: 'Lucida Grande', Geneva, Helvetica, Arial, sans-serif; font-size: 13px;"&gt;&lt;em style="font-family: 'Lucida Grande', Geneva, Helvetica, Arial, sans-serif; font-size: 13px; font-style: italic;"&gt;&lt;br /&gt;&lt;/em&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: 'Lucida Grande', Geneva, Helvetica, Arial, sans-serif; font-size: 13px;"&gt;&lt;em style="font-family: 'Lucida Grande', Geneva, Helvetica, Arial, sans-serif; font-size: 13px; font-style: italic;"&gt;&lt;/em&gt;&lt;/span&gt;&lt;br /&gt;&lt;div style="color: #008400; font: 11.0px Menlo; margin: 0.0px 0.0px 0.0px 0.0px;"&gt;&lt;span class="Apple-style-span" style="font-family: 'Lucida Grande', Geneva, Helvetica, Arial, sans-serif; font-size: x-small;"&gt;&lt;i&gt;&lt;/i&gt;&lt;/span&gt;&lt;br /&gt;&lt;div style="color: #008400; font: 11.0px Menlo; margin: 0.0px 0.0px 0.0px 0.0px;"&gt;&lt;span class="Apple-style-span" style="font-family: 'Lucida Grande', Geneva, Helvetica, Arial, sans-serif; font-size: x-small;"&gt;&lt;i&gt;/*&lt;/i&gt;&lt;/span&gt;&lt;/div&gt;&lt;span class="Apple-style-span" style="font-family: 'Lucida Grande', Geneva, Helvetica, Arial, sans-serif; font-size: x-small;"&gt;&lt;i&gt;&lt;/i&gt;&lt;/span&gt;&lt;br /&gt;&lt;div style="color: #008400; font: 11.0px Menlo; margin: 0.0px 0.0px 0.0px 0.0px;"&gt;&lt;span class="Apple-style-span" style="font-family: 'Lucida Grande', Geneva, Helvetica, Arial, sans-serif; font-size: x-small;"&gt;&lt;i&gt;&amp;nbsp;Test cases: []; (); [,,,,]; (,,,,); [inword1, inword2] ourword1, outword2; [word]&lt;/i&gt;&lt;/span&gt;&lt;/div&gt;&lt;span class="Apple-style-span" style="font-family: 'Lucida Grande', Geneva, Helvetica, Arial, sans-serif; font-size: x-small;"&gt;&lt;i&gt;&lt;/i&gt;&lt;/span&gt;&lt;br /&gt;&lt;div style="color: #008400; font: 11.0px Menlo; margin: 0.0px 0.0px 0.0px 0.0px;"&gt;&lt;span class="Apple-style-span" style="font-family: 'Lucida Grande', Geneva, Helvetica, Arial, sans-serif; font-size: x-small;"&gt;&lt;i&gt;&amp;nbsp;customized parser, skip 'splitter' inside () or []&amp;nbsp;&lt;/i&gt;&lt;/span&gt;&lt;/div&gt;&lt;span class="Apple-style-span" style="font-family: 'Lucida Grande', Geneva, Helvetica, Arial, sans-serif; font-size: x-small;"&gt;&lt;i&gt;&lt;/i&gt;&lt;/span&gt;&lt;br /&gt;&lt;div style="color: #008400; font: 11.0px Menlo; margin: 0.0px 0.0px 0.0px 0.0px;"&gt;&lt;span class="Apple-style-span" style="font-family: 'Lucida Grande', Geneva, Helvetica, Arial, sans-serif; font-size: x-small;"&gt;&lt;i&gt;&amp;nbsp;Not checked for double [[]] things.&lt;/i&gt;&lt;/span&gt;&lt;/div&gt;&lt;span class="Apple-style-span" style="font-family: 'Lucida Grande', Geneva, Helvetica, Arial, sans-serif; font-size: x-small;"&gt;&lt;i&gt;&lt;div style="color: #008400; font: 11.0px Menlo; margin: 0.0px 0.0px 0.0px 0.0px;"&gt;&amp;nbsp;*/&lt;/div&gt;&lt;div style="font: 11.0px Menlo; margin: 0.0px 0.0px 0.0px 0.0px;"&gt;+ (&lt;span style="color: #703daa;"&gt;NSArray&lt;/span&gt; *) splitString:(&lt;span style="color: #703daa;"&gt;NSString&lt;/span&gt; *)originalString byChar:(&lt;span style="color: #ba2da2;"&gt;char&lt;/span&gt;)splitter {&lt;/div&gt;&lt;div style="font: 11.0px Menlo; margin: 0.0px 0.0px 0.0px 0.0px; min-height: 13.0px;"&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;&lt;/div&gt;&lt;div style="font: 11.0px Menlo; margin: 0.0px 0.0px 0.0px 0.0px;"&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;&lt;span style="color: #ba2da2;"&gt;if&lt;/span&gt; (originalString == &lt;span style="color: #ba2da2;"&gt;nil&lt;/span&gt;) &lt;span style="color: #ba2da2;"&gt;return&lt;/span&gt; &lt;span style="color: #ba2da2;"&gt;nil&lt;/span&gt;;&lt;/div&gt;&lt;div style="font: 11.0px Menlo; margin: 0.0px 0.0px 0.0px 0.0px; min-height: 13.0px;"&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt;  &lt;/span&gt;&lt;/div&gt;&lt;div style="font: 11.0px Menlo; margin: 0.0px 0.0px 0.0px 0.0px;"&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;&lt;span style="color: #703daa;"&gt;NSMutableArray&lt;/span&gt; * parsedStrings = [[&lt;span style="color: #703daa;"&gt;NSMutableArray&lt;/span&gt; &lt;span style="color: #3d1e81;"&gt;alloc&lt;/span&gt;] &lt;span style="color: #3d1e81;"&gt;initWithCapacity&lt;/span&gt;:&lt;span style="color: #252bd8;"&gt;1&lt;/span&gt;];&lt;/div&gt;&lt;div style="font: 11.0px Menlo; margin: 0.0px 0.0px 0.0px 0.0px;"&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;&lt;span style="color: #ba2da2;"&gt;int&lt;/span&gt; length = [originalString &lt;span style="color: #3d1e81;"&gt;length&lt;/span&gt;];&lt;/div&gt;&lt;div style="font: 11.0px Menlo; margin: 0.0px 0.0px 0.0px 0.0px;"&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;&lt;span style="color: #ba2da2;"&gt;int&lt;/span&gt; i = &lt;span style="color: #252bd8;"&gt;0&lt;/span&gt;, lastParsedIndex = &lt;span style="color: #252bd8;"&gt;0&lt;/span&gt;;&lt;/div&gt;&lt;div style="font: 11.0px Menlo; margin: 0.0px 0.0px 0.0px 0.0px;"&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;&lt;span style="color: #ba2da2;"&gt;while&lt;/span&gt; ( i &amp;lt; length) {&lt;span class="Apple-tab-span" style="white-space: pre;"&gt;  &lt;/span&gt;&lt;/div&gt;&lt;div style="font: 11.0px Menlo; margin: 0.0px 0.0px 0.0px 0.0px; min-height: 13.0px;"&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt;  &lt;/span&gt;&lt;/div&gt;&lt;div style="font: 11.0px Menlo; margin: 0.0px 0.0px 0.0px 0.0px;"&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt;  &lt;/span&gt;&lt;span style="color: #ba2da2;"&gt;if&lt;/span&gt; ([originalString &lt;span style="color: #3d1e81;"&gt;characterAtIndex&lt;/span&gt;:i] == &lt;span style="color: #252bd8;"&gt;'['&lt;/span&gt; || [originalString &lt;span style="color: #3d1e81;"&gt;characterAtIndex&lt;/span&gt;:i] == &lt;span style="color: #252bd8;"&gt;'('&lt;/span&gt; )&amp;nbsp;&lt;/div&gt;&lt;div style="font: 11.0px Menlo; margin: 0.0px 0.0px 0.0px 0.0px;"&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt;  &lt;/span&gt;{&lt;/div&gt;&lt;div style="color: #008400; font: 11.0px Menlo; margin: 0.0px 0.0px 0.0px 0.0px;"&gt;&lt;span style="color: black;"&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt;   &lt;/span&gt;&lt;/span&gt;// loop until the next ] or ) is not found.&amp;nbsp;&lt;/div&gt;&lt;div style="font: 11.0px Menlo; margin: 0.0px 0.0px 0.0px 0.0px;"&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt;   &lt;/span&gt;&lt;span style="color: #ba2da2;"&gt;do&lt;/span&gt; {&lt;/div&gt;&lt;div style="font: 11.0px Menlo; margin: 0.0px 0.0px 0.0px 0.0px;"&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt;    &lt;/span&gt;i++;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt;    &lt;/span&gt;&lt;/div&gt;&lt;div style="font: 11.0px Menlo; margin: 0.0px 0.0px 0.0px 0.0px;"&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt;    &lt;/span&gt;&lt;span style="color: #ba2da2;"&gt;if&lt;/span&gt; (i &amp;gt;= (length - &lt;span style="color: #252bd8;"&gt;1&lt;/span&gt;)) &lt;span style="color: #ba2da2;"&gt;break&lt;/span&gt;;&lt;/div&gt;&lt;div style="font: 11.0px Menlo; margin: 0.0px 0.0px 0.0px 0.0px;"&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt;    &lt;/span&gt;&lt;span style="color: #ba2da2;"&gt;if&lt;/span&gt; ([originalString &lt;span style="color: #3d1e81;"&gt;characterAtIndex&lt;/span&gt;:i] == &lt;span style="color: #252bd8;"&gt;']'&lt;/span&gt; || [originalString &lt;span style="color: #3d1e81;"&gt;characterAtIndex&lt;/span&gt;:i] == &lt;span style="color: #252bd8;"&gt;')'&lt;/span&gt; ) {&lt;/div&gt;&lt;div style="font: 11.0px Menlo; margin: 0.0px 0.0px 0.0px 0.0px;"&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt;     &lt;/span&gt;&lt;span style="color: #ba2da2;"&gt;break&lt;/span&gt;;&lt;/div&gt;&lt;div style="font: 11.0px Menlo; margin: 0.0px 0.0px 0.0px 0.0px;"&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt;    &lt;/span&gt;}&lt;/div&gt;&lt;div style="font: 11.0px Menlo; margin: 0.0px 0.0px 0.0px 0.0px;"&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt;   &lt;/span&gt;} &lt;span style="color: #ba2da2;"&gt;while&lt;/span&gt; (&lt;span style="color: #ba2da2;"&gt;YES&lt;/span&gt;);&lt;/div&gt;&lt;div style="color: #008400; font: 11.0px Menlo; margin: 0.0px 0.0px 0.0px 0.0px;"&gt;&lt;span style="color: black;"&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt;   &lt;/span&gt;&lt;/span&gt;//i--; // i is already incremented once last time, which should be tested for splitter&lt;/div&gt;&lt;div style="font: 11.0px Menlo; margin: 0.0px 0.0px 0.0px 0.0px;"&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt;  &lt;/span&gt;} &lt;span style="color: #ba2da2;"&gt;else&lt;/span&gt; &lt;span style="color: #ba2da2;"&gt;if&lt;/span&gt; ([originalString &lt;span style="color: #3d1e81;"&gt;characterAtIndex&lt;/span&gt;:i] == splitter) {&lt;/div&gt;&lt;div style="font: 11.0px Menlo; margin: 0.0px 0.0px 0.0px 0.0px;"&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt;   &lt;/span&gt;[parsedStrings &lt;span style="color: #3d1e81;"&gt;addObject&lt;/span&gt;:[originalString &lt;span style="color: #3d1e81;"&gt;substringWithRange&lt;/span&gt;:&lt;span style="color: #3d1e81;"&gt;NSMakeRange&lt;/span&gt;(lastParsedIndex, i - lastParsedIndex)]];&lt;/div&gt;&lt;div style="font: 11.0px Menlo; margin: 0.0px 0.0px 0.0px 0.0px;"&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt;   &lt;/span&gt;lastParsedIndex = i + &lt;span style="color: #252bd8;"&gt;1&lt;/span&gt;;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt;  &lt;/span&gt;&lt;/div&gt;&lt;div style="font: 11.0px Menlo; margin: 0.0px 0.0px 0.0px 0.0px;"&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt;  &lt;/span&gt;}&amp;nbsp;&lt;/div&gt;&lt;div style="font: 11.0px Menlo; margin: 0.0px 0.0px 0.0px 0.0px;"&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt;  &lt;/span&gt;i++;&lt;/div&gt;&lt;div style="font: 11.0px Menlo; margin: 0.0px 0.0px 0.0px 0.0px;"&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;}&lt;/div&gt;&lt;div style="font: 11.0px Menlo; margin: 0.0px 0.0px 0.0px 0.0px; min-height: 13.0px;"&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;&lt;/div&gt;&lt;div style="font: 11.0px Menlo; margin: 0.0px 0.0px 0.0px 0.0px;"&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;&lt;span style="color: #ba2da2;"&gt;if&lt;/span&gt; (lastParsedIndex != (i-&lt;span style="color: #252bd8;"&gt;1&lt;/span&gt;)) { &lt;span style="color: #008400;"&gt;// i == string length now&lt;/span&gt;&lt;/div&gt;&lt;div style="font: 11.0px Menlo; margin: 0.0px 0.0px 0.0px 0.0px;"&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt;  &lt;/span&gt;[parsedStrings &lt;span style="color: #3d1e81;"&gt;addObject&lt;/span&gt;:[originalString &lt;span style="color: #3d1e81;"&gt;substringWithRange&lt;/span&gt;:&lt;span style="color: #3d1e81;"&gt;NSMakeRange&lt;/span&gt;(lastParsedIndex, i - lastParsedIndex)]];&lt;/div&gt;&lt;div style="font: 11.0px Menlo; margin: 0.0px 0.0px 0.0px 0.0px;"&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;}&lt;/div&gt;&lt;div style="font: 11.0px Menlo; margin: 0.0px 0.0px 0.0px 0.0px; min-height: 13.0px;"&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt;  &lt;/span&gt;&lt;/div&gt;&lt;div style="font: 11.0px Menlo; margin: 0.0px 0.0px 0.0px 0.0px;"&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;&lt;span style="color: #703daa;"&gt;NSArray&lt;/span&gt; *temp = [&lt;span style="color: #703daa;"&gt;NSArray&lt;/span&gt; &lt;span style="color: #3d1e81;"&gt;arrayWithArray&lt;/span&gt;:parsedStrings];&lt;/div&gt;&lt;div style="font: 11.0px Menlo; margin: 0.0px 0.0px 0.0px 0.0px;"&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;[parsedStrings &lt;span style="color: #3d1e81;"&gt;release&lt;/span&gt;];&lt;/div&gt;&lt;div style="font: 11.0px Menlo; margin: 0.0px 0.0px 0.0px 0.0px;"&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;&lt;span style="color: #ba2da2;"&gt;return&lt;/span&gt; temp;&lt;/div&gt;&lt;div style="font: 11.0px Menlo; margin: 0.0px 0.0px 0.0px 0.0px;"&gt;}&lt;/div&gt;&lt;/i&gt;&lt;/span&gt;&lt;/div&gt;&lt;em style="font-family: 'Lucida Grande', Geneva, Helvetica, Arial, sans-serif; font-style: italic;"&gt;&lt;/em&gt;&lt;br /&gt;&lt;div&gt;&lt;div style="font-size: 13px;"&gt;&lt;em style="font-family: 'Lucida Grande', Geneva, Helvetica, Arial, sans-serif; font-style: italic;"&gt;&lt;br /&gt;&lt;/em&gt;&lt;/div&gt;&lt;em style="font-family: 'Lucida Grande', Geneva, Helvetica, Arial, sans-serif; font-style: italic;"&gt;&lt;span class="Apple-style-span" style="font-size: large;"&gt;Testing&lt;/span&gt;&lt;/em&gt;&lt;br /&gt;&lt;div style="font-size: 13px;"&gt;&lt;em style="font-family: 'Lucida Grande', Geneva, Helvetica, Arial, sans-serif; font-style: italic;"&gt;&lt;br /&gt;&lt;/em&gt;&lt;/div&gt;&lt;div style="font-size: 13px;"&gt;&lt;/div&gt;&lt;div style="font: 11.0px Menlo; margin: 0.0px 0.0px 0.0px 0.0px;"&gt;&lt;em style="font-family: 'Lucida Grande', Geneva, Helvetica, Arial, sans-serif; font-style: italic;"&gt;&lt;br /&gt;&lt;/em&gt;&lt;br /&gt;&lt;div style="font: 11.0px Menlo; margin: 0.0px 0.0px 0.0px 0.0px; min-height: 13.0px;"&gt;&lt;em style="font-family: 'Lucida Grande', Geneva, Helvetica, Arial, sans-serif; font-style: italic;"&gt;&lt;br /&gt;&lt;/em&gt;&lt;/div&gt;&lt;div style="font: 11.0px Menlo; margin: 0.0px 0.0px 0.0px 0.0px;"&gt;&lt;em style="font-family: 'Lucida Grande', Geneva, Helvetica, Arial, sans-serif; font-style: italic;"&gt;+(&lt;span style="color: #ba2da2;"&gt;void&lt;/span&gt;) testSplitString {&lt;/em&gt;&lt;/div&gt;&lt;div style="color: #d12e1b; font: 11.0px Menlo; margin: 0.0px 0.0px 0.0px 0.0px;"&gt;&lt;em style="font-family: 'Lucida Grande', Geneva, Helvetica, Arial, sans-serif; font-style: italic;"&gt;&lt;span style="color: black;"&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style="color: #3d1e81;"&gt;CFShow&lt;/span&gt;&lt;span style="color: black;"&gt;([&lt;/span&gt;&lt;span style="color: #4f8187;"&gt;Resources&lt;/span&gt;&lt;span style="color: black;"&gt; &lt;/span&gt;&lt;span style="color: #31595e;"&gt;splitString&lt;/span&gt;&lt;span style="color: black;"&gt;:&lt;/span&gt;@"[word1, word2,], word3, word4,"&lt;span style="color: black;"&gt; &lt;/span&gt;&lt;span style="color: #31595e;"&gt;byChar&lt;/span&gt;&lt;span style="color: black;"&gt;:&lt;/span&gt;&lt;span style="color: #252bd8;"&gt;','&lt;/span&gt;&lt;span style="color: black;"&gt;]); &lt;/span&gt;&lt;span style="color: #008400;"&gt;// ideal one&lt;/span&gt;&lt;/em&gt;&lt;/div&gt;&lt;div style="color: #d12e1b; font: 11.0px Menlo; margin: 0.0px 0.0px 0.0px 0.0px;"&gt;&lt;em style="font-family: 'Lucida Grande', Geneva, Helvetica, Arial, sans-serif; font-style: italic;"&gt;&lt;span style="color: black;"&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style="color: #3d1e81;"&gt;CFShow&lt;/span&gt;&lt;span style="color: black;"&gt;([&lt;/span&gt;&lt;span style="color: #4f8187;"&gt;Resources&lt;/span&gt;&lt;span style="color: black;"&gt; &lt;/span&gt;&lt;span style="color: #31595e;"&gt;splitString&lt;/span&gt;&lt;span style="color: black;"&gt;:&lt;/span&gt;@"some text (word1, word2), [word3, word4] suffix, word 5"&lt;span style="color: black;"&gt; &lt;/span&gt;&lt;span style="color: #31595e;"&gt;byChar&lt;/span&gt;&lt;span style="color: black;"&gt;:&lt;/span&gt;&lt;span style="color: #252bd8;"&gt;','&lt;/span&gt;&lt;span style="color: black;"&gt;]); &lt;/span&gt;&lt;span style="color: #008400;"&gt;// ideal one&lt;/span&gt;&lt;/em&gt;&lt;/div&gt;&lt;div style="color: #31595e; font: 11.0px Menlo; margin: 0.0px 0.0px 0.0px 0.0px;"&gt;&lt;em style="font-family: 'Lucida Grande', Geneva, Helvetica, Arial, sans-serif; font-style: italic;"&gt;&lt;span style="color: black;"&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style="color: #3d1e81;"&gt;CFShow&lt;/span&gt;&lt;span style="color: black;"&gt;([&lt;/span&gt;&lt;span style="color: #4f8187;"&gt;Resources&lt;/span&gt;&lt;span style="color: black;"&gt; &lt;/span&gt;splitString&lt;span style="color: black;"&gt;:&lt;/span&gt;&lt;span style="color: #d12e1b;"&gt;@"[]"&lt;/span&gt;&lt;span style="color: black;"&gt; &lt;/span&gt;byChar&lt;span style="color: black;"&gt;:&lt;/span&gt;&lt;span style="color: #252bd8;"&gt;','&lt;/span&gt;&lt;span style="color: black;"&gt;]);&lt;/span&gt;&lt;/em&gt;&lt;/div&gt;&lt;div style="color: #31595e; font: 11.0px Menlo; margin: 0.0px 0.0px 0.0px 0.0px;"&gt;&lt;em style="font-family: 'Lucida Grande', Geneva, Helvetica, Arial, sans-serif; font-style: italic;"&gt;&lt;span style="color: black;"&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style="color: #3d1e81;"&gt;CFShow&lt;/span&gt;&lt;span style="color: black;"&gt;([&lt;/span&gt;&lt;span style="color: #4f8187;"&gt;Resources&lt;/span&gt;&lt;span style="color: black;"&gt; &lt;/span&gt;splitString&lt;span style="color: black;"&gt;:&lt;/span&gt;&lt;span style="color: #d12e1b;"&gt;@"()()"&lt;/span&gt;&lt;span style="color: black;"&gt; &lt;/span&gt;byChar&lt;span style="color: black;"&gt;:&lt;/span&gt;&lt;span style="color: #252bd8;"&gt;','&lt;/span&gt;&lt;span style="color: black;"&gt;]);&lt;/span&gt;&lt;/em&gt;&lt;/div&gt;&lt;div style="color: #31595e; font: 11.0px Menlo; margin: 0.0px 0.0px 0.0px 0.0px;"&gt;&lt;em style="font-family: 'Lucida Grande', Geneva, Helvetica, Arial, sans-serif; font-style: italic;"&gt;&lt;span style="color: black;"&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style="color: #3d1e81;"&gt;CFShow&lt;/span&gt;&lt;span style="color: black;"&gt;([&lt;/span&gt;&lt;span style="color: #4f8187;"&gt;Resources&lt;/span&gt;&lt;span style="color: black;"&gt; &lt;/span&gt;splitString&lt;span style="color: black;"&gt;:&lt;/span&gt;&lt;span style="color: #d12e1b;"&gt;@""&lt;/span&gt;&lt;span style="color: black;"&gt; &lt;/span&gt;byChar&lt;span style="color: black;"&gt;:&lt;/span&gt;&lt;span style="color: #252bd8;"&gt;','&lt;/span&gt;&lt;span style="color: black;"&gt;]);&lt;/span&gt;&lt;span style="color: #008400;"&gt;//empty string&lt;/span&gt;&lt;/em&gt;&lt;/div&gt;&lt;div style="color: #31595e; font: 11.0px Menlo; margin: 0.0px 0.0px 0.0px 0.0px;"&gt;&lt;em style="font-family: 'Lucida Grande', Geneva, Helvetica, Arial, sans-serif; font-style: italic;"&gt;&lt;span style="color: black;"&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style="color: #3d1e81;"&gt;CFShow&lt;/span&gt;&lt;span style="color: black;"&gt;([&lt;/span&gt;&lt;span style="color: #4f8187;"&gt;Resources&lt;/span&gt;&lt;span style="color: black;"&gt; &lt;/span&gt;splitString&lt;span style="color: black;"&gt;:&lt;/span&gt;&lt;span style="color: #d12e1b;"&gt;@","&lt;/span&gt;&lt;span style="color: black;"&gt; &lt;/span&gt;byChar&lt;span style="color: black;"&gt;:&lt;/span&gt;&lt;span style="color: #252bd8;"&gt;','&lt;/span&gt;&lt;span style="color: black;"&gt;]);&lt;/span&gt;&lt;/em&gt;&lt;/div&gt;&lt;div style="color: #31595e; font: 11.0px Menlo; margin: 0.0px 0.0px 0.0px 0.0px;"&gt;&lt;em style="font-family: 'Lucida Grande', Geneva, Helvetica, Arial, sans-serif; font-style: italic;"&gt;&lt;span style="color: black;"&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style="color: #3d1e81;"&gt;CFShow&lt;/span&gt;&lt;span style="color: black;"&gt;([&lt;/span&gt;&lt;span style="color: #4f8187;"&gt;Resources&lt;/span&gt;&lt;span style="color: black;"&gt; &lt;/span&gt;splitString&lt;span style="color: black;"&gt;:&lt;/span&gt;&lt;span style="color: #d12e1b;"&gt;@",,,,"&lt;/span&gt;&lt;span style="color: black;"&gt; &lt;/span&gt;byChar&lt;span style="color: black;"&gt;:&lt;/span&gt;&lt;span style="color: #252bd8;"&gt;','&lt;/span&gt;&lt;span style="color: black;"&gt;]);&lt;/span&gt;&lt;/em&gt;&lt;/div&gt;&lt;div style="color: #31595e; font: 11.0px Menlo; margin: 0.0px 0.0px 0.0px 0.0px;"&gt;&lt;em style="font-family: 'Lucida Grande', Geneva, Helvetica, Arial, sans-serif; font-style: italic;"&gt;&lt;span style="color: black;"&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style="color: #3d1e81;"&gt;CFShow&lt;/span&gt;&lt;span style="color: black;"&gt;([&lt;/span&gt;&lt;span style="color: #4f8187;"&gt;Resources&lt;/span&gt;&lt;span style="color: black;"&gt; &lt;/span&gt;splitString&lt;span style="color: black;"&gt;:&lt;/span&gt;&lt;span style="color: #d12e1b;"&gt;@",[,,,],,,"&lt;/span&gt;&lt;span style="color: black;"&gt; &lt;/span&gt;byChar&lt;span style="color: black;"&gt;:&lt;/span&gt;&lt;span style="color: #252bd8;"&gt;','&lt;/span&gt;&lt;span style="color: black;"&gt;]);&lt;/span&gt;&lt;/em&gt;&lt;/div&gt;&lt;div style="color: #008400; font: 11.0px Menlo; margin: 0.0px 0.0px 0.0px 0.0px;"&gt;&lt;em style="font-family: 'Lucida Grande', Geneva, Helvetica, Arial, sans-serif; font-style: italic;"&gt;&lt;span style="color: black;"&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style="color: #3d1e81;"&gt;CFShow&lt;/span&gt;&lt;span style="color: black;"&gt;([&lt;/span&gt;&lt;span style="color: #4f8187;"&gt;Resources&lt;/span&gt;&lt;span style="color: black;"&gt; &lt;/span&gt;&lt;span style="color: #31595e;"&gt;splitString&lt;/span&gt;&lt;span style="color: black;"&gt;:&lt;/span&gt;&lt;span style="color: #d12e1b;"&gt;@",(,,,,,,"&lt;/span&gt;&lt;span style="color: black;"&gt; &lt;/span&gt;&lt;span style="color: #31595e;"&gt;byChar&lt;/span&gt;&lt;span style="color: black;"&gt;:&lt;/span&gt;&lt;span style="color: #252bd8;"&gt;','&lt;/span&gt;&lt;span style="color: black;"&gt;]); &lt;/span&gt;// if not finished&lt;/em&gt;&lt;/div&gt;&lt;div style="font: 11.0px Menlo; margin: 0.0px 0.0px 0.0px 0.0px;"&gt;&lt;em style="font-family: 'Lucida Grande', Geneva, Helvetica, Arial, sans-serif; font-style: italic;"&gt;}&lt;/em&gt;&lt;/div&gt;&lt;div&gt;&lt;em style="font-family: 'Lucida Grande', Geneva, Helvetica, Arial, sans-serif; font-style: italic;"&gt;&lt;br /&gt;&lt;/em&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;em style="font-family: 'Lucida Grande', Geneva, Helvetica, Arial, sans-serif; font-style: italic;"&gt;&lt;/em&gt;&lt;br /&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: 'Lucida Grande', Geneva, Helvetica, Arial, sans-serif; font-size: 13px;"&gt;&lt;em style="font-family: 'Lucida Grande', Geneva, Helvetica, Arial, sans-serif; font-size: 13px; font-style: italic;"&gt;Gives output - seems okay!&lt;/em&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: 'Lucida Grande', Geneva, Helvetica, Arial, sans-serif; font-size: x-small;"&gt;&lt;i&gt;&lt;/i&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;/span&gt;&lt;br /&gt;&lt;div style="font: 11.0px Menlo; margin: 0.0px 0.0px 0.0px 0.0px;"&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;b&gt;(&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;/span&gt;&lt;br /&gt;&lt;div style="font: 11.0px Menlo; margin: 0.0px 0.0px 0.0px 0.0px;"&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;b&gt;&amp;nbsp; &amp;nbsp; "[word1, word2,]",&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;/span&gt;&lt;br /&gt;&lt;div style="font: 11.0px Menlo; margin: 0.0px 0.0px 0.0px 0.0px;"&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;b&gt;&amp;nbsp; &amp;nbsp; " word3",&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;div style="font: 11.0px Menlo; margin: 0.0px 0.0px 0.0px 0.0px;"&gt;&lt;b&gt;&amp;nbsp; &amp;nbsp; " word4",&lt;/b&gt;&lt;/div&gt;&lt;div style="font: 11.0px Menlo; margin: 0.0px 0.0px 0.0px 0.0px;"&gt;&lt;b&gt;&amp;nbsp; &amp;nbsp; ""&lt;/b&gt;&lt;/div&gt;&lt;div style="font: 11.0px Menlo; margin: 0.0px 0.0px 0.0px 0.0px;"&gt;&lt;b&gt;)&lt;/b&gt;&lt;/div&gt;&lt;div style="font: 11.0px Menlo; margin: 0.0px 0.0px 0.0px 0.0px;"&gt;&lt;b&gt;(&lt;/b&gt;&lt;/div&gt;&lt;div style="font: 11.0px Menlo; margin: 0.0px 0.0px 0.0px 0.0px;"&gt;&lt;b&gt;&amp;nbsp; &amp;nbsp; "some text (word1, word2)",&lt;/b&gt;&lt;/div&gt;&lt;div style="font: 11.0px Menlo; margin: 0.0px 0.0px 0.0px 0.0px;"&gt;&lt;b&gt;&amp;nbsp; &amp;nbsp; " [word3, word4] suffix",&lt;/b&gt;&lt;/div&gt;&lt;div style="font: 11.0px Menlo; margin: 0.0px 0.0px 0.0px 0.0px;"&gt;&lt;b&gt;&amp;nbsp; &amp;nbsp; " word 5"&lt;/b&gt;&lt;/div&gt;&lt;div style="font: 11.0px Menlo; margin: 0.0px 0.0px 0.0px 0.0px;"&gt;&lt;b&gt;)&lt;/b&gt;&lt;/div&gt;&lt;div style="font: 11.0px Menlo; margin: 0.0px 0.0px 0.0px 0.0px;"&gt;&lt;b&gt;(&lt;/b&gt;&lt;/div&gt;&lt;div style="font: 11.0px Menlo; margin: 0.0px 0.0px 0.0px 0.0px;"&gt;&lt;b&gt;&amp;nbsp; &amp;nbsp; "[]"&lt;/b&gt;&lt;/div&gt;&lt;div style="font: 11.0px Menlo; margin: 0.0px 0.0px 0.0px 0.0px;"&gt;&lt;b&gt;)&lt;/b&gt;&lt;/div&gt;&lt;div style="font: 11.0px Menlo; margin: 0.0px 0.0px 0.0px 0.0px;"&gt;&lt;b&gt;(&lt;/b&gt;&lt;/div&gt;&lt;div style="font: 11.0px Menlo; margin: 0.0px 0.0px 0.0px 0.0px;"&gt;&lt;b&gt;&amp;nbsp; &amp;nbsp; "()()"&lt;/b&gt;&lt;/div&gt;&lt;div style="font: 11.0px Menlo; margin: 0.0px 0.0px 0.0px 0.0px;"&gt;&lt;b&gt;)&lt;/b&gt;&lt;/div&gt;&lt;div style="font: 11.0px Menlo; margin: 0.0px 0.0px 0.0px 0.0px;"&gt;&lt;b&gt;(&lt;/b&gt;&lt;/div&gt;&lt;div style="font: 11.0px Menlo; margin: 0.0px 0.0px 0.0px 0.0px;"&gt;&lt;b&gt;&amp;nbsp; &amp;nbsp; ""&lt;/b&gt;&lt;/div&gt;&lt;div style="font: 11.0px Menlo; margin: 0.0px 0.0px 0.0px 0.0px;"&gt;&lt;b&gt;)&lt;/b&gt;&lt;/div&gt;&lt;div style="font: 11.0px Menlo; margin: 0.0px 0.0px 0.0px 0.0px;"&gt;&lt;b&gt;(&lt;/b&gt;&lt;/div&gt;&lt;div style="font: 11.0px Menlo; margin: 0.0px 0.0px 0.0px 0.0px;"&gt;&lt;b&gt;&amp;nbsp; &amp;nbsp; "",&lt;/b&gt;&lt;/div&gt;&lt;div style="font: 11.0px Menlo; margin: 0.0px 0.0px 0.0px 0.0px;"&gt;&lt;b&gt;&amp;nbsp; &amp;nbsp; ""&lt;/b&gt;&lt;/div&gt;&lt;div style="font: 11.0px Menlo; margin: 0.0px 0.0px 0.0px 0.0px;"&gt;&lt;b&gt;)&lt;/b&gt;&lt;/div&gt;&lt;div style="font: 11.0px Menlo; margin: 0.0px 0.0px 0.0px 0.0px;"&gt;&lt;b&gt;(&lt;/b&gt;&lt;/div&gt;&lt;div style="font: 11.0px Menlo; margin: 0.0px 0.0px 0.0px 0.0px;"&gt;&lt;b&gt;&amp;nbsp; &amp;nbsp; "",&lt;/b&gt;&lt;/div&gt;&lt;div style="font: 11.0px Menlo; margin: 0.0px 0.0px 0.0px 0.0px;"&gt;&lt;b&gt;&amp;nbsp; &amp;nbsp; "",&lt;/b&gt;&lt;/div&gt;&lt;div style="font: 11.0px Menlo; margin: 0.0px 0.0px 0.0px 0.0px;"&gt;&lt;b&gt;&amp;nbsp; &amp;nbsp; "",&lt;/b&gt;&lt;/div&gt;&lt;div style="font: 11.0px Menlo; margin: 0.0px 0.0px 0.0px 0.0px;"&gt;&lt;b&gt;&amp;nbsp; &amp;nbsp; "",&lt;/b&gt;&lt;/div&gt;&lt;div style="font: 11.0px Menlo; margin: 0.0px 0.0px 0.0px 0.0px;"&gt;&lt;b&gt;&amp;nbsp; &amp;nbsp; ""&lt;/b&gt;&lt;/div&gt;&lt;div style="font: 11.0px Menlo; margin: 0.0px 0.0px 0.0px 0.0px;"&gt;&lt;b&gt;)&lt;/b&gt;&lt;/div&gt;&lt;div style="font: 11.0px Menlo; margin: 0.0px 0.0px 0.0px 0.0px;"&gt;&lt;b&gt;(&lt;/b&gt;&lt;/div&gt;&lt;div style="font: 11.0px Menlo; margin: 0.0px 0.0px 0.0px 0.0px;"&gt;&lt;b&gt;&amp;nbsp; &amp;nbsp; "",&lt;/b&gt;&lt;/div&gt;&lt;div style="font: 11.0px Menlo; margin: 0.0px 0.0px 0.0px 0.0px;"&gt;&lt;b&gt;&amp;nbsp; &amp;nbsp; "[,,,]",&lt;/b&gt;&lt;/div&gt;&lt;div style="font: 11.0px Menlo; margin: 0.0px 0.0px 0.0px 0.0px;"&gt;&lt;b&gt;&amp;nbsp; &amp;nbsp; "",&lt;/b&gt;&lt;/div&gt;&lt;div style="font: 11.0px Menlo; margin: 0.0px 0.0px 0.0px 0.0px;"&gt;&lt;b&gt;&amp;nbsp; &amp;nbsp; "",&lt;/b&gt;&lt;/div&gt;&lt;div style="font: 11.0px Menlo; margin: 0.0px 0.0px 0.0px 0.0px;"&gt;&lt;b&gt;&amp;nbsp; &amp;nbsp; ""&lt;/b&gt;&lt;/div&gt;&lt;div style="font: 11.0px Menlo; margin: 0.0px 0.0px 0.0px 0.0px;"&gt;&lt;b&gt;)&lt;/b&gt;&lt;/div&gt;&lt;div style="font: 11.0px Menlo; margin: 0.0px 0.0px 0.0px 0.0px;"&gt;&lt;b&gt;(&lt;/b&gt;&lt;/div&gt;&lt;div style="font: 11.0px Menlo; margin: 0.0px 0.0px 0.0px 0.0px;"&gt;&lt;b&gt;&amp;nbsp; &amp;nbsp; "",&lt;/b&gt;&lt;/div&gt;&lt;div style="font: 11.0px Menlo; margin: 0.0px 0.0px 0.0px 0.0px;"&gt;&lt;b&gt;&amp;nbsp; &amp;nbsp; "(,,,,,,"&lt;/b&gt;&lt;/div&gt;&lt;div style="font: 11.0px Menlo; margin: 0.0px 0.0px 0.0px 0.0px;"&gt;&lt;b&gt;)&lt;/b&gt;&lt;/div&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-size: x-large;"&gt;String comparison for non english characters&lt;/span&gt;&lt;br /&gt;iPhone NSString comparison having Extended ASCII or Latin 1 Unicode character set. I had some problem while sorting esp. Scandinavian character (&lt;span class="Apple-style-span" style="border-collapse: collapse; font-family: Consolas, Menlo, Monaco, 'Lucida Console', 'Liberation Mono', 'DejaVu Sans Mono', 'Bitstream Vera Sans Mono', 'Courier New', monospace, serif; font-size: 14px; line-height: 18px; white-space: pre;"&gt;&lt;code style="background-attachment: initial; background-clip: initial; background-color: #eeeeee; background-image: initial; background-origin: initial; background-position: initial initial; background-repeat: initial initial; border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; font-family: Consolas, Menlo, Monaco, 'Lucida Console', 'Liberation Mono', 'DejaVu Sans Mono', 'Bitstream Vera Sans Mono', 'Courier New', monospace, serif; font-size: 14px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;"&gt;&lt;span class="str" style="background-attachment: initial; background-clip: initial; background-color: transparent; background-image: initial; background-origin: initial; border-bottom-width: 0px; border-color: initial; border-left-width: 0px; border-right-width: 0px; border-style: initial; border-top-width: 0px; color: maroon; font-size: 14px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; vertical-align: baseline;"&gt;ÅåÆæØøab&lt;/span&gt;&lt;/code&gt;&lt;/span&gt;) in strings. This makes me write a new comparison routine for this type of strings.&lt;br /&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;div style="font: 11.0px Menlo; margin: 0.0px 0.0px 0.0px 0.0px; min-height: 13.0px;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="font: 11.0px Menlo; margin: 0.0px 0.0px 0.0px 0.0px;"&gt;+ (&lt;span style="color: #703daa;"&gt;NSComparisonResult&lt;/span&gt;) stringCompare:(&lt;span style="color: #703daa;"&gt;NSString&lt;/span&gt; *)string1 anotherString:(&lt;span style="color: #703daa;"&gt;NSString&lt;/span&gt; *)string2{&lt;/div&gt;&lt;div style="font: 11.0px Menlo; margin: 0.0px 0.0px 0.0px 0.0px;"&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;&lt;span style="color: #ba2da2;"&gt;int&lt;/span&gt; len1 = [string1 &lt;span style="color: #3d1e81;"&gt;length&lt;/span&gt;];&lt;/div&gt;&lt;div style="font: 11.0px Menlo; margin: 0.0px 0.0px 0.0px 0.0px;"&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;&lt;span style="color: #ba2da2;"&gt;int&lt;/span&gt; len2 = [string2 &lt;span style="color: #3d1e81;"&gt;length&lt;/span&gt;];&lt;/div&gt;&lt;div style="font: 11.0px Menlo; margin: 0.0px 0.0px 0.0px 0.0px; min-height: 13.0px;"&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;&lt;/div&gt;&lt;div style="font: 11.0px Menlo; margin: 0.0px 0.0px 0.0px 0.0px;"&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;&lt;span style="color: #ba2da2;"&gt;if&lt;/span&gt; (len1 &amp;lt; len2) {&lt;/div&gt;&lt;div style="font: 11.0px Menlo; margin: 0.0px 0.0px 0.0px 0.0px;"&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt;  &lt;/span&gt;&lt;span style="color: #ba2da2;"&gt;int&lt;/span&gt; i = &lt;span style="color: #252bd8;"&gt;0&lt;/span&gt;;&lt;/div&gt;&lt;div style="font: 11.0px Menlo; margin: 0.0px 0.0px 0.0px 0.0px; min-height: 13.0px;"&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt;  &lt;/span&gt;&lt;/div&gt;&lt;div style="font: 11.0px Menlo; margin: 0.0px 0.0px 0.0px 0.0px;"&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt;  &lt;/span&gt;&lt;span style="color: #ba2da2;"&gt;while&lt;/span&gt; ( i &amp;lt; len1 &amp;amp;&amp;amp; [string1 &lt;span style="color: #3d1e81;"&gt;characterAtIndex&lt;/span&gt;:i] == [string2 &lt;span style="color: #3d1e81;"&gt;characterAtIndex&lt;/span&gt;:i]&amp;nbsp; )&amp;nbsp;&lt;/div&gt;&lt;div style="font: 11.0px Menlo; margin: 0.0px 0.0px 0.0px 0.0px;"&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt;  &lt;/span&gt;{&lt;/div&gt;&lt;div style="font: 11.0px Menlo; margin: 0.0px 0.0px 0.0px 0.0px;"&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt;   &lt;/span&gt;i++;&lt;/div&gt;&lt;div style="font: 11.0px Menlo; margin: 0.0px 0.0px 0.0px 0.0px;"&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt;  &lt;/span&gt;}&lt;/div&gt;&lt;div style="font: 11.0px Menlo; margin: 0.0px 0.0px 0.0px 0.0px;"&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt;  &lt;/span&gt;&lt;span style="color: #ba2da2;"&gt;if&lt;/span&gt; (i == len1) {&lt;/div&gt;&lt;div style="color: #3d1e81; font: 11.0px Menlo; margin: 0.0px 0.0px 0.0px 0.0px;"&gt;&lt;span style="color: black;"&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt;   &lt;/span&gt;&lt;/span&gt;&lt;span style="color: #ba2da2;"&gt;return&lt;/span&gt;&lt;span style="color: black;"&gt; &lt;/span&gt;NSOrderedAscending&lt;span style="color: black;"&gt;;&lt;/span&gt;&lt;/div&gt;&lt;div style="font: 11.0px Menlo; margin: 0.0px 0.0px 0.0px 0.0px;"&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt;  &lt;/span&gt;} &lt;span style="color: #ba2da2;"&gt;else&lt;/span&gt; &lt;span style="color: #ba2da2;"&gt;if&lt;/span&gt; ([string1 &lt;span style="color: #3d1e81;"&gt;characterAtIndex&lt;/span&gt;:i] &amp;lt; [string2 &lt;span style="color: #3d1e81;"&gt;characterAtIndex&lt;/span&gt;:i]) {&lt;/div&gt;&lt;div style="color: #3d1e81; font: 11.0px Menlo; margin: 0.0px 0.0px 0.0px 0.0px;"&gt;&lt;span style="color: black;"&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt;   &lt;/span&gt;&lt;/span&gt;&lt;span style="color: #ba2da2;"&gt;return&lt;/span&gt;&lt;span style="color: black;"&gt; &lt;/span&gt;NSOrderedAscending&lt;span style="color: black;"&gt;;&lt;/span&gt;&lt;/div&gt;&lt;div style="font: 11.0px Menlo; margin: 0.0px 0.0px 0.0px 0.0px;"&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt;  &lt;/span&gt;} &lt;span style="color: #ba2da2;"&gt;else&lt;/span&gt; {&lt;/div&gt;&lt;div style="color: #3d1e81; font: 11.0px Menlo; margin: 0.0px 0.0px 0.0px 0.0px;"&gt;&lt;span style="color: black;"&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt;   &lt;/span&gt;&lt;/span&gt;&lt;span style="color: #ba2da2;"&gt;return&lt;/span&gt;&lt;span style="color: black;"&gt; &lt;/span&gt;NSOrderedDescending&lt;span style="color: black;"&gt;;&lt;/span&gt;&lt;/div&gt;&lt;div style="font: 11.0px Menlo; margin: 0.0px 0.0px 0.0px 0.0px;"&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt;  &lt;/span&gt;}&lt;/div&gt;&lt;div style="font: 11.0px Menlo; margin: 0.0px 0.0px 0.0px 0.0px; min-height: 13.0px;"&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt;  &lt;/span&gt;&lt;/div&gt;&lt;div style="color: #008400; font: 11.0px Menlo; margin: 0.0px 0.0px 0.0px 0.0px;"&gt;&lt;span style="color: black;"&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;} &lt;/span&gt;&lt;span style="color: #ba2da2;"&gt;else&lt;/span&gt;&lt;span style="color: black;"&gt; { &lt;/span&gt;// str1 &amp;gt;= str2 len&lt;/div&gt;&lt;div style="font: 11.0px Menlo; margin: 0.0px 0.0px 0.0px 0.0px;"&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt;  &lt;/span&gt;&lt;span style="color: #ba2da2;"&gt;int&lt;/span&gt; i = &lt;span style="color: #252bd8;"&gt;0&lt;/span&gt;;&lt;/div&gt;&lt;div style="font: 11.0px Menlo; margin: 0.0px 0.0px 0.0px 0.0px; min-height: 13.0px;"&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt;  &lt;/span&gt;&lt;/div&gt;&lt;div style="font: 11.0px Menlo; margin: 0.0px 0.0px 0.0px 0.0px;"&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt;  &lt;/span&gt;&lt;span style="color: #ba2da2;"&gt;while&lt;/span&gt; ( i&amp;lt;len2 &amp;amp;&amp;amp; [string1 &lt;span style="color: #3d1e81;"&gt;characterAtIndex&lt;/span&gt;:i] == [string2 &lt;span style="color: #3d1e81;"&gt;characterAtIndex&lt;/span&gt;:i])&amp;nbsp;&lt;/div&gt;&lt;div style="font: 11.0px Menlo; margin: 0.0px 0.0px 0.0px 0.0px;"&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt;  &lt;/span&gt;{&lt;/div&gt;&lt;div style="font: 11.0px Menlo; margin: 0.0px 0.0px 0.0px 0.0px;"&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt;   &lt;/span&gt;i++;&lt;/div&gt;&lt;div style="font: 11.0px Menlo; margin: 0.0px 0.0px 0.0px 0.0px;"&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt;  &lt;/span&gt;}&lt;/div&gt;&lt;div style="font: 11.0px Menlo; margin: 0.0px 0.0px 0.0px 0.0px;"&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt;  &lt;/span&gt;&lt;span style="color: #ba2da2;"&gt;if&lt;/span&gt; (i == len2 &amp;amp;&amp;amp; i == len1) {&lt;/div&gt;&lt;div style="color: #3d1e81; font: 11.0px Menlo; margin: 0.0px 0.0px 0.0px 0.0px;"&gt;&lt;span style="color: black;"&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt;   &lt;/span&gt;&lt;/span&gt;&lt;span style="color: #ba2da2;"&gt;return&lt;/span&gt;&lt;span style="color: black;"&gt; &lt;/span&gt;NSOrderedSame&lt;span style="color: black;"&gt;;&lt;/span&gt;&lt;/div&gt;&lt;div style="font: 11.0px Menlo; margin: 0.0px 0.0px 0.0px 0.0px;"&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt;  &lt;/span&gt;} &lt;span style="color: #ba2da2;"&gt;else&lt;/span&gt; &lt;span style="color: #ba2da2;"&gt;if&lt;/span&gt; (i == len2){&lt;/div&gt;&lt;div style="color: #3d1e81; font: 11.0px Menlo; margin: 0.0px 0.0px 0.0px 0.0px;"&gt;&lt;span style="color: black;"&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt;   &lt;/span&gt;&lt;/span&gt;&lt;span style="color: #ba2da2;"&gt;return&lt;/span&gt;&lt;span style="color: black;"&gt; &lt;/span&gt;NSOrderedDescending&lt;span style="color: black;"&gt;;&lt;/span&gt;&lt;/div&gt;&lt;div style="font: 11.0px Menlo; margin: 0.0px 0.0px 0.0px 0.0px;"&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt;  &lt;/span&gt;} &lt;span style="color: #ba2da2;"&gt;else&lt;/span&gt; &lt;span style="color: #ba2da2;"&gt;if&lt;/span&gt; ([string1 &lt;span style="color: #3d1e81;"&gt;characterAtIndex&lt;/span&gt;:i] &amp;lt; [string2 &lt;span style="color: #3d1e81;"&gt;characterAtIndex&lt;/span&gt;:i]) {&lt;/div&gt;&lt;div style="color: #3d1e81; font: 11.0px Menlo; margin: 0.0px 0.0px 0.0px 0.0px;"&gt;&lt;span style="color: black;"&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt;   &lt;/span&gt;&lt;/span&gt;&lt;span style="color: #ba2da2;"&gt;return&lt;/span&gt;&lt;span style="color: black;"&gt; &lt;/span&gt;NSOrderedAscending&lt;span style="color: black;"&gt;;&lt;/span&gt;&lt;/div&gt;&lt;div style="font: 11.0px Menlo; margin: 0.0px 0.0px 0.0px 0.0px;"&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt;  &lt;/span&gt;} &lt;span style="color: #ba2da2;"&gt;else&lt;/span&gt; {&lt;/div&gt;&lt;div style="color: #3d1e81; font: 11.0px Menlo; margin: 0.0px 0.0px 0.0px 0.0px;"&gt;&lt;span style="color: black;"&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt;   &lt;/span&gt;&lt;/span&gt;&lt;span style="color: #ba2da2;"&gt;return&lt;/span&gt;&lt;span style="color: black;"&gt; &lt;/span&gt;NSOrderedDescending&lt;span style="color: black;"&gt;;&lt;/span&gt;&lt;/div&gt;&lt;div style="font: 11.0px Menlo; margin: 0.0px 0.0px 0.0px 0.0px;"&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt;  &lt;/span&gt;}&lt;/div&gt;&lt;div style="font: 11.0px Menlo; margin: 0.0px 0.0px 0.0px 0.0px;"&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;}&lt;/div&gt;&lt;div style="font: 11.0px Menlo; margin: 0.0px 0.0px 0.0px 0.0px; min-height: 13.0px;"&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;&lt;/div&gt;&lt;div style="color: #3d1e81; font: 11.0px Menlo; margin: 0.0px 0.0px 0.0px 0.0px;"&gt;&lt;span style="color: black;"&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style="color: #ba2da2;"&gt;return&lt;/span&gt;&lt;span style="color: black;"&gt; &lt;/span&gt;NSOrderedSame&lt;span style="color: black;"&gt;;&lt;/span&gt;&lt;/div&gt;&lt;div style="font: 11.0px Menlo; margin: 0.0px 0.0px 0.0px 0.0px;"&gt;}&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;&lt;div class="api parameters" style="font-family: 'Lucida Grande', Geneva, Helvetica, Arial, sans-serif; font-size: 13px;"&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/4996441835700536347-3924877230030678935?l=i-phone-dev.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://i-phone-dev.blogspot.com/feeds/3924877230030678935/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://i-phone-dev.blogspot.com/2011/11/iphone-nsstring-operations.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4996441835700536347/posts/default/3924877230030678935'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4996441835700536347/posts/default/3924877230030678935'/><link rel='alternate' type='text/html' href='http://i-phone-dev.blogspot.com/2011/11/iphone-nsstring-operations.html' title='iPhone NSString operations in Objective C'/><author><name>Anon</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry></feed>
