<?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:blogger='http://schemas.google.com/blogger/2008' 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-7998216469238959870</id><updated>2026-10-11T00:22:56.379-07:00</updated><category term="ARC in objective-c"/><category term="Appstore submission process"/><category term="NSOperation"/><category term="iPhone app development cycle"/><category term="pinpoint in map"/><category term="pushnotification"/><title type='text'>IOS codes</title><subtitle type='html'></subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://prasadiphonecode.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7998216469238959870/posts/default?redirect=false'/><link rel='alternate' type='text/html' href='http://prasadiphonecode.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><link rel='next' type='application/atom+xml' href='http://www.blogger.com/feeds/7998216469238959870/posts/default?start-index=26&amp;max-results=25&amp;redirect=false'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/01643993695594133107</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>157</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-7998216469238959870.post-1333497186547697793</id><published>2013-01-08T23:30:00.002-08:00</published><updated>2013-01-08T23:30:29.477-08:00</updated><title type='text'>iOS 5 : Customize UINavigationBar and UIBarButtonItem with the Appearance API </title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;br /&gt;
&lt;h1 id=&quot;post-10815&quot; style=&quot;background-color: #f1f1f3; color: darkblue; font-family: Arial, Helvetica, sans-serif; font-size: 22px; font-weight: normal; margin: 0px; padding: 0px;&quot;&gt;
&lt;br /&gt;&lt;/h1&gt;
&lt;div&gt;
&lt;h5 style=&quot;background-color: #f1f1f3; color: #3b3b3b; font-family: &#39;Lucida Grande&#39;, Arial, Helvetica, sans-serif; font-size: 16px; line-height: 27px; margin: 0px; padding: 0px;&quot;&gt;
Change UINavigationBar Background&lt;/h5&gt;
&lt;div style=&quot;background-color: #f1f1f3; color: #3b3b3b; font-family: &#39;Lucida Grande&#39;, Arial, Helvetica, sans-serif; font-size: 13px; line-height: 18px; padding: 0px 0px 10px;&quot;&gt;
With the release of iOS 5, the&amp;nbsp;&lt;strong style=&quot;margin: 0px; padding: 0px;&quot;&gt;UIAppearance&lt;/strong&gt;&amp;nbsp;protocol is used to access the appearance proxy for a class you would like to configure. Customization is done by sending messages to the target class appearance proxy. When changing the appearance of an object, all instances of the object can be updated or only specific instances within a container class.&lt;/div&gt;
&lt;div style=&quot;background-color: #f1f1f3; color: #3b3b3b; font-family: &#39;Lucida Grande&#39;, Arial, Helvetica, sans-serif; font-size: 13px; line-height: 18px; padding: 0px 0px 10px;&quot;&gt;
Let’s see how this looks as it relates to updating the background color of a&amp;nbsp;&lt;strong style=&quot;margin: 0px; padding: 0px;&quot;&gt;UINavigationBar&lt;/strong&gt;, it’s text and the back button which will allow a user to return to a previous view controller.&lt;br style=&quot;margin: 0px; padding: 0px;&quot; /&gt;&lt;span id=&quot;more-10815&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;background-color: #f1f1f3; color: #3b3b3b; font-family: &#39;Lucida Grande&#39;, Arial, Helvetica, sans-serif; font-size: 13px; line-height: 18px; padding: 0px 0px 10px;&quot;&gt;
The image below is the gradient that I will use for the background:&lt;/div&gt;
&lt;div style=&quot;background-color: #f1f1f3; color: #3b3b3b; font-family: &#39;Lucida Grande&#39;, Arial, Helvetica, sans-serif; font-size: 13px; line-height: 18px; padding: 0px 0px 10px;&quot;&gt;
&lt;img alt=&quot;&quot; class=&quot;alignnone size-full wp-image-10819&quot; height=&quot;51&quot; src=&quot;http://mobiledevelopertips.com/wp-content/uploads/2012/01/BlueGradientBackground.png&quot; style=&quot;margin: 0px; padding: 0px;&quot; title=&quot;BlueGradientBackground&quot; width=&quot;54&quot; /&gt;&lt;/div&gt;
&lt;div style=&quot;background-color: #f1f1f3; color: #3b3b3b; font-family: &#39;Lucida Grande&#39;, Arial, Helvetica, sans-serif; font-size: 13px; line-height: 18px; padding: 0px 0px 10px;&quot;&gt;
Using the above image, I created a one pixel wide image for both portrait and landscape variations of the navbar, reason being, the height of the navar bar when the device is in portrait mode is 44, whereas the height for landscape is 32.&lt;/div&gt;
&lt;div style=&quot;background-color: #f1f1f3; color: #3b3b3b; font-family: &#39;Lucida Grande&#39;, Arial, Helvetica, sans-serif; font-size: 13px; line-height: 18px; padding: 0px 0px 10px;&quot;&gt;
The images in my project are NavigationPortraitBackground.png and NavigationLandscapeBackground.png, both shown below:&lt;/div&gt;
&lt;div style=&quot;background-color: #f1f1f3; color: #3b3b3b; font-family: &#39;Lucida Grande&#39;, Arial, Helvetica, sans-serif; font-size: 13px; line-height: 18px; padding: 0px 0px 10px;&quot;&gt;
&lt;img alt=&quot;&quot; class=&quot;alignnone size-full wp-image-10822&quot; height=&quot;44&quot; src=&quot;http://mobiledevelopertips.com/wp-content/uploads/2012/01/NavigationPortraitBackground.png&quot; style=&quot;margin: 0px; padding: 0px;&quot; title=&quot;NavigationPortraitBackground&quot; width=&quot;1&quot; /&gt;&lt;/div&gt;
&lt;div style=&quot;background-color: #f1f1f3; color: #3b3b3b; font-family: &#39;Lucida Grande&#39;, Arial, Helvetica, sans-serif; font-size: 13px; line-height: 18px; padding: 0px 0px 10px;&quot;&gt;
&lt;img alt=&quot;&quot; class=&quot;alignnone size-full wp-image-10837&quot; height=&quot;32&quot; src=&quot;http://mobiledevelopertips.com/wp-content/uploads/2012/01/NavigationLandscapeBackground.png&quot; style=&quot;margin: 0px; padding: 0px;&quot; title=&quot;NavigationLandscapeBackground&quot; width=&quot;1&quot; /&gt;&lt;/div&gt;
&lt;div style=&quot;background-color: #f1f1f3; color: #3b3b3b; font-family: &#39;Lucida Grande&#39;, Arial, Helvetica, sans-serif; font-size: 13px; line-height: 18px; padding: 0px 0px 10px;&quot;&gt;
I now create two&amp;nbsp;&lt;strong style=&quot;margin: 0px; padding: 0px;&quot;&gt;UIImage&lt;/strong&gt;&amp;nbsp;objects:&lt;/div&gt;
&lt;div class=&quot;wp_syntax&quot; style=&quot;background-color: #f9f9f9; border: 1px solid silver; color: #110000; font-family: &#39;Lucida Grande&#39;, Arial, Helvetica, sans-serif; font-size: 13px; margin: 0px 0px 1.5em; overflow-x: auto; overflow-y: hidden; padding: 0px; width: 610px;&quot;&gt;
&lt;table style=&quot;border-collapse: collapse !important; border: none !important; margin: 0px !important; padding: 0px !important; width: 672px;&quot;&gt;&lt;tbody style=&quot;margin: 0px; padding: 0px;&quot;&gt;
&lt;tr style=&quot;margin: 0px; padding: 0px;&quot;&gt;&lt;td class=&quot;code&quot; style=&quot;background-image: none !important; border: none !important; margin: 0px; padding: 0px !important; vertical-align: top !important;&quot;&gt;&lt;pre class=&quot;objc&quot; style=&quot;-webkit-box-shadow: rgba(0, 0, 0, 0) 0px 0px 0px !important; background-color: transparent !important; border-bottom-left-radius: 0px !important; border-bottom-right-radius: 0px !important; border-top-left-radius: 0px !important; border-top-right-radius: 0px !important; box-shadow: rgba(0, 0, 0, 0) 0px 0px 0px !important; clear: none !important; float: none !important; font-size: 12px !important; line-height: 16px !important; overflow: visible !important; padding: 0px !important; width: auto !important;&quot;&gt;&lt;span style=&quot;color: #11740a; font-style: italic; margin: 0px; padding: 0px;&quot;&gt;// Create image for navigation background - portrait&lt;/span&gt;
UIImage &lt;span style=&quot;color: #002200; margin: 0px; padding: 0px;&quot;&gt;*&lt;/span&gt;NavigationPortraitBackground &lt;span style=&quot;color: #002200; margin: 0px; padding: 0px;&quot;&gt;=&lt;/span&gt; &lt;span style=&quot;color: #002200; margin: 0px; padding: 0px;&quot;&gt;[&lt;/span&gt;&lt;span style=&quot;color: #002200; margin: 0px; padding: 0px;&quot;&gt;[&lt;/span&gt;UIImage imageNamed&lt;span style=&quot;color: #002200; margin: 0px; padding: 0px;&quot;&gt;:&lt;/span&gt;&lt;span style=&quot;color: #bf1d1a; margin: 0px; padding: 0px;&quot;&gt;@&lt;/span&gt;&lt;span style=&quot;color: #bf1d1a; margin: 0px; padding: 0px;&quot;&gt;&quot;NavigationPortraitBackground&quot;&lt;/span&gt;&lt;span style=&quot;color: #002200; margin: 0px; padding: 0px;&quot;&gt;]&lt;/span&gt; 
                              resizableImageWithCapInsets&lt;span style=&quot;color: #002200; margin: 0px; padding: 0px;&quot;&gt;:&lt;/span&gt;UIEdgeInsetsMake&lt;span style=&quot;color: #002200; margin: 0px; padding: 0px;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #2400d9; margin: 0px; padding: 0px;&quot;&gt;0&lt;/span&gt;, &lt;span style=&quot;color: #2400d9; margin: 0px; padding: 0px;&quot;&gt;0&lt;/span&gt;, &lt;span style=&quot;color: #2400d9; margin: 0px; padding: 0px;&quot;&gt;0&lt;/span&gt;, &lt;span style=&quot;color: #2400d9; margin: 0px; padding: 0px;&quot;&gt;0&lt;/span&gt;&lt;span style=&quot;color: #002200; margin: 0px; padding: 0px;&quot;&gt;)&lt;/span&gt;&lt;span style=&quot;color: #002200; margin: 0px; padding: 0px;&quot;&gt;]&lt;/span&gt;;
&amp;nbsp;
&lt;span style=&quot;color: #11740a; font-style: italic; margin: 0px; padding: 0px;&quot;&gt;// Create image for navigation background - landscape&lt;/span&gt;
UIImage &lt;span style=&quot;color: #002200; margin: 0px; padding: 0px;&quot;&gt;*&lt;/span&gt;NavigationLandscapeBackground &lt;span style=&quot;color: #002200; margin: 0px; padding: 0px;&quot;&gt;=&lt;/span&gt; &lt;span style=&quot;color: #002200; margin: 0px; padding: 0px;&quot;&gt;[&lt;/span&gt;&lt;span style=&quot;color: #002200; margin: 0px; padding: 0px;&quot;&gt;[&lt;/span&gt;UIImage imageNamed&lt;span style=&quot;color: #002200; margin: 0px; padding: 0px;&quot;&gt;:&lt;/span&gt;&lt;span style=&quot;color: #bf1d1a; margin: 0px; padding: 0px;&quot;&gt;@&lt;/span&gt;&lt;span style=&quot;color: #bf1d1a; margin: 0px; padding: 0px;&quot;&gt;&quot;NavigationLandscapeBackground&quot;&lt;/span&gt;&lt;span style=&quot;color: #002200; margin: 0px; padding: 0px;&quot;&gt;]&lt;/span&gt; 
                              resizableImageWithCapInsets&lt;span style=&quot;color: #002200; margin: 0px; padding: 0px;&quot;&gt;:&lt;/span&gt;UIEdgeInsetsMake&lt;span style=&quot;color: #002200; margin: 0px; padding: 0px;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #2400d9; margin: 0px; padding: 0px;&quot;&gt;0&lt;/span&gt;, &lt;span style=&quot;color: #2400d9; margin: 0px; padding: 0px;&quot;&gt;0&lt;/span&gt;, &lt;span style=&quot;color: #2400d9; margin: 0px; padding: 0px;&quot;&gt;0&lt;/span&gt;, &lt;span style=&quot;color: #2400d9; margin: 0px; padding: 0px;&quot;&gt;0&lt;/span&gt;&lt;span style=&quot;color: #002200; margin: 0px; padding: 0px;&quot;&gt;)&lt;/span&gt;&lt;span style=&quot;color: #002200; margin: 0px; padding: 0px;&quot;&gt;]&lt;/span&gt;;&lt;/pre&gt;
&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;/div&gt;
&lt;div style=&quot;background-color: #f1f1f3; color: #3b3b3b; font-family: &#39;Lucida Grande&#39;, Arial, Helvetica, sans-serif; font-size: 13px; line-height: 18px; padding: 0px 0px 10px;&quot;&gt;
To set these images as the new backgrounds for all navigation bars, here’s all I need to do:&lt;/div&gt;
&lt;div class=&quot;wp_syntax&quot; style=&quot;background-color: #f9f9f9; border: 1px solid silver; color: #110000; font-family: &#39;Lucida Grande&#39;, Arial, Helvetica, sans-serif; font-size: 13px; margin: 0px 0px 1.5em; overflow-x: auto; overflow-y: hidden; padding: 0px; width: 610px;&quot;&gt;
&lt;table style=&quot;border-collapse: collapse !important; border: none !important; margin: 0px !important; padding: 0px !important; width: 610px;&quot;&gt;&lt;tbody style=&quot;margin: 0px; padding: 0px;&quot;&gt;
&lt;tr style=&quot;margin: 0px; padding: 0px;&quot;&gt;&lt;td class=&quot;code&quot; style=&quot;background-image: none !important; border: none !important; margin: 0px; padding: 0px !important; vertical-align: top !important;&quot;&gt;&lt;pre class=&quot;objc&quot; style=&quot;-webkit-box-shadow: rgba(0, 0, 0, 0) 0px 0px 0px !important; background-color: transparent !important; border-bottom-left-radius: 0px !important; border-bottom-right-radius: 0px !important; border-top-left-radius: 0px !important; border-top-right-radius: 0px !important; box-shadow: rgba(0, 0, 0, 0) 0px 0px 0px !important; clear: none !important; float: none !important; font-size: 12px !important; line-height: 16px !important; overflow: visible !important; padding: 0px !important; width: auto !important;&quot;&gt;&lt;span style=&quot;color: #11740a; font-style: italic; margin: 0px; padding: 0px;&quot;&gt;// Set the background image all UINavigationBars&lt;/span&gt;
&lt;span style=&quot;color: #002200; margin: 0px; padding: 0px;&quot;&gt;[&lt;/span&gt;&lt;span style=&quot;color: #002200; margin: 0px; padding: 0px;&quot;&gt;[&lt;/span&gt;UINavigationBar appearance&lt;span style=&quot;color: #002200; margin: 0px; padding: 0px;&quot;&gt;]&lt;/span&gt; setBackgroundImage&lt;span style=&quot;color: #002200; margin: 0px; padding: 0px;&quot;&gt;:&lt;/span&gt;NavigationPortraitBackground 
                                     forBarMetrics&lt;span style=&quot;color: #002200; margin: 0px; padding: 0px;&quot;&gt;:&lt;/span&gt;UIBarMetricsDefault&lt;span style=&quot;color: #002200; margin: 0px; padding: 0px;&quot;&gt;]&lt;/span&gt;;
&lt;span style=&quot;color: #002200; margin: 0px; padding: 0px;&quot;&gt;[&lt;/span&gt;&lt;span style=&quot;color: #002200; margin: 0px; padding: 0px;&quot;&gt;[&lt;/span&gt;UINavigationBar appearance&lt;span style=&quot;color: #002200; margin: 0px; padding: 0px;&quot;&gt;]&lt;/span&gt; setBackgroundImage&lt;span style=&quot;color: #002200; margin: 0px; padding: 0px;&quot;&gt;:&lt;/span&gt;NavigationLandscapeBackground 
                                     forBarMetrics&lt;span style=&quot;color: #002200; margin: 0px; padding: 0px;&quot;&gt;:&lt;/span&gt;UIBarMetricsLandscapePhone&lt;span style=&quot;color: #002200; margin: 0px; padding: 0px;&quot;&gt;]&lt;/span&gt;;&lt;/pre&gt;
&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;/div&gt;
&lt;div style=&quot;background-color: #f1f1f3; color: #3b3b3b; font-family: &#39;Lucida Grande&#39;, Arial, Helvetica, sans-serif; font-size: 13px; line-height: 18px; padding: 0px 0px 10px;&quot;&gt;
In addition to the color, I can change the appearance of the text on all navigations bars as well:&lt;/div&gt;
&lt;div class=&quot;wp_syntax&quot; style=&quot;background-color: #f9f9f9; border: 1px solid silver; color: #110000; font-family: &#39;Lucida Grande&#39;, Arial, Helvetica, sans-serif; font-size: 13px; margin: 0px 0px 1.5em; overflow-x: auto; overflow-y: hidden; padding: 0px; width: 610px;&quot;&gt;
&lt;table style=&quot;border-collapse: collapse !important; border: none !important; margin: 0px !important; padding: 0px !important; width: 610px;&quot;&gt;&lt;tbody style=&quot;margin: 0px; padding: 0px;&quot;&gt;
&lt;tr style=&quot;margin: 0px; padding: 0px;&quot;&gt;&lt;td class=&quot;code&quot; style=&quot;background-image: none !important; border: none !important; margin: 0px; padding: 0px !important; vertical-align: top !important;&quot;&gt;&lt;pre class=&quot;objc&quot; style=&quot;-webkit-box-shadow: rgba(0, 0, 0, 0) 0px 0px 0px !important; background-color: transparent !important; border-bottom-left-radius: 0px !important; border-bottom-right-radius: 0px !important; border-top-left-radius: 0px !important; border-top-right-radius: 0px !important; box-shadow: rgba(0, 0, 0, 0) 0px 0px 0px !important; clear: none !important; float: none !important; font-size: 12px !important; line-height: 16px !important; overflow: visible !important; padding: 0px !important; width: auto !important;&quot;&gt;&lt;span style=&quot;color: #11740a; font-style: italic; margin: 0px; padding: 0px;&quot;&gt;// Set the text appearance for navbar&lt;/span&gt;
&lt;span style=&quot;color: #002200; margin: 0px; padding: 0px;&quot;&gt;[&lt;/span&gt;&lt;span style=&quot;color: #002200; margin: 0px; padding: 0px;&quot;&gt;[&lt;/span&gt;UINavigationBar appearance&lt;span style=&quot;color: #002200; margin: 0px; padding: 0px;&quot;&gt;]&lt;/span&gt; setTitleTextAttributes&lt;span style=&quot;color: #002200; margin: 0px; padding: 0px;&quot;&gt;:&lt;/span&gt;
    &lt;span style=&quot;color: #002200; margin: 0px; padding: 0px;&quot;&gt;[&lt;/span&gt;&lt;span style=&quot;color: #400080; margin: 0px; padding: 0px;&quot;&gt;NSDictionary&lt;/span&gt; dictionaryWithObjectsAndKeys&lt;span style=&quot;color: #002200; margin: 0px; padding: 0px;&quot;&gt;:&lt;/span&gt;
    &lt;span style=&quot;color: #002200; margin: 0px; padding: 0px;&quot;&gt;[&lt;/span&gt;UIColor whiteColor&lt;span style=&quot;color: #002200; margin: 0px; padding: 0px;&quot;&gt;]&lt;/span&gt;, UITextAttributeTextColor, 
    &lt;span style=&quot;color: #002200; margin: 0px; padding: 0px;&quot;&gt;[&lt;/span&gt;UIColor redColor&lt;span style=&quot;color: #002200; margin: 0px; padding: 0px;&quot;&gt;]&lt;/span&gt;, UITextAttributeTextShadowColor, 
    &lt;span style=&quot;color: #002200; margin: 0px; padding: 0px;&quot;&gt;[&lt;/span&gt;&lt;span style=&quot;color: #400080; margin: 0px; padding: 0px;&quot;&gt;NSValue&lt;/span&gt; valueWithUIOffset&lt;span style=&quot;color: #002200; margin: 0px; padding: 0px;&quot;&gt;:&lt;/span&gt;UIOffsetMake&lt;span style=&quot;color: #002200; margin: 0px; padding: 0px;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #2400d9; margin: 0px; padding: 0px;&quot;&gt;0&lt;/span&gt;, &lt;span style=&quot;color: #2400d9; margin: 0px; padding: 0px;&quot;&gt;0&lt;/span&gt;&lt;span style=&quot;color: #002200; margin: 0px; padding: 0px;&quot;&gt;)&lt;/span&gt;&lt;span style=&quot;color: #002200; margin: 0px; padding: 0px;&quot;&gt;]&lt;/span&gt;, UITextAttributeTextShadowOffset, 
    &lt;span style=&quot;color: #002200; margin: 0px; padding: 0px;&quot;&gt;[&lt;/span&gt;UIFont fontWithName&lt;span style=&quot;color: #002200; margin: 0px; padding: 0px;&quot;&gt;:&lt;/span&gt;&lt;span style=&quot;color: #bf1d1a; margin: 0px; padding: 0px;&quot;&gt;@&lt;/span&gt;&lt;span style=&quot;color: #bf1d1a; margin: 0px; padding: 0px;&quot;&gt;&quot;Verdana-Bold&quot;&lt;/span&gt; size&lt;span style=&quot;color: #002200; margin: 0px; padding: 0px;&quot;&gt;:&lt;/span&gt;&lt;span style=&quot;color: #2400d9; margin: 0px; padding: 0px;&quot;&gt;16&lt;/span&gt;&lt;span style=&quot;color: #002200; margin: 0px; padding: 0px;&quot;&gt;]&lt;/span&gt;, UITextAttributeFont, 
    &lt;span style=&quot;color: #a61390; margin: 0px; padding: 0px;&quot;&gt;nil&lt;/span&gt;&lt;span style=&quot;color: #002200; margin: 0px; padding: 0px;&quot;&gt;]&lt;/span&gt;&lt;span style=&quot;color: #002200; margin: 0px; padding: 0px;&quot;&gt;]&lt;/span&gt;;&lt;/pre&gt;
&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;/div&gt;
&lt;div style=&quot;background-color: #f1f1f3; color: #3b3b3b; font-family: &#39;Lucida Grande&#39;, Arial, Helvetica, sans-serif; font-size: 13px; line-height: 18px; padding: 0px 0px 10px;&quot;&gt;
As the final step, I will update the back button with a custom image, which is shown below (the button is shown on a gray backdrop so you can see the white border):&lt;/div&gt;
&lt;div style=&quot;background-color: #f1f1f3; color: #3b3b3b; font-family: &#39;Lucida Grande&#39;, Arial, Helvetica, sans-serif; font-size: 13px; line-height: 18px; padding: 0px 0px 10px;&quot;&gt;
&lt;img alt=&quot;&quot; class=&quot;alignnone size-full wp-image-10771&quot; height=&quot;60&quot; src=&quot;http://mobiledevelopertips.com/wp-content/uploads/2011/12/blueButton.gif&quot; style=&quot;margin: 0px; padding: 0px;&quot; title=&quot;blueButton&quot; width=&quot;121&quot; /&gt;&lt;/div&gt;
&lt;div style=&quot;background-color: #f1f1f3; color: #3b3b3b; font-family: &#39;Lucida Grande&#39;, Arial, Helvetica, sans-serif; font-size: 13px; line-height: 18px; padding: 0px 0px 10px;&quot;&gt;
Using what I described in the early post about cap insets, I can create a&amp;nbsp;&lt;strong style=&quot;margin: 0px; padding: 0px;&quot;&gt;UIImage&lt;/strong&gt;&amp;nbsp;object and use the appearance API of the&amp;nbsp;&lt;strong style=&quot;margin: 0px; padding: 0px;&quot;&gt;UIBarButtonItem&lt;/strong&gt;&amp;nbsp;to set the back button look. Notice that each value in the cap inset is set to 12, indicating all four corners are to hold steady at 12 pixels, even if the images stretched or resized.&lt;/div&gt;
&lt;div class=&quot;wp_syntax&quot; style=&quot;background-color: #f9f9f9; border: 1px solid silver; color: #110000; font-family: &#39;Lucida Grande&#39;, Arial, Helvetica, sans-serif; font-size: 13px; margin: 0px 0px 1.5em; overflow-x: auto; overflow-y: hidden; padding: 0px; width: 610px;&quot;&gt;
&lt;table style=&quot;border-collapse: collapse !important; border: none !important; margin: 0px !important; padding: 0px !important; width: 938px;&quot;&gt;&lt;tbody style=&quot;margin: 0px; padding: 0px;&quot;&gt;
&lt;tr style=&quot;margin: 0px; padding: 0px;&quot;&gt;&lt;td class=&quot;code&quot; style=&quot;background-image: none !important; border: none !important; margin: 0px; padding: 0px !important; vertical-align: top !important;&quot;&gt;&lt;pre class=&quot;objc&quot; style=&quot;-webkit-box-shadow: rgba(0, 0, 0, 0) 0px 0px 0px !important; background-color: transparent !important; border-bottom-left-radius: 0px !important; border-bottom-right-radius: 0px !important; border-top-left-radius: 0px !important; border-top-right-radius: 0px !important; box-shadow: rgba(0, 0, 0, 0) 0px 0px 0px !important; clear: none !important; float: none !important; font-size: 12px !important; line-height: 16px !important; overflow: visible !important; padding: 0px !important; width: auto !important;&quot;&gt;&lt;span style=&quot;color: #11740a; font-style: italic; margin: 0px; padding: 0px;&quot;&gt;// Set back button for navbar&lt;/span&gt;
UIImage &lt;span style=&quot;color: #002200; margin: 0px; padding: 0px;&quot;&gt;*&lt;/span&gt;backButton &lt;span style=&quot;color: #002200; margin: 0px; padding: 0px;&quot;&gt;=&lt;/span&gt; &lt;span style=&quot;color: #002200; margin: 0px; padding: 0px;&quot;&gt;[&lt;/span&gt;&lt;span style=&quot;color: #002200; margin: 0px; padding: 0px;&quot;&gt;[&lt;/span&gt;UIImage imageNamed&lt;span style=&quot;color: #002200; margin: 0px; padding: 0px;&quot;&gt;:&lt;/span&gt;&lt;span style=&quot;color: #bf1d1a; margin: 0px; padding: 0px;&quot;&gt;@&lt;/span&gt;&lt;span style=&quot;color: #bf1d1a; margin: 0px; padding: 0px;&quot;&gt;&quot;blueButton&quot;&lt;/span&gt;&lt;span style=&quot;color: #002200; margin: 0px; padding: 0px;&quot;&gt;]&lt;/span&gt;  resizableImageWithCapInsets&lt;span style=&quot;color: #002200; margin: 0px; padding: 0px;&quot;&gt;:&lt;/span&gt;UIEdgeInsetsMake&lt;span style=&quot;color: #002200; margin: 0px; padding: 0px;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #2400d9; margin: 0px; padding: 0px;&quot;&gt;12&lt;/span&gt;, &lt;span style=&quot;color: #2400d9; margin: 0px; padding: 0px;&quot;&gt;12&lt;/span&gt;, &lt;span style=&quot;color: #2400d9; margin: 0px; padding: 0px;&quot;&gt;12&lt;/span&gt;, &lt;span style=&quot;color: #2400d9; margin: 0px; padding: 0px;&quot;&gt;12&lt;/span&gt;&lt;span style=&quot;color: #002200; margin: 0px; padding: 0px;&quot;&gt;)&lt;/span&gt;&lt;span style=&quot;color: #002200; margin: 0px; padding: 0px;&quot;&gt;]&lt;/span&gt;;
  &lt;span style=&quot;color: #002200; margin: 0px; padding: 0px;&quot;&gt;[&lt;/span&gt;&lt;span style=&quot;color: #002200; margin: 0px; padding: 0px;&quot;&gt;[&lt;/span&gt;UIBarButtonItem appearance&lt;span style=&quot;color: #002200; margin: 0px; padding: 0px;&quot;&gt;]&lt;/span&gt; setBackButtonBackgroundImage&lt;span style=&quot;color: #002200; margin: 0px; padding: 0px;&quot;&gt;:&lt;/span&gt;backButton forState&lt;span style=&quot;color: #002200; margin: 0px; padding: 0px;&quot;&gt;:&lt;/span&gt;UIControlStateNormal barMetrics&lt;span style=&quot;color: #002200; margin: 0px; padding: 0px;&quot;&gt;:&lt;/span&gt;UIBarMetricsDefault&lt;span style=&quot;color: #002200; margin: 0px; padding: 0px;&quot;&gt;]&lt;/span&gt;;&lt;/pre&gt;
&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;/div&gt;
&lt;div style=&quot;background-color: #f1f1f3; color: #3b3b3b; font-family: &#39;Lucida Grande&#39;, Arial, Helvetica, sans-serif; font-size: 13px; line-height: 18px; padding: 0px 0px 10px;&quot;&gt;
The last step is to create a button for the user interface that will push a new view controller, which will update the navigation bar to show the custom back button created above.&lt;/div&gt;
&lt;div class=&quot;wp_syntax&quot; style=&quot;background-color: #f9f9f9; border: 1px solid silver; color: #110000; font-family: &#39;Lucida Grande&#39;, Arial, Helvetica, sans-serif; font-size: 13px; margin: 0px 0px 1.5em; overflow-x: auto; overflow-y: hidden; padding: 0px; width: 610px;&quot;&gt;
&lt;table style=&quot;border-collapse: collapse !important; border: none !important; margin: 0px !important; padding: 0px !important; width: 840px;&quot;&gt;&lt;tbody style=&quot;margin: 0px; padding: 0px;&quot;&gt;
&lt;tr style=&quot;margin: 0px; padding: 0px;&quot;&gt;&lt;td class=&quot;code&quot; style=&quot;background-image: none !important; border: none !important; margin: 0px; padding: 0px !important; vertical-align: top !important;&quot;&gt;&lt;pre class=&quot;objc&quot; style=&quot;-webkit-box-shadow: rgba(0, 0, 0, 0) 0px 0px 0px !important; background-color: transparent !important; border-bottom-left-radius: 0px !important; border-bottom-right-radius: 0px !important; border-top-left-radius: 0px !important; border-top-right-radius: 0px !important; box-shadow: rgba(0, 0, 0, 0) 0px 0px 0px !important; clear: none !important; float: none !important; font-size: 12px !important; line-height: 16px !important; overflow: visible !important; padding: 0px !important; width: auto !important;&quot;&gt;...
&amp;nbsp;
testButton &lt;span style=&quot;color: #002200; margin: 0px; padding: 0px;&quot;&gt;=&lt;/span&gt; &lt;span style=&quot;color: #002200; margin: 0px; padding: 0px;&quot;&gt;[&lt;/span&gt;&lt;span style=&quot;color: #002200; margin: 0px; padding: 0px;&quot;&gt;[&lt;/span&gt;UIButton alloc&lt;span style=&quot;color: #002200; margin: 0px; padding: 0px;&quot;&gt;]&lt;/span&gt; initWithFrame&lt;span style=&quot;color: #002200; margin: 0px; padding: 0px;&quot;&gt;:&lt;/span&gt;CGRectMake&lt;span style=&quot;color: #002200; margin: 0px; padding: 0px;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #2400d9; margin: 0px; padding: 0px;&quot;&gt;80&lt;/span&gt;, &lt;span style=&quot;color: #2400d9; margin: 0px; padding: 0px;&quot;&gt;30&lt;/span&gt;, &lt;span style=&quot;color: #2400d9; margin: 0px; padding: 0px;&quot;&gt;160&lt;/span&gt;, &lt;span style=&quot;color: #2400d9; margin: 0px; padding: 0px;&quot;&gt;44&lt;/span&gt;&lt;span style=&quot;color: #002200; margin: 0px; padding: 0px;&quot;&gt;)&lt;/span&gt;&lt;span style=&quot;color: #002200; margin: 0px; padding: 0px;&quot;&gt;]&lt;/span&gt;;  
&lt;span style=&quot;color: #002200; margin: 0px; padding: 0px;&quot;&gt;[&lt;/span&gt;testButton setTitle&lt;span style=&quot;color: #002200; margin: 0px; padding: 0px;&quot;&gt;:&lt;/span&gt;&lt;span style=&quot;color: #bf1d1a; margin: 0px; padding: 0px;&quot;&gt;@&lt;/span&gt;&lt;span style=&quot;color: #bf1d1a; margin: 0px; padding: 0px;&quot;&gt;&quot;Test Button&quot;&lt;/span&gt; forState&lt;span style=&quot;color: #002200; margin: 0px; padding: 0px;&quot;&gt;:&lt;/span&gt;UIControlStateNormal&lt;span style=&quot;color: #002200; margin: 0px; padding: 0px;&quot;&gt;]&lt;/span&gt;;
&amp;nbsp;
&lt;span style=&quot;color: #11740a; font-style: italic; margin: 0px; padding: 0px;&quot;&gt;// Notice cap insets are different from above&lt;/span&gt;
UIImage &lt;span style=&quot;color: #002200; margin: 0px; padding: 0px;&quot;&gt;*&lt;/span&gt;buttonImage &lt;span style=&quot;color: #002200; margin: 0px; padding: 0px;&quot;&gt;=&lt;/span&gt; &lt;span style=&quot;color: #002200; margin: 0px; padding: 0px;&quot;&gt;[&lt;/span&gt;&lt;span style=&quot;color: #002200; margin: 0px; padding: 0px;&quot;&gt;[&lt;/span&gt;UIImage imageNamed&lt;span style=&quot;color: #002200; margin: 0px; padding: 0px;&quot;&gt;:&lt;/span&gt;&lt;span style=&quot;color: #bf1d1a; margin: 0px; padding: 0px;&quot;&gt;@&lt;/span&gt;&lt;span style=&quot;color: #bf1d1a; margin: 0px; padding: 0px;&quot;&gt;&quot;blueButton&quot;&lt;/span&gt;&lt;span style=&quot;color: #002200; margin: 0px; padding: 0px;&quot;&gt;]&lt;/span&gt;  resizableImageWithCapInsets&lt;span style=&quot;color: #002200; margin: 0px; padding: 0px;&quot;&gt;:&lt;/span&gt;UIEdgeInsetsMake&lt;span style=&quot;color: #002200; margin: 0px; padding: 0px;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #2400d9; margin: 0px; padding: 0px;&quot;&gt;0&lt;/span&gt;, &lt;span style=&quot;color: #2400d9; margin: 0px; padding: 0px;&quot;&gt;16&lt;/span&gt;, &lt;span style=&quot;color: #2400d9; margin: 0px; padding: 0px;&quot;&gt;0&lt;/span&gt;, &lt;span style=&quot;color: #2400d9; margin: 0px; padding: 0px;&quot;&gt;16&lt;/span&gt;&lt;span style=&quot;color: #002200; margin: 0px; padding: 0px;&quot;&gt;)&lt;/span&gt;&lt;span style=&quot;color: #002200; margin: 0px; padding: 0px;&quot;&gt;]&lt;/span&gt;;
&amp;nbsp;
&lt;span style=&quot;color: #002200; margin: 0px; padding: 0px;&quot;&gt;[&lt;/span&gt;testButton addTarget&lt;span style=&quot;color: #002200; margin: 0px; padding: 0px;&quot;&gt;:&lt;/span&gt;self action&lt;span style=&quot;color: #002200; margin: 0px; padding: 0px;&quot;&gt;:&lt;/span&gt;&lt;span style=&quot;color: #a61390; margin: 0px; padding: 0px;&quot;&gt;@selector&lt;/span&gt;&lt;span style=&quot;color: #002200; margin: 0px; padding: 0px;&quot;&gt;(&lt;/span&gt;buttonPressed&lt;span style=&quot;color: #002200; margin: 0px; padding: 0px;&quot;&gt;:&lt;/span&gt;&lt;span style=&quot;color: #002200; margin: 0px; padding: 0px;&quot;&gt;)&lt;/span&gt; forControlEvents&lt;span style=&quot;color: #002200; margin: 0px; padding: 0px;&quot;&gt;:&lt;/span&gt; UIControlEventTouchUpInside&lt;span style=&quot;color: #002200; margin: 0px; padding: 0px;&quot;&gt;]&lt;/span&gt;;        
&lt;span style=&quot;color: #002200; margin: 0px; padding: 0px;&quot;&gt;[&lt;/span&gt;testButton setBackgroundImage&lt;span style=&quot;color: #002200; margin: 0px; padding: 0px;&quot;&gt;:&lt;/span&gt;buttonImage forState&lt;span style=&quot;color: #002200; margin: 0px; padding: 0px;&quot;&gt;:&lt;/span&gt;UIControlStateNormal&lt;span style=&quot;color: #002200; margin: 0px; padding: 0px;&quot;&gt;]&lt;/span&gt;;
&amp;nbsp;
...&lt;/pre&gt;
&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;/div&gt;
&lt;div style=&quot;background-color: #f1f1f3; color: #3b3b3b; font-family: &#39;Lucida Grande&#39;, Arial, Helvetica, sans-serif; font-size: 13px; line-height: 18px; padding: 0px 0px 10px;&quot;&gt;
An important concept to understand here, I’ve used the same image, blueButton.png, for both the custom back button as well as the button on the primary user interface – setting the cap insets specifies the rules, if you will, of how the image can be stretched, yet keep the look appropriate for the context in which the button will appear (that is, on the navbar or main UI).&lt;/div&gt;
&lt;div style=&quot;background-color: #f1f1f3; color: #3b3b3b; font-family: &#39;Lucida Grande&#39;, Arial, Helvetica, sans-serif; font-size: 13px; line-height: 18px; padding: 0px 0px 10px;&quot;&gt;
A few screenshots follow that show the custom navigation bar, text and buttons in both portrait and landscape modes:&lt;/div&gt;
&lt;div style=&quot;background-color: #f1f1f3; color: #3b3b3b; font-family: &#39;Lucida Grande&#39;, Arial, Helvetica, sans-serif; font-size: 13px; line-height: 18px; padding: 0px 0px 10px;&quot;&gt;
&lt;img alt=&quot;&quot; class=&quot;alignnone size-full wp-image-10834&quot; height=&quot;160&quot; src=&quot;http://mobiledevelopertips.com/wp-content/uploads/2012/01/navbar1.png&quot; style=&quot;margin: 0px; padding: 0px;&quot; title=&quot;navbar1&quot; width=&quot;340&quot; /&gt;&lt;/div&gt;
&lt;div style=&quot;background-color: #f1f1f3; color: #3b3b3b; font-family: &#39;Lucida Grande&#39;, Arial, Helvetica, sans-serif; font-size: 13px; line-height: 18px; padding: 0px 0px 10px;&quot;&gt;
&lt;img alt=&quot;&quot; class=&quot;alignnone size-full wp-image-10833&quot; height=&quot;120&quot; src=&quot;http://mobiledevelopertips.com/wp-content/uploads/2012/01/navbar2.png&quot; style=&quot;margin: 0px; padding: 0px;&quot; title=&quot;navbar2&quot; width=&quot;340&quot; /&gt;&lt;/div&gt;
&lt;div style=&quot;background-color: #f1f1f3; color: #3b3b3b; font-family: &#39;Lucida Grande&#39;, Arial, Helvetica, sans-serif; font-size: 13px; line-height: 18px; padding: 0px 0px 10px;&quot;&gt;
&lt;img alt=&quot;&quot; class=&quot;alignnone size-full wp-image-10832&quot; height=&quot;160&quot; src=&quot;http://mobiledevelopertips.com/wp-content/uploads/2012/01/navbar3.png&quot; style=&quot;margin: 0px; padding: 0px;&quot; title=&quot;navbar3&quot; width=&quot;500&quot; /&gt;&lt;/div&gt;
&lt;div style=&quot;background-color: #f1f1f3; color: #3b3b3b; font-family: &#39;Lucida Grande&#39;, Arial, Helvetica, sans-serif; font-size: 13px; line-height: 18px; padding: 0px 0px 10px;&quot;&gt;
&lt;img alt=&quot;&quot; class=&quot;alignnone size-full wp-image-10831&quot; height=&quot;110&quot; src=&quot;http://mobiledevelopertips.com/wp-content/uploads/2012/01/navbar4.png&quot; style=&quot;margin: 0px; padding: 0px;&quot; title=&quot;navbar4&quot; width=&quot;500&quot; /&gt;&lt;/div&gt;
&lt;div style=&quot;background-color: #f1f1f3; color: #3b3b3b; font-family: &#39;Lucida Grande&#39;, Arial, Helvetica, sans-serif; font-size: 13px; line-height: 18px; padding: 0px 0px 10px;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;background-color: #f1f1f3; color: #3b3b3b; font-family: &#39;Lucida Grande&#39;, Arial, Helvetica, sans-serif; font-size: 13px; line-height: 18px; padding: 0px 0px 10px;&quot;&gt;
i copied this post from this link&amp;nbsp;&lt;/div&gt;
&lt;div style=&quot;background-color: #f1f1f3; padding: 0px 0px 10px;&quot;&gt;
&lt;span style=&quot;color: #3b3b3b; font-family: Lucida Grande, Arial, Helvetica, sans-serif; font-size: x-small;&quot;&gt;&lt;span style=&quot;line-height: 18px;&quot;&gt;http://mobiledevelopertips.com/user-interface/ios-5-customize-uinavigationbar-and-uibarbuttonitem-with-appearance-api.html#comment-109364&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://prasadiphonecode.blogspot.com/feeds/1333497186547697793/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://prasadiphonecode.blogspot.com/2013/01/ios-5-customize-uinavigationbar-and.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7998216469238959870/posts/default/1333497186547697793'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7998216469238959870/posts/default/1333497186547697793'/><link rel='alternate' type='text/html' href='http://prasadiphonecode.blogspot.com/2013/01/ios-5-customize-uinavigationbar-and.html' title='iOS 5 : Customize UINavigationBar and UIBarButtonItem with the Appearance API '/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/01643993695594133107</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7998216469238959870.post-7099313635394773204</id><published>2012-10-01T04:16:00.001-07:00</published><updated>2012-10-01T04:16:13.398-07:00</updated><title type='text'>shouldAutorotateToInterfaceOrientation not getting called in iOS 6</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;br /&gt;
&lt;div style=&quot;background-color: white; border: 0px; color: #373737; font-family: &#39;Helvetica Neue&#39;, Helvetica, Arial, sans-serif; font-size: 15px; line-height: 24px; margin-bottom: 1.625em; outline: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;
The shouldAutorotateToInterfaceOrientation method is&amp;nbsp;deprecated&amp;nbsp;in iOS6. Instead shouldAutorotate and supportedInterfaceOrientation methods are used. If some logic is used in shouldAutorotateToInterfaceOrientation method, it should be implemented in -willRotateToInterfaceOrientation:duration: method.&lt;/div&gt;
&lt;div style=&quot;background-color: white; border: 0px; color: #373737; font-family: &#39;Helvetica Neue&#39;, Helvetica, Arial, sans-serif; font-size: 15px; line-height: 24px; margin-bottom: 1.625em; outline: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;
First, if you want the view controller’s content to be able to auto rotate just return YES in -shouldAutorotate method.&lt;/div&gt;
&lt;div&gt;
&lt;table style=&quot;border-collapse: collapse !important; border-spacing: 0px; border: none !important; color: #110000; font-family: &#39;Helvetica Neue&#39;, Helvetica, Arial, sans-serif; font-size: 15px; line-height: 24px; margin: 0px !important; outline: 0px; padding: 0px !important; text-align: start; vertical-align: baseline; width: 546px;&quot;&gt;&lt;tbody style=&quot;border: 0px; font-family: inherit; font-style: inherit; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;
&lt;tr style=&quot;border: 0px; font-family: inherit; font-style: inherit; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;&lt;td class=&quot;line_numbers&quot; style=&quot;border: none !important; font-family: inherit; font-style: inherit; margin: 0px; outline: 0px; padding: 0px !important; vertical-align: top !important;&quot;&gt;&lt;pre style=&quot;-webkit-box-shadow: rgba(0, 0, 0, 0) 0px 0px 0px !important; background-color: rgb(221, 238, 255) !important; border-bottom-left-radius: 0px !important; border-bottom-right-radius: 0px !important; border-top-left-radius: 0px !important; border-top-right-radius: 0px !important; border: 0px; box-shadow: rgba(0, 0, 0, 0) 0px 0px 0px !important; clear: none !important; color: gray !important; float: none !important; font-size: 12px !important; line-height: 16px !important; outline: 0px; overflow: visible !important; padding: 0px 4px !important; text-align: right !important; vertical-align: baseline; width: auto !important;&quot;&gt;1
2
3
4
&lt;/pre&gt;
&lt;/td&gt;&lt;td class=&quot;code&quot; style=&quot;background-image: none !important; border: none !important; font-family: inherit; font-style: inherit; line-height: normal !important; margin: 0px; outline: 0px; padding: 0px !important; vertical-align: top !important;&quot;&gt;&lt;pre class=&quot;objc&quot; style=&quot;-webkit-box-shadow: rgba(0, 0, 0, 0) 0px 0px 0px !important; border-bottom-left-radius: 0px !important; border-bottom-right-radius: 0px !important; border-top-left-radius: 0px !important; border-top-right-radius: 0px !important; border: 0px; box-shadow: rgba(0, 0, 0, 0) 0px 0px 0px !important; clear: none !important; float: none !important; font-size: 12px !important; line-height: 16px !important; outline: 0px; overflow: visible !important; padding: 0px !important; vertical-align: baseline; width: auto !important;&quot;&gt;&lt;span style=&quot;border: 0px; color: #002200; font-family: inherit; font-style: inherit; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;-&lt;/span&gt; &lt;span style=&quot;border: 0px; color: #002200; font-family: inherit; font-style: inherit; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;border: 0px; color: #a61390; font-family: inherit; font-style: inherit; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;BOOL&lt;/span&gt;&lt;span style=&quot;border: 0px; color: #002200; font-family: inherit; font-style: inherit; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;)&lt;/span&gt;shouldAutorotate
&lt;span style=&quot;border: 0px; color: #002200; font-family: inherit; font-style: inherit; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;{&lt;/span&gt;
 &lt;span style=&quot;border: 0px; color: #a61390; font-family: inherit; font-style: inherit; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;return&lt;/span&gt; &lt;span style=&quot;border: 0px; color: #a61390; font-family: inherit; font-style: inherit; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;YES&lt;/span&gt;;
&lt;span style=&quot;border: 0px; color: #002200; font-family: inherit; font-style: inherit; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;}&lt;/span&gt;&lt;/pre&gt;
&lt;pre class=&quot;objc&quot; style=&quot;-webkit-box-shadow: rgba(0, 0, 0, 0) 0px 0px 0px !important; border-bottom-left-radius: 0px !important; border-bottom-right-radius: 0px !important; border-top-left-radius: 0px !important; border-top-right-radius: 0px !important; border: 0px; box-shadow: rgba(0, 0, 0, 0) 0px 0px 0px !important; clear: none !important; float: none !important; font-size: 12px !important; line-height: 16px !important; outline: 0px; overflow: visible !important; padding: 0px !important; vertical-align: baseline; width: auto !important;&quot;&gt;&lt;span style=&quot;border: 0px; color: #002200; font-family: inherit; font-style: inherit; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;
&lt;/span&gt;&lt;/pre&gt;
&lt;pre class=&quot;objc&quot; style=&quot;-webkit-box-shadow: rgba(0, 0, 0, 0) 0px 0px 0px !important; border-bottom-left-radius: 0px !important; border-bottom-right-radius: 0px !important; border-top-left-radius: 0px !important; border-top-right-radius: 0px !important; border: 0px; box-shadow: rgba(0, 0, 0, 0) 0px 0px 0px !important; clear: none !important; float: none !important; font-size: 12px !important; line-height: 16px !important; outline: 0px; overflow: visible !important; padding: 0px !important; vertical-align: baseline; width: auto !important;&quot;&gt;&lt;span style=&quot;border: 0px; color: #002200; font-family: inherit; font-style: inherit; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;&lt;span style=&quot;background-color: white; color: #373737; font-family: &#39;Helvetica Neue&#39;, Helvetica, Arial, sans-serif; font-size: 15px; line-height: 24px; white-space: normal;&quot;&gt;Supported interface orientations are returned in the&amp;nbsp;-supportedInterfaceOrientations method.&lt;/span&gt;&lt;/span&gt;&lt;/pre&gt;
&lt;pre class=&quot;objc&quot; style=&quot;-webkit-box-shadow: rgba(0, 0, 0, 0) 0px 0px 0px !important; border-bottom-left-radius: 0px !important; border-bottom-right-radius: 0px !important; border-top-left-radius: 0px !important; border-top-right-radius: 0px !important; border: 0px; box-shadow: rgba(0, 0, 0, 0) 0px 0px 0px !important; clear: none !important; float: none !important; font-size: 12px !important; line-height: 16px !important; outline: 0px; overflow: visible !important; padding: 0px !important; vertical-align: baseline; width: auto !important;&quot;&gt;&lt;span style=&quot;border: 0px; color: #002200; font-family: inherit; font-style: inherit; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;&lt;pre class=&quot;objc&quot; style=&quot;-webkit-box-shadow: rgba(0, 0, 0, 0) 0px 0px 0px !important; border-bottom-left-radius: 0px !important; border-bottom-right-radius: 0px !important; border-top-left-radius: 0px !important; border-top-right-radius: 0px !important; border: 0px; box-shadow: rgba(0, 0, 0, 0) 0px 0px 0px !important; clear: none !important; float: none !important; outline: 0px; overflow: visible !important; padding: 0px !important; vertical-align: baseline; width: auto !important;&quot;&gt;&lt;span style=&quot;border: 0px; font-family: inherit; font-style: inherit; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;-&lt;/span&gt; &lt;span style=&quot;border: 0px; font-family: inherit; font-style: inherit; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;(&lt;/span&gt;NSUInteger&lt;span style=&quot;border: 0px; font-family: inherit; font-style: inherit; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;)&lt;/span&gt;supportedInterfaceOrientations
&lt;span style=&quot;border: 0px; font-family: inherit; font-style: inherit; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;{&lt;/span&gt;
        &lt;span style=&quot;border: 0px; color: #11740a; font-family: inherit; font-style: italic; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;//if you have different views for portrait and landscape they are assigned here for the first time&lt;/span&gt;
 self.view &lt;span style=&quot;border: 0px; font-family: inherit; font-style: inherit; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;=&lt;/span&gt; UIInterfaceOrientationIsLandscape&lt;span style=&quot;border: 0px; font-family: inherit; font-style: inherit; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;border: 0px; font-family: inherit; font-style: inherit; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;[&lt;/span&gt;&lt;span style=&quot;border: 0px; font-family: inherit; font-style: inherit; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;[&lt;/span&gt;UIApplication sharedApplication&lt;span style=&quot;border: 0px; font-family: inherit; font-style: inherit; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;]&lt;/span&gt; statusBarOrientation&lt;span style=&quot;border: 0px; font-family: inherit; font-style: inherit; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;]&lt;/span&gt;&lt;span style=&quot;border: 0px; font-family: inherit; font-style: inherit; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;)&lt;/span&gt; ? _viewLandscape &lt;span style=&quot;border: 0px; font-family: inherit; font-style: inherit; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;:&lt;/span&gt; _viewPortrait;
        &lt;span style=&quot;border: 0px; color: #11740a; font-family: inherit; font-style: italic; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;//return orientations you want to support&lt;/span&gt;
 &lt;span style=&quot;border: 0px; color: #a61390; font-family: inherit; font-style: inherit; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;return&lt;/span&gt; &lt;span style=&quot;border: 0px; font-family: inherit; font-style: inherit; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;(&lt;/span&gt;UIInterfaceOrientationMaskPortrait | UIInterfaceOrientationMaskLandscapeLeft | UIInterfaceOrientationMaskLandscapeRight | UIInterfaceOrientationMaskPortraitUpsideDown&lt;span style=&quot;border: 0px; font-family: inherit; font-style: inherit; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;)&lt;/span&gt;;
&lt;span style=&quot;border: 0px; font-family: inherit; font-style: inherit; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;}&lt;/span&gt;&lt;/pre&gt;
&lt;pre class=&quot;objc&quot; style=&quot;-webkit-box-shadow: rgba(0, 0, 0, 0) 0px 0px 0px !important; border-bottom-left-radius: 0px !important; border-bottom-right-radius: 0px !important; border-top-left-radius: 0px !important; border-top-right-radius: 0px !important; border: 0px; box-shadow: rgba(0, 0, 0, 0) 0px 0px 0px !important; clear: none !important; float: none !important; outline: 0px; overflow: visible !important; padding: 0px !important; vertical-align: baseline; width: auto !important;&quot;&gt;&lt;span style=&quot;border: 0px; font-family: inherit; font-style: inherit; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;
&lt;/span&gt;&lt;/pre&gt;
&lt;pre class=&quot;objc&quot; style=&quot;-webkit-box-shadow: rgba(0, 0, 0, 0) 0px 0px 0px !important; border-bottom-left-radius: 0px !important; border-bottom-right-radius: 0px !important; border-top-left-radius: 0px !important; border-top-right-radius: 0px !important; border: 0px; box-shadow: rgba(0, 0, 0, 0) 0px 0px 0px !important; clear: none !important; float: none !important; outline: 0px; overflow: visible !important; padding: 0px !important; vertical-align: baseline; width: auto !important;&quot;&gt;&lt;span style=&quot;border: 0px; font-family: inherit; font-style: inherit; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;&lt;span style=&quot;background-color: white; color: #373737; font-family: &#39;Helvetica Neue&#39;, Helvetica, Arial, sans-serif; font-size: 15px; line-height: 24px; white-space: normal;&quot;&gt;f there is some logic, like switching views for landscape and portrait on rotation use the -willRotateToInterfaceOrientation:duration: method.&lt;/span&gt;&lt;/span&gt;&lt;/pre&gt;
&lt;pre class=&quot;objc&quot; style=&quot;-webkit-box-shadow: rgba(0, 0, 0, 0) 0px 0px 0px !important; border-bottom-left-radius: 0px !important; border-bottom-right-radius: 0px !important; border-top-left-radius: 0px !important; border-top-right-radius: 0px !important; border: 0px; box-shadow: rgba(0, 0, 0, 0) 0px 0px 0px !important; clear: none !important; float: none !important; outline: 0px; overflow: visible !important; padding: 0px !important; vertical-align: baseline; width: auto !important;&quot;&gt;&lt;span style=&quot;border: 0px; font-family: inherit; font-style: inherit; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;&lt;span style=&quot;background-color: white; color: #373737; font-family: &#39;Helvetica Neue&#39;, Helvetica, Arial, sans-serif; font-size: 15px; line-height: 24px; white-space: normal;&quot;&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/pre&gt;
&lt;pre class=&quot;objc&quot; style=&quot;-webkit-box-shadow: rgba(0, 0, 0, 0) 0px 0px 0px !important; border-bottom-left-radius: 0px !important; border-bottom-right-radius: 0px !important; border-top-left-radius: 0px !important; border-top-right-radius: 0px !important; border: 0px; box-shadow: rgba(0, 0, 0, 0) 0px 0px 0px !important; clear: none !important; float: none !important; outline: 0px; overflow: visible !important; padding: 0px !important; vertical-align: baseline; width: auto !important;&quot;&gt;&lt;span style=&quot;border: 0px; font-family: inherit; font-style: inherit; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;&lt;span style=&quot;background-color: #f9f9f9; border: 0px; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;-&lt;/span&gt;&lt;span style=&quot;background-color: #f9f9f9; color: #110000;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;background-color: #f9f9f9; border: 0px; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;background-color: #f9f9f9; border: 0px; color: #a61390; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;void&lt;/span&gt;&lt;span style=&quot;background-color: #f9f9f9; border: 0px; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;)&lt;/span&gt;&lt;span style=&quot;background-color: #f9f9f9; color: #110000;&quot;&gt;willRotateToInterfaceOrientation&lt;/span&gt;&lt;span style=&quot;background-color: #f9f9f9; border: 0px; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;:&lt;/span&gt;&lt;span style=&quot;background-color: #f9f9f9; border: 0px; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;background-color: #f9f9f9; color: #110000;&quot;&gt;UIInterfaceOrientation&lt;/span&gt;&lt;span style=&quot;background-color: #f9f9f9; border: 0px; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;)&lt;/span&gt;&lt;span style=&quot;background-color: #f9f9f9; color: #110000;&quot;&gt;toInterfaceOrientation duration&lt;/span&gt;&lt;span style=&quot;background-color: #f9f9f9; border: 0px; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;:&lt;/span&gt;&lt;span style=&quot;background-color: #f9f9f9; border: 0px; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;background-color: #f9f9f9; color: #110000;&quot;&gt;NSTimeInterval&lt;/span&gt;&lt;span style=&quot;background-color: #f9f9f9; border: 0px; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;)&lt;/span&gt;&lt;span style=&quot;background-color: #f9f9f9; color: #110000;&quot;&gt;duration
&lt;/span&gt;&lt;span style=&quot;background-color: #f9f9f9; border: 0px; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;{&lt;/span&gt;&lt;span style=&quot;background-color: #f9f9f9; color: #110000;&quot;&gt;
 &lt;/span&gt;&lt;span style=&quot;background-color: #f9f9f9; border: 0px; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;[&lt;/span&gt;&lt;span style=&quot;background-color: #f9f9f9; color: #110000;&quot;&gt;super willRotateToInterfaceOrientation&lt;/span&gt;&lt;span style=&quot;background-color: #f9f9f9; border: 0px; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;:&lt;/span&gt;&lt;span style=&quot;background-color: #f9f9f9; color: #110000;&quot;&gt;toInterfaceOrientation duration&lt;/span&gt;&lt;span style=&quot;background-color: #f9f9f9; border: 0px; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;:&lt;/span&gt;&lt;span style=&quot;background-color: #f9f9f9; color: #110000;&quot;&gt;duration&lt;/span&gt;&lt;span style=&quot;background-color: #f9f9f9; border: 0px; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;]&lt;/span&gt;&lt;span style=&quot;background-color: #f9f9f9; color: #110000;&quot;&gt;;
 self.view &lt;/span&gt;&lt;span style=&quot;background-color: #f9f9f9; border: 0px; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;background-color: #f9f9f9; color: #110000;&quot;&gt; UIInterfaceOrientationIsLandscape&lt;/span&gt;&lt;span style=&quot;background-color: #f9f9f9; border: 0px; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;background-color: #f9f9f9; color: #110000;&quot;&gt;toInterfaceOrientation&lt;/span&gt;&lt;span style=&quot;background-color: #f9f9f9; border: 0px; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;)&lt;/span&gt;&lt;span style=&quot;background-color: #f9f9f9; color: #110000;&quot;&gt; ? _viewLandscape &lt;/span&gt;&lt;span style=&quot;background-color: #f9f9f9; border: 0px; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;:&lt;/span&gt;&lt;span style=&quot;background-color: #f9f9f9; color: #110000;&quot;&gt; _viewPortrait;
&lt;/span&gt;&lt;span style=&quot;background-color: #f9f9f9; border: 0px; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/pre&gt;
&lt;/span&gt;&lt;/pre&gt;
&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;/div&gt;
&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://prasadiphonecode.blogspot.com/feeds/7099313635394773204/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://prasadiphonecode.blogspot.com/2012/10/shouldautorotatetointerfaceorientation.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7998216469238959870/posts/default/7099313635394773204'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7998216469238959870/posts/default/7099313635394773204'/><link rel='alternate' type='text/html' href='http://prasadiphonecode.blogspot.com/2012/10/shouldautorotatetointerfaceorientation.html' title='shouldAutorotateToInterfaceOrientation not getting called in iOS 6'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/01643993695594133107</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7998216469238959870.post-3443517778615188131</id><published>2012-09-28T02:11:00.002-07:00</published><updated>2012-09-28T02:11:24.605-07:00</updated><title type='text'>How to get the attributes of an instance of NSTableView</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;br /&gt;
&lt;h3 class=&quot;post-title entry-title&quot; itemprop=&quot;name&quot; style=&quot;background-color: #c0a154; color: #333333; font-family: Georgia, Utopia, &#39;Palatino Linotype&#39;, Palatino, serif; font-size: 30px; font-weight: normal; margin: 0px; position: relative;&quot;&gt;
How to get the attributes of an instance of NSTableView&lt;/h3&gt;
&lt;div class=&quot;post-header&quot; style=&quot;background-color: #c0a154; color: #997755; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; line-height: 1.6; margin: 0px 0px 1em;&quot;&gt;
&lt;div class=&quot;post-header-line-1&quot;&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div class=&quot;post-body entry-content&quot; id=&quot;post-body-5477301932250825427&quot; itemprop=&quot;description articleBody&quot; style=&quot;background-color: #c0a154; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 14px; line-height: 1.5; position: relative; width: 768px;&quot;&gt;
&lt;br /&gt;The table view object (in MacOSx) is a collection of nested objects :&lt;br /&gt;&lt;br /&gt;&lt;ul style=&quot;line-height: 1.4; list-style-image: initial; list-style-position: initial; margin: 0.5em 0px; padding: 0px 2.5em;&quot;&gt;
&lt;li style=&quot;border: none; margin: 0px 0px 0.25em; padding: 0px;&quot;&gt;NSScrollView,&amp;nbsp;&lt;/li&gt;
&lt;li style=&quot;border: none; margin: 0px 0px 0.25em; padding: 0px;&quot;&gt;NSTableView,&lt;/li&gt;
&lt;li style=&quot;border: none; margin: 0px 0px 0.25em; padding: 0px;&quot;&gt;NSTableColumn&lt;/li&gt;
&lt;/ul&gt;
&lt;div&gt;
To get to a ojbect in this collection,&amp;nbsp;&lt;/div&gt;
&lt;div&gt;
&lt;ul style=&quot;line-height: 1.4; list-style-image: initial; list-style-position: initial; margin: 0.5em 0px; padding: 0px 2.5em;&quot;&gt;
&lt;li style=&quot;border: none; margin: 0px 0px 0.25em; padding: 0px;&quot;&gt;&lt;b&gt;hold down the Control and Shift keys&lt;/b&gt;,&amp;nbsp;&lt;u&gt;while clicking&lt;/u&gt;&amp;nbsp;on the table view.&amp;nbsp;&lt;/li&gt;
&lt;/ul&gt;
&lt;div&gt;
You will see a list of the objects under the cursor, and you can select the object you&#39;re interested in.&amp;nbsp;&lt;/div&gt;
&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiYHbEFQOmYkAqnrSJTvLVi2D8qTFWcupEEsOTqO-6Rxk6pzAdAe3mL-XIVnpKFTyyQYj6flD3Jt0BGsm3dtbQCPumn57jMAq_sUT917Y4CJdzvaUUxu0boacR0niknNK9wG1xQ3JNAHRub/s1600/Screen+Shot+2012-04-03+at+9.41.53+PM.png&quot; imageanchor=&quot;1&quot; style=&quot;color: #993322; margin-left: 1em; margin-right: 1em; text-decoration: none;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;400&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiYHbEFQOmYkAqnrSJTvLVi2D8qTFWcupEEsOTqO-6Rxk6pzAdAe3mL-XIVnpKFTyyQYj6flD3Jt0BGsm3dtbQCPumn57jMAq_sUT917Y4CJdzvaUUxu0boacR0niknNK9wG1xQ3JNAHRub/s400/Screen+Shot+2012-04-03+at+9.41.53+PM.png&quot; style=&quot;-webkit-box-shadow: rgba(0, 0, 0, 0.498039) 1px 1px 5px; background-color: white; background-position: initial initial; background-repeat: initial initial; border: none; box-shadow: rgba(0, 0, 0, 0.498039) 1px 1px 5px; padding: 8px; position: relative;&quot; width=&quot;376&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;clear: both;&quot;&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div class=&quot;post-footer&quot; style=&quot;background-color: #c0a154; border-top-color: rgb(119, 119, 119); border-top-style: dashed; border-top-width: 1px; color: #997755; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; line-height: 1.6; margin: 10px 0px 0px; padding: 10px 0px 0px;&quot;&gt;
&lt;/div&gt;
&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://prasadiphonecode.blogspot.com/feeds/3443517778615188131/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://prasadiphonecode.blogspot.com/2012/09/how-to-get-attributes-of-instance-of.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7998216469238959870/posts/default/3443517778615188131'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7998216469238959870/posts/default/3443517778615188131'/><link rel='alternate' type='text/html' href='http://prasadiphonecode.blogspot.com/2012/09/how-to-get-attributes-of-instance-of.html' title='How to get the attributes of an instance of NSTableView'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/01643993695594133107</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiYHbEFQOmYkAqnrSJTvLVi2D8qTFWcupEEsOTqO-6Rxk6pzAdAe3mL-XIVnpKFTyyQYj6flD3Jt0BGsm3dtbQCPumn57jMAq_sUT917Y4CJdzvaUUxu0boacR0niknNK9wG1xQ3JNAHRub/s72-c/Screen+Shot+2012-04-03+at+9.41.53+PM.png" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7998216469238959870.post-7858472059331977144</id><published>2012-09-28T02:09:00.004-07:00</published><updated>2012-09-28T02:09:54.268-07:00</updated><title type='text'>How can you suppress compilers warning &quot;can&#39;t find an implementation of accessor methods&quot;</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;br /&gt;
&lt;h3 class=&quot;post-title entry-title&quot; itemprop=&quot;name&quot; style=&quot;background-color: #c0a154; color: #333333; font-family: Georgia, Utopia, &#39;Palatino Linotype&#39;, Palatino, serif; font-size: 30px; font-weight: normal; margin: 0px; position: relative;&quot;&gt;
How can you suppress compilers warning &quot;can&#39;t find an implementation of accessor methods&quot;&lt;/h3&gt;
&lt;div class=&quot;post-header&quot; style=&quot;background-color: #c0a154; color: #997755; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; line-height: 1.6; margin: 0px 0px 1em;&quot;&gt;
&lt;div class=&quot;post-header-line-1&quot;&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div class=&quot;post-body entry-content&quot; id=&quot;post-body-2476908765099131644&quot; itemprop=&quot;description articleBody&quot; style=&quot;background-color: #c0a154; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 14px; line-height: 1.5; position: relative; width: 768px;&quot;&gt;
#:fromDocumentation&lt;br /&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: 20pt; margin-bottom: 10pt;&quot;&gt;
&lt;span style=&quot;font-family: &#39;Lucida Grande&#39;; font-size: 13pt;&quot;&gt;You use the&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;font-family: Courier; font-size: 13pt;&quot;&gt;@dynamic&lt;/span&gt;&lt;span style=&quot;font-family: &#39;Lucida Grande&#39;; font-size: 13pt;&quot;&gt;&amp;nbsp;statement to tell the compiler to suppress a warning if it can’t find an implementation of accessor methods specified by an&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;font-family: Courier; font-size: 13pt;&quot;&gt;@property&lt;/span&gt;&lt;span style=&quot;font-family: &#39;Lucida Grande&#39;; font-size: 13pt;&quot;&gt;&amp;nbsp;declaration.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;table border=&quot;1&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; class=&quot;MsoNormalTable&quot; style=&quot;border-collapse: collapse; border: none;&quot;&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td style=&quot;background-color: #edf2f8; background-position: initial initial; background-repeat: initial initial; border: 1pt solid rgb(187, 196, 204); padding: 0cm 5.4pt; width: 717pt;&quot; width=&quot;717&quot;&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: 13pt;&quot;&gt;
&lt;span style=&quot;font-family: Courier;&quot;&gt;@implementation MyClass&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: 13pt;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td style=&quot;background-color: #edf2f8; background-position: initial initial; background-repeat: initial initial; border-left-color: rgb(187, 196, 204); border-left-width: 1pt; border-right-color: rgb(187, 196, 204); border-right-width: 1pt; border-style: none solid; padding: 0cm 5.4pt; width: 717pt;&quot; width=&quot;717&quot;&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: 13pt;&quot;&gt;
&lt;span style=&quot;font-family: Courier;&quot;&gt;@dynamic title;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: 13pt;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td style=&quot;background-color: #edf2f8; background-position: initial initial; background-repeat: initial initial; border: 1pt solid rgb(187, 196, 204); padding: 0cm 5.4pt; width: 717pt;&quot; width=&quot;717&quot;&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;line-height: 13pt;&quot;&gt;
&lt;span style=&quot;font-family: Courier;&quot;&gt;@end&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;div style=&quot;clear: both;&quot;&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div class=&quot;post-footer&quot; style=&quot;background-color: #c0a154; border-top-color: rgb(119, 119, 119); border-top-style: dashed; border-top-width: 1px; color: #997755; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; line-height: 1.6; margin: 10px 0px 0px; padding: 10px 0px 0px;&quot;&gt;
&lt;/div&gt;
&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://prasadiphonecode.blogspot.com/feeds/7858472059331977144/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://prasadiphonecode.blogspot.com/2012/09/how-can-you-suppress-compilers-warning.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7998216469238959870/posts/default/7858472059331977144'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7998216469238959870/posts/default/7858472059331977144'/><link rel='alternate' type='text/html' href='http://prasadiphonecode.blogspot.com/2012/09/how-can-you-suppress-compilers-warning.html' title='How can you suppress compilers warning &quot;can&#39;t find an implementation of accessor methods&quot;'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/01643993695594133107</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7998216469238959870.post-7169485119007948940</id><published>2012-09-28T02:09:00.001-07:00</published><updated>2012-09-28T02:09:12.032-07:00</updated><title type='text'>A summary of property-properties attributes - and some tips</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;br /&gt;
&lt;h3 class=&quot;post-title entry-title&quot; itemprop=&quot;name&quot; style=&quot;background-color: #c0a154; color: #333333; font-family: Georgia, Utopia, &#39;Palatino Linotype&#39;, Palatino, serif; font-size: 30px; font-weight: normal; margin: 0px; position: relative;&quot;&gt;
A summary of property-properties attributes - and some tips&lt;/h3&gt;
&lt;div class=&quot;post-header&quot; style=&quot;background-color: #c0a154; color: #997755; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; line-height: 1.6; margin: 0px 0px 1em;&quot;&gt;
&lt;div class=&quot;post-header-line-1&quot;&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div class=&quot;post-body entry-content&quot; id=&quot;post-body-4856703880550363462&quot; itemprop=&quot;description articleBody&quot; style=&quot;background-color: #c0a154; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 14px; line-height: 1.5; position: relative; width: 768px;&quot;&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;/div&gt;
&lt;div style=&quot;text-align: center;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
&lt;table border=&quot;1&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; class=&quot;MsoTableGrid&quot; style=&quot;border-collapse: collapse; border-style: none; margin-left: -37.15pt; width: 532px;&quot;&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td colspan=&quot;5&quot; style=&quot;background-color: black; background-position: initial initial; background-repeat: initial initial; border: 1pt solid black; padding: 0cm 5.4pt; width: 531.6pt;&quot; valign=&quot;top&quot; width=&quot;532&quot;&gt;&lt;div align=&quot;center&quot; class=&quot;MsoNormal&quot; style=&quot;text-align: center;&quot;&gt;
&lt;b&gt;&lt;span style=&quot;color: white; font-size: 9pt;&quot;&gt;@Property attributes&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;
&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td rowspan=&quot;2&quot; style=&quot;background-color: black; background-position: initial initial; background-repeat: initial initial; border: 1pt solid white; padding: 0cm 5.4pt; width: 63.5pt;&quot; width=&quot;64&quot;&gt;&lt;div align=&quot;left&quot; class=&quot;MsoNormal&quot;&gt;
&lt;b&gt;&lt;span style=&quot;color: white; font-size: 9pt;&quot;&gt;Writability&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;
&lt;/td&gt;&lt;td style=&quot;background-color: #bfbfbf; background-position: initial initial; background-repeat: initial initial; border-bottom-color: black; border-bottom-width: 1pt; border-right-color: black; border-right-width: 1pt; border-style: none solid solid none; padding: 0cm 5.4pt; width: 52.2pt;&quot; valign=&quot;top&quot; width=&quot;52&quot;&gt;&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;b&gt;&lt;span style=&quot;font-size: 9pt;&quot;&gt;readwrite&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;
&lt;/td&gt;&lt;td rowspan=&quot;2&quot; style=&quot;border-bottom-color: black; border-bottom-width: 1pt; border-right-color: black; border-right-width: 1pt; border-style: none solid solid none; padding: 0cm 5.4pt; width: 89.9pt;&quot; width=&quot;90&quot;&gt;&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;font-size: 9pt;&quot;&gt;mutually exclusive&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/td&gt;&lt;td style=&quot;border-bottom-color: black; border-bottom-width: 1pt; border-right-color: black; border-right-width: 1pt; border-style: none solid solid none; padding: 0cm 5.4pt; width: 42.5pt;&quot; valign=&quot;top&quot; width=&quot;43&quot;&gt;&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;b&gt;&lt;i&gt;&lt;span style=&quot;font-size: 9pt;&quot;&gt;default&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/i&gt;&lt;/b&gt;&lt;/div&gt;
&lt;/td&gt;&lt;td style=&quot;border-bottom-color: black; border-bottom-width: 1pt; border-right-color: black; border-right-width: 1pt; border-style: none solid solid none; padding: 0cm 5.4pt; width: 10cm;&quot; valign=&quot;top&quot; width=&quot;284&quot;&gt;&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;color: windowtext; font-size: 9pt;&quot;&gt;Indicates that the property should be treated as read/write&lt;/span&gt;&lt;span style=&quot;font-size: 9pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td style=&quot;background-color: #bfbfbf; background-position: initial initial; background-repeat: initial initial; border-bottom-color: black; border-bottom-width: 1pt; border-right-color: black; border-right-width: 1pt; border-style: none solid solid none; padding: 0cm 5.4pt; width: 52.2pt;&quot; valign=&quot;top&quot; width=&quot;52&quot;&gt;&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;b&gt;&lt;span style=&quot;font-size: 9pt;&quot;&gt;readonly&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;
&lt;/td&gt;&lt;td style=&quot;border-bottom-color: black; border-bottom-width: 1pt; border-right-color: black; border-right-width: 1pt; border-style: none solid solid none; padding: 0cm 5.4pt; width: 42.5pt;&quot; valign=&quot;top&quot; width=&quot;43&quot;&gt;&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;/td&gt;&lt;td style=&quot;border-bottom-color: black; border-bottom-width: 1pt; border-right-color: black; border-right-width: 1pt; border-style: none solid solid none; padding: 0cm 5.4pt; width: 10cm;&quot; valign=&quot;top&quot; width=&quot;284&quot;&gt;&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;color: windowtext; font-size: 9pt;&quot;&gt;only a getter method is required&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;font-size: 9pt;&quot;&gt;if you attempt to assign a value using the dot syntax, you get a compiler error.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;font-size: 9pt;&quot;&gt;A readonly property can redelcare it as readwrite in a&amp;nbsp; class extension, a protocol or in a subclass.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td rowspan=&quot;4&quot; style=&quot;background-color: black; background-position: initial initial; background-repeat: initial initial; border: 1pt solid white; padding: 0cm 5.4pt; width: 63.5pt;&quot; width=&quot;64&quot;&gt;&lt;div align=&quot;left&quot; class=&quot;MsoNormal&quot;&gt;
&lt;b&gt;&lt;span style=&quot;color: white; font-size: 9pt;&quot;&gt;Setter&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;
&lt;div align=&quot;left&quot; class=&quot;MsoNormal&quot;&gt;
&lt;b&gt;&lt;span style=&quot;color: white; font-size: 9pt;&quot;&gt;Semantics&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;
&lt;/td&gt;&lt;td colspan=&quot;2&quot; style=&quot;background-color: #bfbfbf; background-position: initial initial; background-repeat: initial initial; border-bottom-color: black; border-bottom-width: 1pt; border-right-color: black; border-right-width: 1pt; border-style: none solid solid none; padding: 0cm 5.4pt; width: 142.1pt;&quot; valign=&quot;top&quot; width=&quot;142&quot;&gt;&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;b&gt;&lt;span style=&quot;font-size: 9pt;&quot;&gt;assign (iOS 5)&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;b&gt;&lt;span style=&quot;font-size: 9pt;&quot;&gt;unsafe_unretain (iOS4)&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div align=&quot;right&quot; class=&quot;MsoNormal&quot; style=&quot;text-align: right;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div align=&quot;right&quot; class=&quot;MsoNormal&quot; style=&quot;text-align: right;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div align=&quot;right&quot; class=&quot;MsoNormal&quot; style=&quot;text-align: right;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;/td&gt;&lt;td style=&quot;background-color: white; background-position: initial initial; background-repeat: initial initial; border-bottom-color: black; border-bottom-width: 1pt; border-right-color: black; border-right-width: 1pt; border-style: none solid solid none; padding: 0cm 5.4pt; width: 42.5pt;&quot; valign=&quot;top&quot; width=&quot;43&quot;&gt;&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;b&gt;&lt;i&gt;&lt;span style=&quot;font-size: 9pt;&quot;&gt;default&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/i&gt;&lt;/b&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;/td&gt;&lt;td style=&quot;background-color: white; background-position: initial initial; background-repeat: initial initial; border-bottom-color: black; border-bottom-width: 1pt; border-right-color: black; border-right-width: 1pt; border-style: none solid solid none; padding: 0cm 5.4pt; width: 10cm;&quot; valign=&quot;top&quot; width=&quot;284&quot;&gt;&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;font-size: 9pt;&quot;&gt;setter uses simple assignment (new value not retained, old value is not released).&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;font-size: 9pt;&quot;&gt;use this for scalar types (NSInteger, CGRect in Ref.Counted env.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;font-size: 9pt;&quot;&gt;on dealloc method make sure that object propertis marked assign are not released and the not assign are released.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;font-family: Courier; font-size: 8pt;&quot;&gt;property=newValue;&lt;/span&gt;&lt;span style=&quot;font-size: 9pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td rowspan=&quot;2&quot; style=&quot;background-color: #bfbfbf; background-position: initial initial; background-repeat: initial initial; border-bottom-color: black; border-bottom-width: 1pt; border-right-color: black; border-right-width: 1pt; border-style: none solid solid none; padding: 0cm 5.4pt; width: 52.2pt;&quot; width=&quot;52&quot;&gt;&lt;div align=&quot;left&quot; class=&quot;MsoNormal&quot;&gt;
&lt;b&gt;&lt;span style=&quot;font-size: 9pt;&quot;&gt;retain&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;
&lt;div align=&quot;left&quot; class=&quot;MsoNormal&quot;&gt;
&lt;b&gt;&lt;span style=&quot;font-size: 9pt;&quot;&gt;strong&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;
&lt;/td&gt;&lt;td colspan=&quot;2&quot; style=&quot;background-color: white; background-position: initial initial; background-repeat: initial initial; border-bottom-color: black; border-bottom-width: 1pt; border-right-color: black; border-right-width: 1pt; border-style: none solid solid none; padding: 0cm 5.4pt; width: 132.4pt;&quot; valign=&quot;top&quot; width=&quot;132&quot;&gt;&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;i&gt;&lt;span style=&quot;font-size: 8pt;&quot;&gt;if (property!=newValue){&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/i&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;i&gt;&lt;span style=&quot;font-size: 8pt;&quot;&gt;&amp;nbsp;[property release];&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/i&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;i&gt;&lt;span style=&quot;font-size: 8pt;&quot;&gt;property = [newValue retain];&lt;/span&gt;&lt;/i&gt;&lt;span style=&quot;font-size: 9pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/td&gt;&lt;td style=&quot;background-color: white; background-position: initial initial; background-repeat: initial initial; border-bottom-color: black; border-bottom-width: 1pt; border-right-color: black; border-right-width: 1pt; border-style: none solid solid none; padding: 0cm 5.4pt; width: 10cm;&quot; valign=&quot;top&quot; width=&quot;284&quot;&gt;&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;font-size: 9pt;&quot;&gt;retain should be invoked on the object upon assignment&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;font-size: 9pt;&quot;&gt;the previous value is sent a release message&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;font-size: 9pt;&quot;&gt;valid only for Objective-C object types (no for Core Foundation)&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; style=&quot;background-color: white; background-position: initial initial; background-repeat: initial initial; border-bottom-color: black; border-bottom-width: 1pt; border-right-color: black; border-right-width: 1pt; border-style: none solid solid none; padding: 0cm 5.4pt; width: 132.4pt;&quot; valign=&quot;top&quot; width=&quot;132&quot;&gt;&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;font-size: 9pt;&quot;&gt;_attribute_&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/td&gt;&lt;td style=&quot;background-color: white; background-position: initial initial; background-repeat: initial initial; border-bottom-color: black; border-bottom-width: 1pt; border-right-color: black; border-right-width: 1pt; border-style: none solid solid none; padding: 0cm 5.4pt; width: 10cm;&quot; valign=&quot;top&quot; width=&quot;284&quot;&gt;&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;font-size: 9pt;&quot;&gt;use&amp;nbsp;&lt;i&gt;attribute&lt;/i&gt;&amp;nbsp;keyword to specify that a Core foundation property should be treated like an Objective C for memory management&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td style=&quot;background-color: #bfbfbf; background-position: initial initial; background-repeat: initial initial; border-bottom-color: black; border-bottom-width: 1pt; border-right-color: black; border-right-width: 1pt; border-style: none solid solid none; padding: 0cm 5.4pt; width: 52.2pt;&quot; valign=&quot;top&quot; width=&quot;52&quot;&gt;&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;b&gt;&lt;span style=&quot;font-size: 9pt;&quot;&gt;copy&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;
&lt;/td&gt;&lt;td colspan=&quot;2&quot; style=&quot;background-color: white; background-position: initial initial; background-repeat: initial initial; border-bottom-color: black; border-bottom-width: 1pt; border-right-color: black; border-right-width: 1pt; border-style: none solid solid none; padding: 0cm 5.4pt; width: 132.4pt;&quot; valign=&quot;top&quot; width=&quot;132&quot;&gt;&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;i&gt;&lt;span style=&quot;font-size: 8pt;&quot;&gt;if (property!=newValue){&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/i&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;i&gt;&lt;span style=&quot;font-size: 8pt;&quot;&gt;[property release];&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/i&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;i&gt;&lt;span style=&quot;font-size: 8pt;&quot;&gt;property = [newValue copy];&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/i&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;i&gt;&lt;span style=&quot;font-size: 8pt;&quot;&gt;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/i&gt;&lt;/div&gt;
&lt;/td&gt;&lt;td style=&quot;background-color: white; background-position: initial initial; background-repeat: initial initial; border-bottom-color: black; border-bottom-width: 1pt; border-right-color: black; border-right-width: 1pt; border-style: none solid solid none; padding: 0cm 5.4pt; width: 10cm;&quot; valign=&quot;top&quot; width=&quot;284&quot;&gt;&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;font-size: 9pt;&quot;&gt;a copy of the object should be used for assignment&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;font-size: 9pt;&quot;&gt;previus value is sent a release message&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;font-size: 9pt;&quot;&gt;valid only for objects that implement the NSCopying protocol&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;b&gt;&lt;i&gt;&lt;span style=&quot;font-size: 9pt;&quot;&gt;WARNING&lt;/span&gt;&lt;/i&gt;&lt;/b&gt;&lt;span style=&quot;font-size: 9pt;&quot;&gt;-the copy method returns an immutable version of a collection, so if you want a mutable version you need to implement the setter rather to synthesize it.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td rowspan=&quot;2&quot; style=&quot;background-color: black; background-position: initial initial; background-repeat: initial initial; border: 1pt solid white; padding: 0cm 5.4pt; width: 63.5pt;&quot; width=&quot;64&quot;&gt;&lt;div align=&quot;left&quot; class=&quot;MsoNormal&quot;&gt;
&lt;b&gt;&lt;span style=&quot;color: white; font-size: 9pt;&quot;&gt;Atomicity&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;
&lt;/td&gt;&lt;td colspan=&quot;3&quot; style=&quot;background-color: #bfbfbf; background-position: initial initial; background-repeat: initial initial; border-bottom-color: black; border-bottom-width: 1pt; border-right-color: black; border-right-width: 1pt; border-style: none solid solid none; padding: 0cm 5.4pt; width: 184.6pt;&quot; valign=&quot;top&quot; width=&quot;185&quot;&gt;&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;b&gt;&lt;span style=&quot;font-size: 9pt;&quot;&gt;nonatomic&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;
&lt;/td&gt;&lt;td rowspan=&quot;2&quot; style=&quot;border-bottom-color: black; border-bottom-width: 1pt; border-right-color: black; border-right-width: 1pt; border-style: none solid solid none; padding: 0cm 5.4pt; width: 10cm;&quot; valign=&quot;top&quot; width=&quot;284&quot;&gt;&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;font-size: 9pt;&quot;&gt;Specify that accessor methods are not atomic&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;font-size: 9pt;&quot;&gt;(by default accessors are atomic=robust access to properties in a multithreaded environment)&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;font-size: 9pt;&quot;&gt;If you specity retain or copy with not the noatomic, then in a reference-counted environment, a synthesized get accessor for an object property uses a lock and retains and autoreleases the returned value (similar to code below nonatomic)&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;3&quot; style=&quot;border-bottom-color: black; border-bottom-width: 1pt; border-right-color: black; border-right-width: 1pt; border-style: none solid solid none; padding: 0cm 5.4pt; width: 184.6pt;&quot; valign=&quot;top&quot; width=&quot;185&quot;&gt;&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;font-size: 9pt;&quot;&gt;[_internal lock]; //lock&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;font-size: 9pt;&quot;&gt;id result = [[value retain] autorelease];&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;font-size: 9pt;&quot;&gt;[_internal unlock];&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;font-size: 9pt;&quot;&gt;return result;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td style=&quot;background-color: black; background-position: initial initial; background-repeat: initial initial; border: 1pt solid white; padding: 0cm 5.4pt; width: 63.5pt;&quot; valign=&quot;top&quot; width=&quot;64&quot;&gt;&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;color: white; font-size: 9pt;&quot;&gt;Interface Outlet&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/td&gt;&lt;td colspan=&quot;3&quot; style=&quot;background-color: #bfbfbf; background-position: initial initial; background-repeat: initial initial; border-bottom-color: black; border-bottom-width: 1pt; border-right-color: black; border-right-width: 1pt; border-style: none solid solid none; padding: 0cm 5.4pt; width: 184.6pt;&quot; valign=&quot;top&quot; width=&quot;185&quot;&gt;&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;b&gt;&lt;span style=&quot;font-size: 9pt;&quot;&gt;IBOutlet&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;/td&gt;&lt;td style=&quot;border-bottom-color: black; border-bottom-width: 1pt; border-right-color: black; border-right-width: 1pt; border-style: none solid solid none; padding: 0cm 5.4pt; width: 10cm;&quot; valign=&quot;top&quot; width=&quot;284&quot;&gt;&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;font-size: 9pt;&quot;&gt;To specify that a property is an Interface Builder oulet&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;font-size: 9pt;&quot;&gt;@property (nonatomic, retain) IBOutlet NSButton *myButton;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;/blockquote&gt;
&lt;div style=&quot;text-align: center;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;br /&gt;&lt;ul style=&quot;line-height: 1.4; list-style-image: initial; list-style-position: initial; margin: 0.5em 0px; padding: 0px 2.5em;&quot;&gt;
&lt;li style=&quot;border: none; margin: 0px 0px 0.25em; padding: 0px;&quot;&gt;when you see __Blabla is for instance variables and Blabla is for property attribute.&lt;/li&gt;
&lt;li style=&quot;border: none; margin: 0px 0px 0.25em; padding: 0px;&quot;&gt;For declared properties, you should use&amp;nbsp;&lt;span class=&quot;s1&quot;&gt;assign&lt;/span&gt;&amp;nbsp;instead of&amp;nbsp;&lt;span class=&quot;s1&quot;&gt;weak&lt;/span&gt;; for variables you should use&amp;nbsp;&lt;span class=&quot;s1&quot;&gt;__unsafe_unretained&lt;/span&gt;&amp;nbsp;instead of&amp;nbsp;&lt;span class=&quot;s1&quot;&gt;__weak&lt;/span&gt;.&lt;/li&gt;
&lt;li style=&quot;border: none; margin: 0px 0px 0.25em; padding: 0px;&quot;&gt;You will always use unsafe_unretained for properties that hold non-objects.&lt;/li&gt;
&lt;li style=&quot;border: none; margin: 0px 0px 0.25em; padding: 0px;&quot;&gt;For properties that hold objects, you will usually use strong&lt;/li&gt;
&lt;li style=&quot;border: none; margin: 0px 0px 0.25em; padding: 0px;&quot;&gt;unsafe_unretained will have a &quot;dangling pointer&quot; if the object it points to is deallocated.&lt;/li&gt;
&lt;li style=&quot;border: none; margin: 0px 0px 0.25em; padding: 0px;&quot;&gt;&lt;span style=&quot;background-color: white; font-family: Arial, &#39;Liberation Sans&#39;, &#39;DejaVu Sans&#39;, sans-serif; line-height: 18px;&quot;&gt;Their most common use is for delegates, where you&#39;d define a property for that delegate with the&amp;nbsp;&lt;/span&gt;&lt;code style=&quot;background-color: #eeeeee; border-width: 0px; font-family: Consolas, Menlo, Monaco, &#39;Lucida Console&#39;, &#39;Liberation Mono&#39;, &#39;DejaVu Sans Mono&#39;, &#39;Bitstream Vera Sans Mono&#39;, &#39;Courier New&#39;, monospace, serif; line-height: 18px; margin: 0px; padding: 1px 5px; vertical-align: baseline;&quot;&gt;weak&lt;/code&gt;&lt;span style=&quot;background-color: white; font-family: Arial, &#39;Liberation Sans&#39;, &#39;DejaVu Sans&#39;, sans-serif; line-height: 18px;&quot;&gt;&amp;nbsp;or&lt;/span&gt;&lt;code style=&quot;background-color: #eeeeee; border-width: 0px; font-family: Consolas, Menlo, Monaco, &#39;Lucida Console&#39;, &#39;Liberation Mono&#39;, &#39;DejaVu Sans Mono&#39;, &#39;Bitstream Vera Sans Mono&#39;, &#39;Courier New&#39;, monospace, serif; line-height: 18px; margin: 0px; padding: 1px 5px; vertical-align: baseline;&quot;&gt;unsafe_unretained&lt;/code&gt;&lt;span style=&quot;background-color: white; font-family: Arial, &#39;Liberation Sans&#39;, &#39;DejaVu Sans&#39;, sans-serif; line-height: 18px;&quot;&gt;&amp;nbsp;attribute (&lt;/span&gt;&lt;code style=&quot;background-color: #eeeeee; border-width: 0px; font-family: Consolas, Menlo, Monaco, &#39;Lucida Console&#39;, &#39;Liberation Mono&#39;, &#39;DejaVu Sans Mono&#39;, &#39;Bitstream Vera Sans Mono&#39;, &#39;Courier New&#39;, monospace, serif; line-height: 18px; margin: 0px; padding: 1px 5px; vertical-align: baseline;&quot;&gt;assign&lt;/code&gt;&lt;span style=&quot;background-color: white; font-family: Arial, &#39;Liberation Sans&#39;, &#39;DejaVu Sans&#39;, sans-serif; line-height: 18px;&quot;&gt;&amp;nbsp;is effectively&amp;nbsp;&lt;/span&gt;&lt;code style=&quot;background-color: #eeeeee; border-width: 0px; font-family: Consolas, Menlo, Monaco, &#39;Lucida Console&#39;, &#39;Liberation Mono&#39;, &#39;DejaVu Sans Mono&#39;, &#39;Bitstream Vera Sans Mono&#39;, &#39;Courier New&#39;, monospace, serif; line-height: 18px; margin: 0px; padding: 1px 5px; vertical-align: baseline;&quot;&gt;unsafe_unretained&lt;/code&gt;&lt;span style=&quot;background-color: white; font-family: Arial, &#39;Liberation Sans&#39;, &#39;DejaVu Sans&#39;, sans-serif; line-height: 18px;&quot;&gt;),&lt;/span&gt;&lt;/li&gt;
&lt;li style=&quot;border: none; margin: 0px 0px 0.25em; padding: 0px;&quot;&gt;copy attribute is most common with object types that have mutable subclasses.&lt;/li&gt;
&lt;li style=&quot;border: none; margin: 0px 0px 0.25em; padding: 0px;&quot;&gt;copy method returns an immutable copy.&lt;/li&gt;
&lt;li style=&quot;border: none; margin: 0px 0px 0.25em; padding: 0px;&quot;&gt;Curiously the copy and mutableCopy methods are define in NSObject like this:&lt;/li&gt;
&lt;/ul&gt;
&lt;div&gt;
-(id) copy &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;{return [self &amp;nbsp;copyWithZone:NULL];}&lt;/div&gt;
&lt;div&gt;
-(id) mutableCopy {return [self mutableCopyWithZone:NULL];}&lt;/div&gt;
&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;So you need to be&amp;nbsp;carefully in your custom objects (you need to&amp;nbsp;override the copyWithZone etc).&lt;br /&gt;&lt;br /&gt;&lt;ul style=&quot;line-height: 1.4; list-style-image: initial; list-style-position: initial; margin: 0.5em 0px; padding: 0px 2.5em;&quot;&gt;
&lt;li style=&quot;border: none; margin: 0px 0px 0.25em; padding: 0px;&quot;&gt;&amp;nbsp;&amp;nbsp;nonatomic option will make your setter method run a tiny bit faster.&amp;nbsp;&lt;/li&gt;
&lt;/ul&gt;
&lt;br /&gt;&lt;span style=&quot;background-color: yellow;&quot;&gt;TIP_1:&amp;nbsp;&lt;/span&gt;&lt;br /&gt;&lt;b&gt;For iOS 5.0-Lion use __weak. For iOS4.0-Snow Leopard use __unsafe_unretained.&amp;nbsp;&lt;a href=&quot;http://stackoverflow.com/questions/8592289/arc-the-meaning-of-unsafe-unretained&quot; style=&quot;color: #993322; text-decoration: none;&quot;&gt;Why?&lt;/a&gt;&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;&lt;div style=&quot;background-color: white; border-width: 0px; clear: both; font-family: Arial, &#39;Liberation Sans&#39;, &#39;DejaVu Sans&#39;, sans-serif; line-height: 18px; margin-bottom: 1em; padding: 0px; vertical-align: baseline; word-wrap: break-word;&quot;&gt;
&amp;nbsp;&lt;span style=&quot;font-size: xx-small;&quot;&gt;As its name implies,&amp;nbsp;&lt;code style=&quot;background-color: #eeeeee; border-width: 0px; font-family: Consolas, Menlo, Monaco, &#39;Lucida Console&#39;, &#39;Liberation Mono&#39;, &#39;DejaVu Sans Mono&#39;, &#39;Bitstream Vera Sans Mono&#39;, &#39;Courier New&#39;, monospace, serif; margin: 0px; padding: 1px 5px; vertical-align: baseline;&quot;&gt;__unsafe_unretained&lt;/code&gt;&amp;nbsp;will continue pointing to the memory where an object was, even after it was deallocated. This can lead to crashes due to accessing that deallocated object.&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;background-color: white; border-width: 0px; clear: both; font-family: Arial, &#39;Liberation Sans&#39;, &#39;DejaVu Sans&#39;, sans-serif; line-height: 18px; margin-bottom: 1em; padding: 0px; vertical-align: baseline; word-wrap: break-word;&quot;&gt;
&lt;span style=&quot;font-size: xx-small;&quot;&gt;Why would you ever use&amp;nbsp;&lt;code style=&quot;background-color: #eeeeee; border-width: 0px; font-family: Consolas, Menlo, Monaco, &#39;Lucida Console&#39;, &#39;Liberation Mono&#39;, &#39;DejaVu Sans Mono&#39;, &#39;Bitstream Vera Sans Mono&#39;, &#39;Courier New&#39;, monospace, serif; margin: 0px; padding: 1px 5px; vertical-align: baseline;&quot;&gt;__unsafe_unretained&lt;/code&gt;&amp;nbsp;then? Unfortunately,&amp;nbsp;&lt;code style=&quot;background-color: #eeeeee; border-width: 0px; font-family: Consolas, Menlo, Monaco, &#39;Lucida Console&#39;, &#39;Liberation Mono&#39;, &#39;DejaVu Sans Mono&#39;, &#39;Bitstream Vera Sans Mono&#39;, &#39;Courier New&#39;, monospace, serif; margin: 0px; padding: 1px 5px; vertical-align: baseline;&quot;&gt;__weak&lt;/code&gt;&amp;nbsp;is only supported for iOS 5.0 and Lion as deployment targets. If you want to target back to iOS 4.0 and Snow Leopard, you have to use the&amp;nbsp;&lt;code style=&quot;background-color: #eeeeee; border-width: 0px; font-family: Consolas, Menlo, Monaco, &#39;Lucida Console&#39;, &#39;Liberation Mono&#39;, &#39;DejaVu Sans Mono&#39;, &#39;Bitstream Vera Sans Mono&#39;, &#39;Courier New&#39;, monospace, serif; margin: 0px; padding: 1px 5px; vertical-align: baseline;&quot;&gt;__unsafe_unretained&lt;/code&gt;&amp;nbsp;qualifier.&lt;/span&gt;&lt;/div&gt;
&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;background-color: yellow;&quot;&gt;TIP_2:&lt;/span&gt;&lt;br /&gt;Do you know that when compiling for iOS or a&amp;nbsp;&lt;span style=&quot;color: red;&quot;&gt;64&lt;/span&gt;-bit Mac OS X (not for 32-bit Mac OSX) program, you don&#39;t need to declare the instance variables?&lt;br /&gt;The @property/@&amp;nbsp;synthesize&amp;nbsp;calls are&amp;nbsp;sufficient&amp;nbsp;to make the space for the data.&lt;br /&gt;(&lt;b&gt;&lt;i&gt;from The big nerd ranch Guide&lt;/i&gt;&lt;/b&gt;)&lt;br /&gt;&lt;/div&gt;
&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://prasadiphonecode.blogspot.com/feeds/7169485119007948940/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://prasadiphonecode.blogspot.com/2012/09/a-summary-of-property-properties.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7998216469238959870/posts/default/7169485119007948940'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7998216469238959870/posts/default/7169485119007948940'/><link rel='alternate' type='text/html' href='http://prasadiphonecode.blogspot.com/2012/09/a-summary-of-property-properties.html' title='A summary of property-properties attributes - and some tips'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/01643993695594133107</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7998216469238959870.post-6344081719802913450</id><published>2012-09-28T02:08:00.000-07:00</published><updated>2012-09-28T02:08:06.547-07:00</updated><title type='text'>Retain Cycle</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;br /&gt;
&lt;h3 class=&quot;post-title entry-title&quot; itemprop=&quot;name&quot; style=&quot;background-color: #c0a154; color: #333333; font-family: Georgia, Utopia, &#39;Palatino Linotype&#39;, Palatino, serif; font-size: 30px; font-weight: normal; margin: 0px; position: relative;&quot;&gt;
Retain Cycle&lt;/h3&gt;
&lt;div class=&quot;post-header&quot; style=&quot;background-color: #c0a154; color: #997755; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; line-height: 1.6; margin: 0px 0px 1em;&quot;&gt;
&lt;div class=&quot;post-header-line-1&quot;&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div class=&quot;post-body entry-content&quot; id=&quot;post-body-8589477523475727544&quot; itemprop=&quot;description articleBody&quot; style=&quot;background-color: #c0a154; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 14px; line-height: 1.5; position: relative; width: 768px;&quot;&gt;
&lt;br /&gt;&lt;b&gt;Retain cycles&lt;/b&gt;&amp;nbsp;are a very common source of memory leaks.&lt;br /&gt;&lt;br /&gt;We have retain cycles when :&lt;br /&gt;The object A has strong ownership on object B (direct or indirect) and the B has, also strong ownership at A.&lt;br /&gt;&lt;br /&gt;That happens for example if the A has an MutableArray of objects B and some from objects B have strong ownership on object A.&lt;br /&gt;&lt;br /&gt;the solution on theses cases is to use strong ownership (retain, alloc, etc) to child objects (B)&amp;nbsp;and the child objects to have weak (__weak) ownership at the father.&lt;br /&gt;&lt;br /&gt;Apple provides the&amp;nbsp;&lt;b&gt;&lt;i&gt;Instrument profiling tool&amp;nbsp;&lt;/i&gt;&lt;/b&gt;to help you with that.&lt;br /&gt;When you profile a program, you monitor it while it runs to see what’s happening behind the scenes.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;ul style=&quot;line-height: 1.4; list-style-image: initial; list-style-position: initial; margin: 0.5em 0px; padding: 0px 2.5em;&quot;&gt;
&lt;li style=&quot;border: none; margin: 0px 0px 0.25em; padding: 0px;&quot;&gt;Xcode -&amp;gt;&amp;nbsp;&lt;/li&gt;
&lt;li style=&quot;border: none; margin: 0px 0px 0.25em; padding: 0px;&quot;&gt;Product -&amp;gt;&amp;nbsp;&lt;/li&gt;
&lt;li style=&quot;border: none; margin: 0px 0px 0.25em; padding: 0px;&quot;&gt;Profile … (Instruments launch) choose Leaks&amp;nbsp;&lt;/li&gt;
&lt;li style=&quot;border: none; margin: 0px 0px 0.25em; padding: 0px;&quot;&gt;-&amp;gt; Choose Cycles to see if your project has some of them.&amp;nbsp;&lt;/li&gt;
&lt;/ul&gt;
&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEibMafIHJ-Ybgl02EaX7NCtEfWsnvOxN_dY9SZ6Z46GsSx2vz5jTR60FE2YjHshFUf21bh0tOdUKco4qM6Mqxv2vB5xX8ir6wVSs86kQ1ZkRr3EmC8zkssXIpI17fMXyOh7vWKVUzX25vrk/s1600/Screen+Shot+2012-03-18+at+7.35.55+PM.png&quot; imageanchor=&quot;1&quot; style=&quot;color: #993322; margin-left: 1em; margin-right: 1em; text-decoration: none;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;293&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEibMafIHJ-Ybgl02EaX7NCtEfWsnvOxN_dY9SZ6Z46GsSx2vz5jTR60FE2YjHshFUf21bh0tOdUKco4qM6Mqxv2vB5xX8ir6wVSs86kQ1ZkRr3EmC8zkssXIpI17fMXyOh7vWKVUzX25vrk/s320/Screen+Shot+2012-03-18+at+7.35.55+PM.png&quot; style=&quot;-webkit-box-shadow: rgba(0, 0, 0, 0.498039) 1px 1px 5px; background-color: white; background-position: initial initial; background-repeat: initial initial; border: none; box-shadow: rgba(0, 0, 0, 0.498039) 1px 1px 5px; padding: 8px; position: relative;&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both;&quot;&gt;
#:from Objective - C programming: The big Nerd Ranch Guide&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://prasadiphonecode.blogspot.com/feeds/6344081719802913450/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://prasadiphonecode.blogspot.com/2012/09/retain-cycle.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7998216469238959870/posts/default/6344081719802913450'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7998216469238959870/posts/default/6344081719802913450'/><link rel='alternate' type='text/html' href='http://prasadiphonecode.blogspot.com/2012/09/retain-cycle.html' title='Retain Cycle'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/01643993695594133107</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEibMafIHJ-Ybgl02EaX7NCtEfWsnvOxN_dY9SZ6Z46GsSx2vz5jTR60FE2YjHshFUf21bh0tOdUKco4qM6Mqxv2vB5xX8ir6wVSs86kQ1ZkRr3EmC8zkssXIpI17fMXyOh7vWKVUzX25vrk/s72-c/Screen+Shot+2012-03-18+at+7.35.55+PM.png" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7998216469238959870.post-703303501329425615</id><published>2012-09-28T02:07:00.000-07:00</published><updated>2012-09-28T02:07:01.152-07:00</updated><title type='text'>Callbacks - short notes</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;







&lt;br /&gt;
&lt;div class=&quot;p1&quot;&gt;







&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
For Objective-C programmers, there are three-forms that a callback can take.&lt;/div&gt;
&lt;div class=&quot;p2&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;ul class=&quot;ul1&quot;&gt;
&lt;li class=&quot;li3&quot;&gt;-&lt;span class=&quot;s1&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;b&gt;TARGET-ACTION&lt;/b&gt;: before the wait begins you say “When x happens, send this particular message to that particular object,” The object receiving the message is the &lt;b&gt;target&lt;/b&gt;. The &lt;b&gt;selector&lt;/b&gt; for the message is the &lt;b&gt;action&lt;/b&gt;.&lt;/li&gt;
&lt;li class=&quot;li3&quot;&gt;-&lt;span class=&quot;s1&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;b&gt;Helper objects&lt;/b&gt;: Before the wait begins, you say “Here is a helper object that conforms to your &lt;b&gt;protocol&lt;/b&gt;. Send it messages when things happen”. Helper objects are often known as &lt;b&gt;delegates&lt;/b&gt; or &lt;b&gt;data sources.&lt;/b&gt;&lt;/li&gt;
&lt;li class=&quot;li3&quot;&gt;-&lt;span class=&quot;s1&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;b&gt;Notifications: &lt;/b&gt;There is an object called the &lt;b&gt;notification center&lt;/b&gt;. Before the wait begins, you say to the notification center “This object is waiting for these sorts of notifications. When one of those notifications arrives, send the object this message”. When x happens, an object posts a notification to the notification center, and the center forwards it on to your object.&lt;/li&gt;
&lt;/ul&gt;
&lt;div class=&quot;p2&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;table cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; class=&quot;t1&quot;&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td class=&quot;td1&quot; colspan=&quot;3&quot; valign=&quot;top&quot;&gt;
&lt;div class=&quot;p4&quot;&gt;
&lt;b&gt;Types of Callbacks&lt;/b&gt;&lt;/div&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;td2&quot; valign=&quot;top&quot;&gt;
&lt;div class=&quot;p5&quot;&gt;
&lt;b&gt;Target-Action&lt;/b&gt;&lt;/div&gt;
&lt;/td&gt;
&lt;td class=&quot;td3&quot; valign=&quot;top&quot;&gt;
&lt;div class=&quot;p5&quot;&gt;
sending ONE &amp;nbsp;&amp;nbsp;&amp;nbsp;callback &amp;nbsp;&amp;nbsp;to ONE object&lt;/div&gt;
&lt;/td&gt;
&lt;td class=&quot;td4&quot; valign=&quot;top&quot;&gt;
&lt;div class=&quot;p5&quot;&gt;
timers,simple user interface controls(buttons, sliders etc)&lt;/div&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;td2&quot; valign=&quot;top&quot;&gt;
&lt;div class=&quot;p5&quot;&gt;
&lt;b&gt;Helper objects&lt;/b&gt;&lt;/div&gt;
&lt;div class=&quot;p5&quot;&gt;
(delegate or data source)&lt;/div&gt;
&lt;/td&gt;
&lt;td class=&quot;td3&quot; valign=&quot;top&quot;&gt;
&lt;div class=&quot;p5&quot;&gt;
sending MANY callbacks to ONE object&lt;/div&gt;
&lt;/td&gt;
&lt;td class=&quot;td4&quot; valign=&quot;top&quot;&gt;
&lt;div class=&quot;p5&quot;&gt;
NSURLConnection.&lt;/div&gt;
&lt;div class=&quot;p5&quot;&gt;
The most common type of helper object is the delegate&lt;/div&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;td2&quot; valign=&quot;top&quot;&gt;
&lt;div class=&quot;p5&quot;&gt;
&lt;b&gt;Notifications&lt;/b&gt;&lt;/div&gt;
&lt;/td&gt;
&lt;td class=&quot;td3&quot; valign=&quot;top&quot;&gt;
&lt;div class=&quot;p5&quot;&gt;
sending MANY callbacks to Multiple object&lt;/div&gt;
&lt;/td&gt;
&lt;td class=&quot;td4&quot; valign=&quot;top&quot;&gt;
&lt;div class=&quot;p5&quot;&gt;
Notification center&lt;/div&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;div class=&quot;p2&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;p2&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;b&gt;Notes:&lt;/b&gt;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
-&lt;span class=&quot;s1&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;Notification centers do not own their observers &lt;i&gt;(they typically remove itself from notification in its dealloc method)&lt;/i&gt;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
-&lt;span class=&quot;s1&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;Objects do not own their delegates or data sources &lt;i&gt;(if you create an object that is delegate or data source, your object need to “clear” himself in its dealloc method). &lt;/i&gt;&lt;b&gt;&lt;i&gt;Exception&lt;/i&gt;&lt;/b&gt;&lt;i&gt;: NSURLConnection owns its delegate&lt;/i&gt;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
-&lt;span class=&quot;s1&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;Objects do not own their targets. &lt;i&gt;(if you create an object that is a target, your object should zero the target pointer in its dealloc method).&lt;/i&gt;&lt;b&gt;&lt;i&gt;Exception&lt;/i&gt;&lt;/b&gt;&lt;i&gt;: NSTimer owns it’s target.&lt;/i&gt;&lt;/div&gt;
&lt;div class=&quot;p2&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;p2&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;p2&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
#:From The Big Nerd Ranch Guide Objective C programming&lt;/div&gt;
&lt;br /&gt;
&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://prasadiphonecode.blogspot.com/feeds/703303501329425615/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://prasadiphonecode.blogspot.com/2012/09/callbacks-short-notes.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7998216469238959870/posts/default/703303501329425615'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7998216469238959870/posts/default/703303501329425615'/><link rel='alternate' type='text/html' href='http://prasadiphonecode.blogspot.com/2012/09/callbacks-short-notes.html' title='Callbacks - short notes'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/01643993695594133107</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7998216469238959870.post-3103881087921788650</id><published>2012-09-28T02:05:00.000-07:00</published><updated>2012-09-28T02:05:04.149-07:00</updated><title type='text'>isa - super - self</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;br /&gt;
&lt;h3 class=&quot;post-title entry-title&quot; itemprop=&quot;name&quot; style=&quot;background-color: #c0a154; color: #333333; font-family: Georgia, Utopia, &#39;Palatino Linotype&#39;, Palatino, serif; font-size: 30px; font-weight: normal; margin: 0px; position: relative;&quot;&gt;
isa - super - self&lt;/h3&gt;
&lt;div class=&quot;post-header&quot; style=&quot;background-color: #c0a154; color: #997755; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; line-height: 1.6; margin: 0px 0px 1em;&quot;&gt;
&lt;div class=&quot;post-header-line-1&quot;&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div class=&quot;post-body entry-content&quot; id=&quot;post-body-7209697717516761309&quot; itemprop=&quot;description articleBody&quot; style=&quot;background-color: #c0a154; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 14px; line-height: 1.5; position: relative; width: 768px;&quot;&gt;
short notes:&lt;br /&gt;&lt;br /&gt;&lt;b&gt;isa&lt;/b&gt;&lt;br /&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;/div&gt;
&lt;ul style=&quot;line-height: 1.4; list-style-image: initial; list-style-position: initial; margin: 0.5em 0px; padding: 0px 2.5em;&quot;&gt;
&lt;li style=&quot;border: none; margin: 0px 0px 0.25em; padding: 0px;&quot;&gt;NSObject has many methods, but only one &amp;nbsp;instance variable: the isa pointer.&amp;nbsp;&lt;/li&gt;
&lt;li style=&quot;border: none; margin: 0px 0px 0.25em; padding: 0px;&quot;&gt;Every object&#39;s isa pointer points back to the class that created it.&amp;nbsp;&lt;/li&gt;
&lt;li style=&quot;border: none; margin: 0px 0px 0.25em; padding: 0px;&quot;&gt;We call it the isa pointer because an object &quot;is a &quot; instance of that class. &amp;nbsp;At runtime when a message is sent to an object, that object goes to the class named in its isa pointer and says, &quot;I was sent this message. Run the code for the matching method&quot;. This is different than most compiled languages, where the method to be executed is determined at compile time.&amp;nbsp;&lt;/li&gt;
&lt;li style=&quot;border: none; margin: 0px 0px 0.25em; padding: 0px;&quot;&gt;The isa pointer, as the name suggests, points to the object&#39;s class which maintains a dispatch table. This&amp;nbsp;dispatch&amp;nbsp;table essentially contains pointers to the methods the class implements, among other data.&amp;nbsp;&lt;/li&gt;
&lt;li style=&quot;border: none; margin: 0px 0px 0.25em; padding: 0px;&quot;&gt;The value of the isa pointer does not necessarily reflect the actual class of the instance. When an observer is registered for an attribute of an object the isa pointer of the observed object is modified, pointing to an intermediate class rather than at the true class.&amp;nbsp;&lt;/li&gt;
&lt;li style=&quot;border: none; margin: 0px 0px 0.25em; padding: 0px;&quot;&gt;You should never rely on the isa pointer to determine class membership. Instead, you should use the class method to determine the class of an object instance.&amp;nbsp;&lt;/li&gt;
&lt;/ul&gt;
&lt;br /&gt;A little confused from the above i will get back on this ..!?!?!?&lt;br /&gt;&lt;br /&gt;&lt;b&gt;super&lt;/b&gt;:&lt;br /&gt;&lt;br /&gt;&lt;ul style=&quot;line-height: 1.4; list-style-image: initial; list-style-position: initial; margin: 0.5em 0px; padding: 0px 2.5em;&quot;&gt;
&lt;li style=&quot;border: none; margin: 0px 0px 0.25em; padding: 0px;&quot;&gt;To be&amp;nbsp;precise, the super directive says &quot;Run this method, but start the search for its implementation at my superclass&quot;.&lt;/li&gt;
&lt;li style=&quot;border: none; margin: 0px 0px 0.25em; padding: 0px;&quot;&gt;Each version of init follows this procedure, so classed initialize theri instance variables in the order of inheritance&lt;/li&gt;
&lt;/ul&gt;
&lt;br /&gt;&lt;i&gt;- (id) init&lt;/i&gt;&lt;br /&gt;&lt;i&gt;{&lt;/i&gt;&lt;br /&gt;&lt;i&gt;&amp;nbsp; self = [super init];&lt;/i&gt;&lt;br /&gt;&lt;i&gt;&amp;nbsp; if (self) {&lt;/i&gt;&lt;br /&gt;&lt;i&gt;&amp;nbsp; ...&lt;/i&gt;&lt;br /&gt;&lt;i&gt;&amp;nbsp; }&lt;/i&gt;&lt;br /&gt;&lt;i&gt;}&lt;/i&gt;&lt;br /&gt;&lt;br /&gt;&lt;ul style=&quot;line-height: 1.4; list-style-image: initial; list-style-position: initial; margin: 0.5em 0px; padding: 0px 2.5em;&quot;&gt;
&lt;li style=&quot;border: none; margin: 0px 0px 0.25em; padding: 0px;&quot;&gt;super is simply a flag to the compiler telling it where to begin searching for the method to&amp;nbsp;perform; it&#39;s used only as the receiver of a message. But self is a variable name that can&amp;nbsp;&amp;nbsp;be used in any number of ways, even assigned a new value (see Redefining self)&lt;/li&gt;
&lt;li style=&quot;border: none; margin: 0px 0px 0.25em; padding: 0px;&quot;&gt;super is a flag that tells the compiler to search for the method implementation, begins in the superclass of the class that defines the method where super appears.&amp;nbsp;&lt;/li&gt;
&lt;li style=&quot;border: none; margin: 0px 0px 0.25em; padding: 0px;&quot;&gt;wherever super receives a message, the compiler substitutes another messaging routine for the objc_msgSend function.&amp;nbsp;&lt;/li&gt;
&lt;/ul&gt;
&lt;br /&gt;&lt;i&gt;&lt;br /&gt;&lt;/i&gt;&lt;br /&gt;&lt;b&gt;self:&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;&lt;ul style=&quot;line-height: 1.4; list-style-image: initial; list-style-position: initial; margin: 0.5em 0px; padding: 0px 2.5em;&quot;&gt;
&lt;li style=&quot;border: none; margin: 0px 0px 0.25em; padding: 0px;&quot;&gt;is one of the hidden parameters that the messaging routine passes to every method; it&#39;s a local variable that can be used freely within a method implementation, just as the names of instance variables&lt;/li&gt;
&lt;li style=&quot;border: none; margin: 0px 0px 0.25em; padding: 0px;&quot;&gt;self searches for the method implementation in the usual manner, starting in the dispatch table of the receiving object&#39;s class.&amp;nbsp;&lt;/li&gt;
&lt;/ul&gt;
&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;from Big Ned Ranch Guide Object C &amp;amp; ios Programming + Documentation&lt;/div&gt;
&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://prasadiphonecode.blogspot.com/feeds/3103881087921788650/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://prasadiphonecode.blogspot.com/2012/09/isa-super-self.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7998216469238959870/posts/default/3103881087921788650'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7998216469238959870/posts/default/3103881087921788650'/><link rel='alternate' type='text/html' href='http://prasadiphonecode.blogspot.com/2012/09/isa-super-self.html' title='isa - super - self'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/01643993695594133107</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7998216469238959870.post-1000839236808230025</id><published>2012-09-28T02:04:00.000-07:00</published><updated>2012-09-28T02:04:04.176-07:00</updated><title type='text'>How we import (constant) global variables and #define VS global variables</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;br /&gt;
&lt;h3 class=&quot;post-title entry-title&quot; itemprop=&quot;name&quot; style=&quot;background-color: #c0a154; color: #333333; font-family: Georgia, Utopia, &#39;Palatino Linotype&#39;, Palatino, serif; font-size: 30px; font-weight: normal; margin: 0px; position: relative;&quot;&gt;
How we import (constant) global variables and #define VS global variables&lt;/h3&gt;
&lt;div class=&quot;post-header&quot; style=&quot;background-color: #c0a154; color: #997755; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; line-height: 1.6; margin: 0px 0px 1em;&quot;&gt;
&lt;div class=&quot;post-header-line-1&quot;&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div class=&quot;post-body entry-content&quot; id=&quot;post-body-1704572734860851368&quot; itemprop=&quot;description articleBody&quot; style=&quot;background-color: #c0a154; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 14px; line-height: 1.5; position: relative; width: 768px;&quot;&gt;
&lt;br /&gt;&lt;span style=&quot;background-color: #e3e3e3; font-family: Verdana, Tahoma, Calibri, Geneva; font-size: 13px;&quot;&gt;One of them informs the preprocessor to do a textual substitution. The other actually declares a (constant) C variable.&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;background-color: #e3e3e3; font-family: Verdana, Tahoma, Calibri, Geneva; font-size: 13px;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-family: Verdana, Tahoma, Calibri, Geneva; font-size: xx-small;&quot;&gt;#define VS global variables - enum&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-family: Verdana, Tahoma, Calibri, Geneva; font-size: xx-small;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-family: Verdana, Tahoma, Calibri, Geneva; font-size: xx-small;&quot;&gt;define&amp;nbsp;informs&amp;nbsp;the preprocessor to do a textual substitution (a macro)&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-family: Verdana, Tahoma, Calibri, Geneva; font-size: xx-small;&quot;&gt;global variables - enum - declares a (constant) variable.&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-family: Verdana, Tahoma, Calibri, Geneva; font-size: xx-small;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-family: Verdana, Tahoma, Calibri, Geneva; font-size: xx-small;&quot;&gt;so its like macro VS const variable.&amp;nbsp;&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-family: Verdana, Tahoma, Calibri, Geneva; font-size: xx-small;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-family: Verdana, Tahoma, Calibri, Geneva; font-size: xx-small;&quot;&gt;The global variables - enum&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;ul style=&quot;line-height: 1.4; list-style-image: initial; list-style-position: initial; margin: 0.5em 0px; padding: 0px 2.5em;&quot;&gt;
&lt;li style=&quot;border: none; margin: 0px 0px 0.25em; padding: 0px;&quot;&gt;&lt;span style=&quot;font-family: Verdana, Tahoma, Calibri, Geneva; font-size: xx-small;&quot;&gt;&lt;span style=&quot;background-color: #e3e3e3; font-size: 13px;&quot;&gt;they obey the language&#39;s scoping rules&amp;nbsp;&lt;/span&gt;&lt;br style=&quot;background-color: #e3e3e3; font-size: 13px;&quot; /&gt;&lt;span style=&quot;background-color: #e3e3e3; font-size: 13px;&quot;&gt;you can see them in the debugger&amp;nbsp;&lt;/span&gt;&lt;br style=&quot;background-color: #e3e3e3; font-size: 13px;&quot; /&gt;&lt;span style=&quot;background-color: #e3e3e3; font-size: 13px;&quot;&gt;you can take their address if you need to&amp;nbsp;&lt;/span&gt;&lt;br style=&quot;background-color: #e3e3e3; font-size: 13px;&quot; /&gt;&lt;span style=&quot;background-color: #e3e3e3; font-size: 13px;&quot;&gt;you can pass them by const-reference if you need to&amp;nbsp;&lt;/span&gt;&lt;br style=&quot;background-color: #e3e3e3; font-size: 13px;&quot; /&gt;&lt;span style=&quot;background-color: #e3e3e3; font-size: 13px;&quot;&gt;they don&#39;t create new &quot;keywords&quot; in your program.&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;br /&gt;&lt;span style=&quot;font-family: Verdana, Tahoma, Calibri, Geneva; font-size: xx-small;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-family: Verdana, Tahoma, Calibri, Geneva; font-size: xx-small;&quot;&gt;&lt;b&gt;you should use&amp;nbsp;global&amp;nbsp;variables and enum for constants, not #define.&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-family: Verdana, Tahoma, Calibri, Geneva; font-size: xx-small;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-family: Verdana, Tahoma, Calibri, Geneva; font-size: xx-small;&quot;&gt;How we import global variables?&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;font-family: Verdana, Tahoma, Calibri, Geneva; font-size: xx-small;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;ul style=&quot;background-color: white; font-family: Helvetica, sans-serif; font-size: 13px; line-height: 16px; list-style-image: initial; list-style-position: initial; margin: 0.5em 0px; padding: 0px 2.5em;&quot;&gt;
&lt;li style=&quot;border: none; margin: 0px 0px 0.25em; padding: 0px;&quot;&gt;1) Add 2 new files to your project: &quot;&lt;a href=&quot;http://www.cocoadev.com/index.pl?GlobalValues&quot; style=&quot;background: inherit; color: #333366; text-decoration: none;&quot;&gt;GlobalValues&lt;/a&gt;.h&quot; and &quot;GlobalValues.m&quot;.&lt;/li&gt;
&lt;li style=&quot;border: none; margin: 0px 0px 0.25em; padding: 0px;&quot;&gt;2) Open &quot;&lt;a href=&quot;http://www.cocoadev.com/index.pl?GlobalValues&quot; style=&quot;background: inherit; color: #333366; text-decoration: none;&quot;&gt;GlobalValues&lt;/a&gt;.h&quot;, and declare all your needed variables.&lt;/li&gt;
&lt;/ul&gt;
&lt;div style=&quot;background-color: white; font-family: Helvetica, sans-serif; font-size: 13px; line-height: 16px;&quot;&gt;
&lt;/div&gt;
&lt;blockquote style=&quot;background-color: white; font-family: Helvetica, sans-serif; font-size: 13px; line-height: 16px;&quot;&gt;
&lt;code style=&quot;font-family: Monaco, Arial, sans-serif; font-size: 12px;&quot;&gt;&lt;pre style=&quot;border: 1px dotted rgb(204, 204, 204); overflow: auto; padding: 4px; width: 640px;&quot;&gt;//name of the &#39;service&#39; used for storing items in the user&#39;s keychain:
extern &lt;a href=&quot;http://www.cocoadev.com/index.pl?NSString&quot; style=&quot;background: inherit; color: #333366; text-decoration: none;&quot;&gt;NSString&lt;/a&gt; const *MYKeychainServiceName;

//name of the PasteBoard data type that application uses for document data:
extern &lt;a href=&quot;http://www.cocoadev.com/index.pl?NSString&quot; style=&quot;background: inherit; color: #333366; text-decoration: none;&quot;&gt;NSString&lt;/a&gt;&amp;nbsp;&lt;span style=&quot;font-family: Monaco, Arial, sans-serif;&quot;&gt;const &lt;/span&gt;&lt;span style=&quot;font-family: Monaco, Arial, sans-serif;&quot;&gt;*MYPboardDataType;&lt;/span&gt;&lt;/pre&gt;
&lt;/code&gt;&lt;/blockquote&gt;
&lt;div style=&quot;background-color: white; font-family: Helvetica, sans-serif; font-size: 13px; line-height: 16px;&quot;&gt;
&lt;/div&gt;
&lt;ul style=&quot;background-color: white; font-family: Helvetica, sans-serif; font-size: 13px; line-height: 16px; list-style-image: initial; list-style-position: initial; margin: 0.5em 0px; padding: 0px 2.5em;&quot;&gt;
&lt;li style=&quot;border: none; margin: 0px 0px 0.25em; padding: 0px;&quot;&gt;3) Open &quot;&lt;a href=&quot;http://www.cocoadev.com/index.pl?GlobalValues&quot; style=&quot;background: inherit; color: #333366; text-decoration: none;&quot;&gt;GlobalValues&lt;/a&gt;.m&quot;, and start the new file by importing &quot;&lt;a href=&quot;http://www.cocoadev.com/index.pl?GlobalValues&quot; style=&quot;background: inherit; color: #333366; text-decoration: none;&quot;&gt;GlobalValues&lt;/a&gt;.h&quot;.&lt;/li&gt;
&lt;li style=&quot;border: none; margin: 0px 0px 0.25em; padding: 0px;&quot;&gt;4) Then, assign values to the variables you declared in the header file:&lt;/li&gt;
&lt;/ul&gt;
&lt;div style=&quot;background-color: white; font-family: Helvetica, sans-serif; font-size: 13px; line-height: 16px;&quot;&gt;
&lt;/div&gt;
&lt;blockquote style=&quot;background-color: white; font-family: Helvetica, sans-serif; font-size: 13px; line-height: 16px;&quot;&gt;
&lt;code style=&quot;font-family: Monaco, Arial, sans-serif; font-size: 12px;&quot;&gt;&lt;pre style=&quot;border: 1px dotted rgb(204, 204, 204); overflow: auto; padding: 4px; width: 640px;&quot;&gt;#import &quot;&lt;a href=&quot;http://www.cocoadev.com/index.pl?GlobalValues&quot; style=&quot;background: inherit; color: #333366; text-decoration: none;&quot;&gt;GlobalValues&lt;/a&gt;.h&quot;

//name of the &#39;service&#39; the application uses for storing items in the user&#39;s keychain:
&lt;a href=&quot;http://www.cocoadev.com/index.pl?NSString&quot; style=&quot;background: inherit; color: #333366; text-decoration: none;&quot;&gt;NSString&lt;/a&gt;&amp;nbsp;&lt;span style=&quot;font-family: Monaco, Arial, sans-serif;&quot;&gt;const &lt;/span&gt;&lt;span style=&quot;font-family: Monaco, Arial, sans-serif;&quot;&gt;*MYKeychainServiceName = @&quot;&lt;/span&gt;&lt;a href=&quot;http://www.cocoadev.com/index.pl?MyApplication&quot; style=&quot;background: inherit; color: #333366; font-family: Monaco, Arial, sans-serif; text-decoration: none;&quot;&gt;MyApplication&lt;/a&gt;&lt;span style=&quot;font-family: Monaco, Arial, sans-serif;&quot;&gt; Password&quot;;&lt;/span&gt;&lt;/pre&gt;
&lt;pre style=&quot;border: 1px dotted rgb(204, 204, 204); overflow: auto; padding: 4px; width: 640px;&quot;&gt;//name of the PasteBoard data type that application uses for document data:
&lt;a href=&quot;http://www.cocoadev.com/index.pl?NSString&quot; style=&quot;background: inherit; color: #333366; text-decoration: none;&quot;&gt;NSString&lt;/a&gt;&amp;nbsp;&lt;span style=&quot;font-family: Monaco, Arial, sans-serif;&quot;&gt;const &lt;/span&gt;&lt;span style=&quot;font-family: Monaco, Arial, sans-serif;&quot;&gt;*MYPboardDataType = @&quot;&lt;/span&gt;&lt;a href=&quot;http://www.cocoadev.com/index.pl?MyApplication&quot; style=&quot;background: inherit; color: #333366; font-family: Monaco, Arial, sans-serif; text-decoration: none;&quot;&gt;MyApplication&lt;/a&gt;&lt;span style=&quot;font-family: Monaco, Arial, sans-serif;&quot;&gt; DocData&quot;;&lt;/span&gt;&lt;/pre&gt;
&lt;/code&gt;&lt;/blockquote&gt;
&lt;div style=&quot;background-color: white; font-family: Helvetica, sans-serif; font-size: 13px; line-height: 16px;&quot;&gt;
In the implementation files of the classes that need to use these variables, you would put - at the very beginning:&lt;/div&gt;
&lt;div style=&quot;background-color: white; font-family: Helvetica, sans-serif; font-size: 13px; line-height: 16px;&quot;&gt;
&lt;/div&gt;
&lt;blockquote style=&quot;background-color: white; font-family: Helvetica, sans-serif; font-size: 13px; line-height: 16px;&quot;&gt;
&lt;code style=&quot;font-family: Monaco, Arial, sans-serif; font-size: 12px;&quot;&gt;&lt;pre style=&quot;border: 1px dotted rgb(204, 204, 204); overflow: auto; padding: 4px; width: 640px;&quot;&gt;#import &quot;&lt;a href=&quot;http://www.cocoadev.com/index.pl?GlobalValues&quot; style=&quot;background: inherit; color: #333366; text-decoration: none;&quot;&gt;GlobalValues&lt;/a&gt;.h&quot;&lt;/pre&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;/code&gt;&lt;/blockquote&gt;
&lt;br /&gt;#source:&lt;br /&gt;Big Nerd Ranch Guide - Objective C programming&lt;br /&gt;&lt;a href=&quot;http://www.cocoadev.com/index.pl?GlobalVariablesInCocoa&quot; style=&quot;color: #993322; text-decoration: none;&quot;&gt;http://www.cocoadev.com/index.pl?GlobalVariablesInCocoa&amp;nbsp;&lt;/a&gt;&lt;/div&gt;
&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://prasadiphonecode.blogspot.com/feeds/1000839236808230025/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://prasadiphonecode.blogspot.com/2012/09/how-we-import-constant-global-variables.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7998216469238959870/posts/default/1000839236808230025'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7998216469238959870/posts/default/1000839236808230025'/><link rel='alternate' type='text/html' href='http://prasadiphonecode.blogspot.com/2012/09/how-we-import-constant-global-variables.html' title='How we import (constant) global variables and #define VS global variables'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/01643993695594133107</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7998216469238959870.post-2370133581589783172</id><published>2012-09-28T02:03:00.000-07:00</published><updated>2012-09-28T02:03:04.641-07:00</updated><title type='text'>NSArray remove ObjectIdenticalTo VS removeObject:</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;br /&gt;
&lt;h3 class=&quot;post-title entry-title&quot; itemprop=&quot;name&quot; style=&quot;background-color: #c0a154; color: #333333; font-family: Georgia, Utopia, &#39;Palatino Linotype&#39;, Palatino, serif; font-size: 30px; font-weight: normal; margin: 0px; position: relative;&quot;&gt;
NSArray remove ObjectIdenticalTo VS removeObject:&lt;/h3&gt;
&lt;div class=&quot;post-header&quot; style=&quot;background-color: #c0a154; color: #997755; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; line-height: 1.6; margin: 0px 0px 1em;&quot;&gt;
&lt;div class=&quot;post-header-line-1&quot;&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div class=&quot;post-body entry-content&quot; id=&quot;post-body-3799378693592278548&quot; itemprop=&quot;description articleBody&quot; style=&quot;background-color: #c0a154; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 14px; line-height: 1.5; position: relative; width: 768px;&quot;&gt;
copy (and not paste!) from book BigNerd Ranch iOS programming (2012) page 214&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;ul style=&quot;line-height: 1.4; list-style-image: initial; list-style-position: initial; margin: 0.5em 0px; padding: 0px 2.5em;&quot;&gt;
&lt;li style=&quot;border: none; margin: 0px 0px 0.25em; padding: 0px;&quot;&gt;&lt;b&gt;removeObject&lt;/b&gt;:&amp;nbsp;&lt;u&gt;goes to&amp;nbsp;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #cc0000;&quot;&gt;&lt;b&gt;each&lt;/b&gt;&amp;nbsp;&lt;b&gt;object&lt;/b&gt;&lt;/span&gt;&amp;nbsp;in the array and sends it the message&amp;nbsp;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: red;&quot;&gt;isEqual&lt;/span&gt;&lt;/u&gt;:. A class can implement this method to return YES or NO&amp;nbsp;&lt;b&gt;based on its own determination&lt;/b&gt;.&amp;nbsp;&lt;/li&gt;
&lt;li style=&quot;border: none; margin: 0px 0px 0.25em; padding: 0px;&quot;&gt;&lt;b&gt;removeObjectIdenticalTo&lt;/b&gt;: removes an object if and only if it is exact same object as the one passed in this message.&amp;nbsp;&lt;/li&gt;
&lt;/ul&gt;
&lt;/div&gt;
&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://prasadiphonecode.blogspot.com/feeds/2370133581589783172/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://prasadiphonecode.blogspot.com/2012/09/nsarray-remove-objectidenticalto-vs.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7998216469238959870/posts/default/2370133581589783172'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7998216469238959870/posts/default/2370133581589783172'/><link rel='alternate' type='text/html' href='http://prasadiphonecode.blogspot.com/2012/09/nsarray-remove-objectidenticalto-vs.html' title='NSArray remove ObjectIdenticalTo VS removeObject:'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/01643993695594133107</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7998216469238959870.post-4211630961081685794</id><published>2012-09-28T02:00:00.000-07:00</published><updated>2012-09-28T02:00:02.704-07:00</updated><title type='text'>How to pass arguments in object C - xcode programes</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;br /&gt;
&lt;h3 class=&quot;post-title entry-title&quot; itemprop=&quot;name&quot; style=&quot;font-family: Georgia, Utopia, &#39;Palatino Linotype&#39;, Palatino, serif; font-size: 30px; font-weight: normal; margin: 0px; position: relative;&quot;&gt;
How to pass arguments in object C - xcode programes&lt;/h3&gt;
&lt;div class=&quot;post-header&quot; style=&quot;color: #997755; line-height: 1.6; margin: 0px 0px 1em;&quot;&gt;
&lt;div class=&quot;post-header-line-1&quot;&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div class=&quot;post-body entry-content&quot; id=&quot;post-body-2658463672179851167&quot; itemprop=&quot;description articleBody&quot; style=&quot;font-size: 14px; line-height: 1.5; position: relative; width: 768px;&quot;&gt;
&lt;br style=&quot;background-color: #c0a154; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; line-height: 20px;&quot; /&gt;&lt;div style=&quot;background-color: #c0a154; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; line-height: 20px;&quot;&gt;
in Xcode:&lt;/div&gt;
&lt;ul style=&quot;background-color: #c0a154; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; line-height: 1.4; list-style-image: initial; list-style-position: initial; margin: 0.5em 0px; padding: 0px 2.5em;&quot;&gt;
&lt;li style=&quot;border: none; margin: 0px 0px 0.25em; padding: 0px;&quot;&gt;Choose&amp;nbsp;&lt;span style=&quot;color: red;&quot;&gt;Produce&lt;/span&gt;&amp;nbsp;from menu&lt;/li&gt;
&lt;li style=&quot;border: none; margin: 0px 0px 0.25em; padding: 0px;&quot;&gt;Choose&amp;nbsp;&lt;span style=&quot;color: red;&quot;&gt;Edit&lt;/span&gt;&amp;nbsp;Scheme&lt;/li&gt;
&lt;li style=&quot;border: none; margin: 0px 0px 0.25em; padding: 0px;&quot;&gt;Select&amp;nbsp;&lt;span style=&quot;color: red;&quot;&gt;Run ApplicationName&lt;/span&gt;&amp;nbsp;on the left&lt;/li&gt;
&lt;li style=&quot;border: none; margin: 0px 0px 0.25em; padding: 0px;&quot;&gt;Select&amp;nbsp;&lt;span style=&quot;color: red;&quot;&gt;Arguments tab&lt;/span&gt;&lt;/li&gt;
&lt;li style=&quot;border: none; margin: 0px 0px 0.25em; padding: 0px;&quot;&gt;Add Arguments with&amp;nbsp;&lt;span style=&quot;color: red;&quot;&gt;+&lt;/span&gt;&amp;nbsp;on Arguments Passed on Launch&lt;/li&gt;
&lt;/ul&gt;
&lt;div class=&quot;separator&quot; style=&quot;background-color: #c0a154; clear: both; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; line-height: 20px; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjfz5OQbgF5nltTQinOKswWmNw8uXUWF_T5i7kx4tXZEvq2A2bkoEx-wGHhTDQCnbpqeeCIAEzt_pIrtq1-6G8AatqSKg98tgvfeFJyGo4pmQaKS89yGDWj-Xu-BpzlqD7UO-xx2d8S8YKc/s1600/Screen+Shot+2012-04-11+at+11.28.21+PM.png&quot; imageanchor=&quot;1&quot; style=&quot;color: #993322; margin-left: 1em; margin-right: 1em; text-decoration: none;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;434&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjfz5OQbgF5nltTQinOKswWmNw8uXUWF_T5i7kx4tXZEvq2A2bkoEx-wGHhTDQCnbpqeeCIAEzt_pIrtq1-6G8AatqSKg98tgvfeFJyGo4pmQaKS89yGDWj-Xu-BpzlqD7UO-xx2d8S8YKc/s640/Screen+Shot+2012-04-11+at+11.28.21+PM.png&quot; style=&quot;-webkit-box-shadow: rgba(0, 0, 0, 0.498039) 1px 1px 5px; background-color: white; background-position: initial initial; background-repeat: initial initial; border: none; box-shadow: rgba(0, 0, 0, 0.498039) 1px 1px 5px; padding: 8px; position: relative;&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;background-color: #c0a154; clear: both; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; line-height: 20px; text-align: center;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://prasadiphonecode.blogspot.com/feeds/4211630961081685794/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://prasadiphonecode.blogspot.com/2012/09/how-to-pass-arguments-in-object-c-xcode.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7998216469238959870/posts/default/4211630961081685794'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7998216469238959870/posts/default/4211630961081685794'/><link rel='alternate' type='text/html' href='http://prasadiphonecode.blogspot.com/2012/09/how-to-pass-arguments-in-object-c-xcode.html' title='How to pass arguments in object C - xcode programes'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/01643993695594133107</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjfz5OQbgF5nltTQinOKswWmNw8uXUWF_T5i7kx4tXZEvq2A2bkoEx-wGHhTDQCnbpqeeCIAEzt_pIrtq1-6G8AatqSKg98tgvfeFJyGo4pmQaKS89yGDWj-Xu-BpzlqD7UO-xx2d8S8YKc/s72-c/Screen+Shot+2012-04-11+at+11.28.21+PM.png" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7998216469238959870.post-8359673158177492480</id><published>2012-09-28T01:59:00.000-07:00</published><updated>2012-09-28T01:59:37.421-07:00</updated><title type='text'>JSON format</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;br /&gt;
&lt;h3 class=&quot;post-title entry-title&quot; itemprop=&quot;name&quot; style=&quot;background-color: #c0a154; color: #333333; font-family: Georgia, Utopia, &#39;Palatino Linotype&#39;, Palatino, serif; font-size: 30px; font-weight: normal; margin: 0px; position: relative;&quot;&gt;
JSON format&lt;/h3&gt;
&lt;div class=&quot;post-header&quot; style=&quot;background-color: #c0a154; color: #997755; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; line-height: 1.6; margin: 0px 0px 1em;&quot;&gt;
&lt;div class=&quot;post-header-line-1&quot;&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div class=&quot;post-body entry-content&quot; id=&quot;post-body-6747369958446675572&quot; itemprop=&quot;description articleBody&quot; style=&quot;background-color: #c0a154; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 14px; line-height: 1.5; position: relative; width: 768px;&quot;&gt;
&lt;br /&gt;&lt;a href=&quot;http://www.json.org/&quot; style=&quot;color: #993322; text-decoration: none;&quot;&gt;&lt;b&gt;JSON&lt;/b&gt;&amp;nbsp;(JavaScript Object Notation)&amp;nbsp;&lt;/a&gt;is a lightweight data-interchange format. It is easy for humans to read and write. It is easy for machines to parse and generate. It is based on a subset of the&amp;nbsp;&lt;a href=&quot;http://javascript.crockford.com/&quot; style=&quot;color: maroon; text-decoration: none;&quot;&gt;JavaScript Programming Language&lt;/a&gt;,&amp;nbsp;&lt;a href=&quot;http://www.ecma-international.org/publications/files/ecma-st/ECMA-262.pdf&quot; style=&quot;color: maroon; text-decoration: none;&quot;&gt;Standard ECMA-262 3rd Edition - December 1999&lt;/a&gt;. JSON is a text format that is completely language independent but uses conventions that are familiar to programmers of the C-family of languages, including C, C++, C#, Java, JavaScript, Perl, Python, and many others. These properties make JSON an ideal data-interchange language.&lt;br /&gt;JSON is built on two structures:&lt;br /&gt;&lt;ul style=&quot;line-height: 1.4; list-style-image: initial; list-style-position: initial; margin: 0.5em 0px; padding: 0px 2.5em;&quot;&gt;
&lt;li style=&quot;border: none; margin: 0px 0px 0.25em; padding: 0px;&quot;&gt;A collection of name/value pairs. In various languages, this is realized as an&amp;nbsp;&lt;i&gt;object&lt;/i&gt;, record, struct, dictionary, hash table, keyed list, or associative array.&lt;/li&gt;
&lt;li style=&quot;border: none; margin: 0px 0px 0.25em; padding: 0px;&quot;&gt;An ordered list of values. In most languages, this is realized as an&amp;nbsp;&lt;i&gt;array&lt;/i&gt;, vector, list, or sequence.&lt;/li&gt;
&lt;/ul&gt;
These are universal data structures. Virtually all modern programming languages support them in one form or another. It makes sense that a data format that is interchangeable with programming languages also be based on these structures.&lt;br /&gt;In JSON, they take on these forms:&lt;br /&gt;An&amp;nbsp;&lt;i&gt;object&lt;/i&gt;&amp;nbsp;is an unordered set of name/value pairs. An object begins with&amp;nbsp;&lt;tt&gt;{&lt;/tt&gt;&amp;nbsp;&lt;small&gt;(left brace)&lt;/small&gt;&amp;nbsp;and ends with&amp;nbsp;&lt;tt&gt;}&lt;/tt&gt;&amp;nbsp;&lt;small&gt;(right brace)&lt;/small&gt;. Each name is followed by&amp;nbsp;&lt;tt&gt;:&lt;/tt&gt;&amp;nbsp;&lt;small&gt;(colon)&lt;/small&gt;&amp;nbsp;and the name/value pairs are separated by&amp;nbsp;&lt;tt&gt;,&lt;/tt&gt;&amp;nbsp;&lt;small&gt;(comma)&lt;/small&gt;.&lt;br /&gt;&lt;img height=&quot;113&quot; src=&quot;http://www.json.org/object.gif&quot; style=&quot;-webkit-box-shadow: rgba(0, 0, 0, 0.498039) 1px 1px 5px; background-color: white; background-position: initial initial; background-repeat: initial initial; box-shadow: rgba(0, 0, 0, 0.498039) 1px 1px 5px; padding: 8px;&quot; width=&quot;598&quot; /&gt;&lt;br /&gt;An&amp;nbsp;&lt;i&gt;array&lt;/i&gt;&amp;nbsp;is an ordered collection of values. An array begins with&amp;nbsp;&lt;tt&gt;[&lt;/tt&gt;&amp;nbsp;&lt;small&gt;(left bracket)&lt;/small&gt;&amp;nbsp;and ends with&amp;nbsp;&lt;tt&gt;]&lt;/tt&gt;&amp;nbsp;&lt;small&gt;(right bracket)&lt;/small&gt;. Values are separated by&amp;nbsp;&lt;tt&gt;,&lt;/tt&gt;&amp;nbsp;&lt;small&gt;(comma)&lt;/small&gt;.&lt;br /&gt;&lt;img height=&quot;113&quot; src=&quot;http://www.json.org/array.gif&quot; style=&quot;-webkit-box-shadow: rgba(0, 0, 0, 0.498039) 1px 1px 5px; background-color: white; background-position: initial initial; background-repeat: initial initial; box-shadow: rgba(0, 0, 0, 0.498039) 1px 1px 5px; padding: 8px;&quot; width=&quot;598&quot; /&gt;&lt;br /&gt;A&amp;nbsp;&lt;i&gt;value&lt;/i&gt;&amp;nbsp;can be a&amp;nbsp;&lt;i&gt;string&lt;/i&gt;&amp;nbsp;in double quotes, or a&amp;nbsp;&lt;i&gt;number&lt;/i&gt;, or&amp;nbsp;&lt;tt&gt;true&lt;/tt&gt;&amp;nbsp;or&amp;nbsp;&lt;tt&gt;false&lt;/tt&gt;&amp;nbsp;or&amp;nbsp;&lt;tt&gt;null&lt;/tt&gt;, or an&amp;nbsp;&lt;i&gt;object&lt;/i&gt;&amp;nbsp;or an&amp;nbsp;&lt;i&gt;array&lt;/i&gt;. These structures can be nested.&lt;br /&gt;&lt;img height=&quot;278&quot; src=&quot;http://www.json.org/value.gif&quot; style=&quot;-webkit-box-shadow: rgba(0, 0, 0, 0.498039) 1px 1px 5px; background-color: white; background-position: initial initial; background-repeat: initial initial; box-shadow: rgba(0, 0, 0, 0.498039) 1px 1px 5px; padding: 8px;&quot; width=&quot;598&quot; /&gt;&lt;br /&gt;A&amp;nbsp;&lt;i&gt;string&lt;/i&gt;&amp;nbsp;is a sequence of zero or more Unicode characters, wrapped in double quotes, using backslash escapes. A character is represented as a single character string. A string is very much like a C or Java string.&lt;br /&gt;&lt;img height=&quot;413&quot; src=&quot;http://www.json.org/string.gif&quot; style=&quot;-webkit-box-shadow: rgba(0, 0, 0, 0.498039) 1px 1px 5px; background-color: white; background-position: initial initial; background-repeat: initial initial; box-shadow: rgba(0, 0, 0, 0.498039) 1px 1px 5px; padding: 8px;&quot; width=&quot;598&quot; /&gt;&lt;br /&gt;A&amp;nbsp;&lt;i&gt;number&lt;/i&gt;&amp;nbsp;is very much like a C or Java number, except that the octal and hexadecimal formats are not used.&lt;br /&gt;&lt;img height=&quot;266&quot; src=&quot;http://www.json.org/number.gif&quot; style=&quot;-webkit-box-shadow: rgba(0, 0, 0, 0.498039) 1px 1px 5px; background-color: white; background-position: initial initial; background-repeat: initial initial; box-shadow: rgba(0, 0, 0, 0.498039) 1px 1px 5px; padding: 8px;&quot; width=&quot;598&quot; /&gt;&lt;br /&gt;Whitespace can be inserted between any pair of tokens. Excepting a few encoding details, that completely describes the language.&lt;/div&gt;
&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://prasadiphonecode.blogspot.com/feeds/8359673158177492480/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://prasadiphonecode.blogspot.com/2012/09/json-format.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7998216469238959870/posts/default/8359673158177492480'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7998216469238959870/posts/default/8359673158177492480'/><link rel='alternate' type='text/html' href='http://prasadiphonecode.blogspot.com/2012/09/json-format.html' title='JSON format'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/01643993695594133107</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7998216469238959870.post-3184124119990554535</id><published>2012-09-28T01:57:00.002-07:00</published><updated>2012-09-28T01:57:39.704-07:00</updated><title type='text'>Bitwise operator OR and AND - in objective C - Exclusive OR - Complements - Shifting and Enum  </title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;br /&gt;
&lt;h3 class=&quot;post-title entry-title&quot; itemprop=&quot;name&quot; style=&quot;background-color: #c0a154; color: #333333; font-family: Georgia, Utopia, &#39;Palatino Linotype&#39;, Palatino, serif; font-size: 30px; font-weight: normal; margin: 0px; position: relative;&quot;&gt;
Bitwise operator OR and AND - in objective C - Exclusive OR - Complements - Shifting and Enum&lt;/h3&gt;
&lt;div class=&quot;post-header&quot; style=&quot;background-color: #c0a154; color: #997755; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; line-height: 1.6; margin: 0px 0px 1em;&quot;&gt;
&lt;div class=&quot;post-header-line-1&quot;&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div class=&quot;post-body entry-content&quot; id=&quot;post-body-8566599660496284364&quot; itemprop=&quot;description articleBody&quot; style=&quot;background-color: #c0a154; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 14px; line-height: 1.5; position: relative; width: 768px;&quot;&gt;
&lt;br /&gt;&lt;ul style=&quot;line-height: 1.4; list-style-image: initial; list-style-position: initial; margin: 0.5em 0px; padding: 0px 2.5em;&quot;&gt;
&lt;li style=&quot;border: none; margin: 0px 0px 0.25em; padding: 0px;&quot;&gt;&lt;b&gt;| is the bitwise-OR operator in C.&amp;nbsp;&lt;/b&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;br /&gt;&lt;br /&gt;You will see the bitwise-OR operator a lot in Cocoa and iOS programming.&lt;br /&gt;You can use bitwise-OR together the constants that represent the particular aspects you want.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;NSError *e;&lt;br /&gt;NSDataDetector *d = [NSDataDetector dataDetectorWithTypes:&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;NSTextCheckingTypePhoneNumbe&lt;span style=&quot;background-color: yellow; color: red;&quot;&gt;r | N&lt;/span&gt;STextCheckingTypeDate&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;error:&amp;amp;e];&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;ul style=&quot;line-height: 1.4; list-style-image: initial; list-style-position: initial; margin: 0.5em 0px; padding: 0px 2.5em;&quot;&gt;
&lt;li style=&quot;border: none; margin: 0px 0px 0.25em; padding: 0px;&quot;&gt;&lt;b&gt;In objective-C we use bitwise-AND (&amp;amp;) to see if a certain bit, or flag is on&lt;/b&gt;.&amp;nbsp;&lt;/li&gt;
&lt;/ul&gt;
&lt;br /&gt;if ([currentDetector checkingTypes]&lt;span style=&quot;background-color: yellow; color: red;&quot;&gt;&amp;nbsp;&amp;amp;&amp;nbsp;&lt;/span&gt;NSTextCheckingTypePhoneNumber){&lt;br /&gt;&amp;nbsp; &amp;nbsp; NSLog (@&quot;This one is looking for phone numbers&quot;);&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;ul style=&quot;line-height: 1.4; list-style-image: initial; list-style-position: initial; margin: 0.5em 0px; padding: 0px 2.5em;&quot;&gt;
&lt;li style=&quot;border: none; margin: 0px 0px 0.25em; padding: 0px;&quot;&gt;&lt;b&gt;^ exclusive OR (XOR) - two bytes together to create a third&amp;nbsp;&lt;/b&gt;(beware is not exponentiation operator=pow())&lt;/li&gt;
&lt;li style=&quot;border: none; margin: 0px 0px 0.25em; padding: 0px;&quot;&gt;&lt;b&gt;complement&lt;/b&gt;&amp;nbsp;is the byt that is the exact opposite of another (reverse all the 0 to 1 and all the 1 becomes 0).&lt;/li&gt;
&lt;li style=&quot;border: none; margin: 0px 0px 0.25em; padding: 0px;&quot;&gt;A&amp;lt;&lt;2 .=&quot;.&quot; b=&quot;b&quot; nbsp=&quot;nbsp&quot;&gt;&amp;lt;&amp;lt; Left-shift&lt;/2&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/div&gt;
&lt;/div&gt;
. Every time you left -shift a number one place, you double tis value.
&lt;li style=&quot;border: none; margin: 0px 0px 0.25em; padding: 0px;&quot;&gt;A&amp;gt;&amp;gt;1. &amp;gt;&amp;gt;Right-shift. Every time you right-shift a number one place, you half its value (if it is odd round down).&lt;/li&gt;
&lt;br /&gt;An elegant way to declare the bit-masks with enum&lt;br /&gt;enum {&lt;br /&gt;&amp;nbsp;UIDataDetectorTypePhoneNumber = 1 &amp;lt;&amp;lt; 0,&lt;br /&gt;&amp;nbsp;UIDataDetectorTypeLink &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;= 1 &amp;lt;&amp;lt; 1,&lt;br /&gt;&amp;nbsp;UIDataDetectorTyprAddress &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; = 1 &amp;lt;&amp;lt; 2,&lt;br /&gt;&amp;nbsp;UIDataDetectorTypeNone &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; =0,&lt;br /&gt;&amp;nbsp;UIDataDetectorTypeAll &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; = NSUIntegerMax&lt;br /&gt;};&lt;br /&gt;&lt;b&gt;&lt;i&gt;&lt;u&gt;&lt;br /&gt;&lt;/u&gt;&lt;/i&gt;&lt;/b&gt;&lt;br /&gt;&lt;b&gt;&lt;i&gt;&lt;u&gt;&lt;br /&gt;&lt;/u&gt;&lt;/i&gt;&lt;/b&gt;&lt;br /&gt;&lt;b&gt;&lt;i&gt;&lt;u&gt;examples from The big Nerd Ranch Guide - Objective C&amp;nbsp;&lt;/u&gt;&lt;/i&gt;&lt;/b&gt;</content><link rel='replies' type='application/atom+xml' href='http://prasadiphonecode.blogspot.com/feeds/3184124119990554535/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://prasadiphonecode.blogspot.com/2012/09/bitwise-operator-or-and-and-in.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7998216469238959870/posts/default/3184124119990554535'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7998216469238959870/posts/default/3184124119990554535'/><link rel='alternate' type='text/html' href='http://prasadiphonecode.blogspot.com/2012/09/bitwise-operator-or-and-and-in.html' title='Bitwise operator OR and AND - in objective C - Exclusive OR - Complements - Shifting and Enum  '/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/01643993695594133107</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7998216469238959870.post-8069829425885510495</id><published>2012-09-28T01:56:00.003-07:00</published><updated>2012-09-28T01:56:35.841-07:00</updated><title type='text'>Categories</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;br /&gt;
&lt;h3 class=&quot;post-title entry-title&quot; itemprop=&quot;name&quot; style=&quot;background-color: #c0a154; color: #333333; font-family: Georgia, Utopia, &#39;Palatino Linotype&#39;, Palatino, serif; font-size: 30px; font-weight: normal; margin: 0px; position: relative;&quot;&gt;
Categories&lt;/h3&gt;
&lt;div class=&quot;post-header&quot; style=&quot;background-color: #c0a154; color: #997755; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; line-height: 1.6; margin: 0px 0px 1em;&quot;&gt;
&lt;div class=&quot;post-header-line-1&quot;&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div class=&quot;post-body entry-content&quot; id=&quot;post-body-7086033598997786878&quot; itemprop=&quot;description articleBody&quot; style=&quot;background-color: #c0a154; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 14px; line-height: 1.5; position: relative; width: 768px;&quot;&gt;
An easy way to add methods to any existing class.&lt;br /&gt;&lt;br /&gt;&lt;table cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; class=&quot;t1&quot;&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;td1&quot; valign=&quot;middle&quot;&gt;&lt;div class=&quot;p1&quot;&gt;
&lt;i&gt;#import &quot;ClassName.h&quot;&lt;/i&gt;&lt;/div&gt;
&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;td1&quot; valign=&quot;middle&quot;&gt;&lt;div class=&quot;p1&quot;&gt;
&lt;i&gt;@interface ClassName ( CategoryName )&lt;/i&gt;&lt;/div&gt;
&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;td1&quot; valign=&quot;middle&quot;&gt;&lt;div class=&quot;p1&quot;&gt;
&lt;i&gt;// method declarations&lt;/i&gt;&lt;/div&gt;
&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;td1&quot; valign=&quot;middle&quot;&gt;&lt;div class=&quot;p1&quot;&gt;
&lt;i&gt;@end&lt;/i&gt;&lt;/div&gt;
&lt;div class=&quot;p2&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;span style=&quot;background-color: yellow;&quot;&gt;From Documentation&lt;/span&gt;:&lt;br /&gt;&lt;div class=&quot;p1&quot;&gt;
&lt;b&gt;How You Can Use Categories&lt;/b&gt;&lt;/div&gt;
&lt;div class=&quot;p2&quot;&gt;
There are several ways in which you can use categories:&lt;/div&gt;
&lt;ul class=&quot;ul1&quot; style=&quot;line-height: 1.4; list-style-image: initial; list-style-position: initial; margin: 0.5em 0px; padding: 0px 2.5em;&quot;&gt;
&lt;li class=&quot;li3&quot; style=&quot;border: none; margin: 0px 0px 0.25em; padding: 0px;&quot;&gt;&lt;b&gt;To extend classes&amp;nbsp;&lt;/b&gt;defined by other implementorsFor example, you can add methods to the classes defined in the Cocoa frameworks. The added methods are inherited by subclasses and are indistinguishable at runtime from the original methods of the class.&amp;nbsp;&lt;/li&gt;
&lt;li class=&quot;li3&quot; style=&quot;border: none; margin: 0px 0px 0.25em; padding: 0px;&quot;&gt;&lt;b&gt;As an alternative to a subclassRather&lt;/b&gt;&amp;nbsp;than define a subclass to extend an existing class, through a category you can add methods to the class directly. For example, you could add categories to&amp;nbsp;&lt;span class=&quot;s1&quot;&gt;NSArray&lt;/span&gt;&amp;nbsp;and other Cocoa classes. As in the case of a subclass, you don’t need source code for the class you’re extending.&lt;/li&gt;
&lt;li class=&quot;li3&quot; style=&quot;border: none; margin: 0px 0px 0.25em; padding: 0px;&quot;&gt;&lt;b&gt;To distribute the implementation of a new class into multiple source files&amp;nbsp;&lt;/b&gt;For example, you could group the methods of a large class into several categories and put each category in its own file. When used like this, categories can benefit the development process in a number of ways—they:&lt;/li&gt;
&lt;ul class=&quot;ul2&quot; style=&quot;line-height: 1.4; list-style: disc; margin: 0.5em 0px; padding: 0px 2.5em;&quot;&gt;
&lt;li class=&quot;li3&quot; style=&quot;border: none; margin: 0px 0px 0.25em; padding: 0px;&quot;&gt;Provide a simple way of grouping related methods. Similar methods defined in different classes can be kept together in the same source file.&lt;/li&gt;
&lt;li class=&quot;li3&quot; style=&quot;border: none; margin: 0px 0px 0.25em; padding: 0px;&quot;&gt;Simplify the management of a large class when several developers contribute to the class definition.&lt;/li&gt;
&lt;li class=&quot;li3&quot; style=&quot;border: none; margin: 0px 0px 0.25em; padding: 0px;&quot;&gt;Let you achieve some of the benefits of incremental compilation for a very large class.&lt;/li&gt;
&lt;li class=&quot;li3&quot; style=&quot;border: none; margin: 0px 0px 0.25em; padding: 0px;&quot;&gt;Can help improve locality of reference for commonly used methods.&lt;/li&gt;
&lt;li class=&quot;li3&quot; style=&quot;border: none; margin: 0px 0px 0.25em; padding: 0px;&quot;&gt;Enable you to configure a class differently for separate applications, without having to maintain different versions of the same source code.&lt;/li&gt;
&lt;/ul&gt;
&lt;li class=&quot;li4&quot; style=&quot;border: none; margin: 0px 0px 0.25em; padding: 0px;&quot;&gt;&lt;span class=&quot;s2&quot;&gt;&lt;b&gt;To declare informal protocols&amp;nbsp;&lt;/b&gt;See&amp;nbsp;&lt;a href=&quot;file:///Library/Developer/Shared/Documentation/DocSets/com.apple.adc.documentation.AppleiOS4_3.iOSLibrary.docset/Contents/Resources/Documents/documentation/Cocoa/Conceptual/ObjectiveC/Chapters/ocProtocols.html#//apple_ref/doc/uid/TP30001163-CH15-114323&quot; style=&quot;color: #993322; text-decoration: none;&quot;&gt;“Informal Protocols ,”&lt;/a&gt;&amp;nbsp;as discussed under&amp;nbsp;&lt;a href=&quot;file:///Library/Developer/Shared/Documentation/DocSets/com.apple.adc.documentation.AppleiOS4_3.iOSLibrary.docset/Contents/Resources/Documents/documentation/Cocoa/Conceptual/ObjectiveC/Chapters/ocProtocols.html#//apple_ref/doc/uid/TP30001163-CH15-113922&quot; style=&quot;color: #993322; text-decoration: none;&quot;&gt;“Declaring Interfaces for Others to Implement.”&lt;/a&gt;&lt;/span&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;div class=&quot;p2&quot;&gt;
Although the Objective-C language currently allows you to use a category to override methods the class inherits, or even methods declared in the class interface, you are strongly discouraged from doing so.&amp;nbsp;&lt;b&gt;&lt;u&gt;&lt;span style=&quot;color: red;&quot;&gt;A category is not a substitute for a subclass.&lt;/span&gt;&lt;/u&gt;&lt;/b&gt;&amp;nbsp;There are several significant shortcomings to using a category to override methods:&lt;/div&gt;
&lt;ul class=&quot;ul1&quot; style=&quot;line-height: 1.4; list-style-image: initial; list-style-position: initial; margin: 0.5em 0px; padding: 0px 2.5em;&quot;&gt;
&lt;li class=&quot;li3&quot; style=&quot;border: none; margin: 0px 0px 0.25em; padding: 0px;&quot;&gt;When a category overrides an inherited method, the method in the category can, as usual, invoke the inherited implementation via a message to&amp;nbsp;&lt;span class=&quot;s1&quot;&gt;super&lt;/span&gt;. However,&lt;span style=&quot;color: red;&quot;&gt;&lt;u&gt;&amp;nbsp;if a category overrides a method that exists in the category&#39;s class, there is no way to invoke the original implementation&lt;/u&gt;&lt;/span&gt;.&lt;/li&gt;
&lt;li class=&quot;li3&quot; style=&quot;border: none; margin: 0px 0px 0.25em; padding: 0px;&quot;&gt;A category cannot reliably override methods declared in another category of the same class.This issue is of particular significance because many of the Cocoa classes are implemented using categories. A framework-defined method you try to override may itself have been implemented in a category, and so which implementation takes precedence is not defined.&lt;/li&gt;
&lt;li class=&quot;li3&quot; style=&quot;border: none; margin: 0px 0px 0.25em; padding: 0px;&quot;&gt;The very presence of some category methods may cause behavior changes across all frameworks. For example, if you override the&amp;nbsp;&lt;span class=&quot;s1&quot;&gt;windowWillClose:&lt;/span&gt;&amp;nbsp;delegate method in a category on&amp;nbsp;&lt;span class=&quot;s1&quot;&gt;NSObject&lt;/span&gt;, all window delegates in your program then respond using the category method; the behavior of all your instances of&lt;span class=&quot;s1&quot;&gt;NSWindow&lt;/span&gt;&amp;nbsp;may change. Categories you add on a framework class may cause mysterious changes in behavior and lead to crashes.&lt;/li&gt;
&lt;/ul&gt;
&lt;/div&gt;
&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://prasadiphonecode.blogspot.com/feeds/8069829425885510495/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://prasadiphonecode.blogspot.com/2012/09/categories.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7998216469238959870/posts/default/8069829425885510495'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7998216469238959870/posts/default/8069829425885510495'/><link rel='alternate' type='text/html' href='http://prasadiphonecode.blogspot.com/2012/09/categories.html' title='Categories'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/01643993695594133107</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7998216469238959870.post-8279927600141470961</id><published>2012-09-28T01:56:00.000-07:00</published><updated>2012-09-28T01:56:01.968-07:00</updated><title type='text'>NSLog - Tokens - %@ - %p memory token, %zu size_T token (tip to find the type (32 or 64 bit) of environment)</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;br /&gt;
&lt;h3 class=&quot;post-title entry-title&quot; itemprop=&quot;name&quot; style=&quot;background-color: #c0a154; color: #333333; font-family: Georgia, Utopia, &#39;Palatino Linotype&#39;, Palatino, serif; font-size: 30px; font-weight: normal; margin: 0px; position: relative;&quot;&gt;
NSLog - Tokens - %@ - %p memory token, %zu size_T token (tip to find the type (32 or 64 bit) of environment)&lt;/h3&gt;
&lt;div class=&quot;post-header&quot; style=&quot;background-color: #c0a154; color: #997755; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; line-height: 1.6; margin: 0px 0px 1em;&quot;&gt;
&lt;div class=&quot;post-header-line-1&quot;&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div class=&quot;post-body entry-content&quot; id=&quot;post-body-955613751719795770&quot; itemprop=&quot;description articleBody&quot; style=&quot;background-color: #c0a154; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 14px; line-height: 1.5; position: relative; width: 768px;&quot;&gt;
in&amp;nbsp;&lt;b&gt;NSLog&lt;/b&gt;&amp;nbsp;the first argument is required and must be an NSString instance.&lt;br /&gt;This instance is called the&lt;i style=&quot;font-weight: bold;&quot;&gt;&amp;nbsp;format string&amp;nbsp;&lt;/i&gt;and it contains text and a number of&amp;nbsp;&lt;b&gt;tokens&lt;/b&gt;.&lt;br /&gt;The&amp;nbsp;&lt;b&gt;tokens&lt;/b&gt;&amp;nbsp;(also called&amp;nbsp;&lt;b&gt;format specifications&lt;/b&gt;) are prefixed with a&amp;nbsp;&lt;b&gt;percent (%)&lt;/b&gt;&amp;nbsp;symbol.&lt;br /&gt;&lt;br /&gt;&lt;ul style=&quot;line-height: 1.4; list-style-image: initial; list-style-position: initial; margin: 0.5em 0px; padding: 0px 2.5em;&quot;&gt;
&lt;li style=&quot;border: none; margin: 0px 0px 0.25em; padding: 0px;&quot;&gt;With the&amp;nbsp;&lt;b&gt;%@&lt;/b&gt;&amp;nbsp;is encountered in the format string, instead of the token being replaced by the&amp;nbsp;corresponding&amp;nbsp;argument, that argument&amp;nbsp;&lt;b&gt;is sent the message&amp;nbsp;&lt;u&gt;description&lt;/u&gt;.&lt;/b&gt;&amp;nbsp;The&amp;nbsp;&lt;b&gt;description&lt;/b&gt;&amp;nbsp;&lt;b&gt;method&lt;/b&gt;returns an NSString that replaces the token.&amp;nbsp;&lt;b&gt;&lt;i&gt;Every object&amp;nbsp;implements&amp;nbsp;the method description&lt;/i&gt;&lt;/b&gt;.&lt;/li&gt;
&lt;li style=&quot;border: none; margin: 0px 0px 0.25em; padding: 0px;&quot;&gt;With the %p token you can see the memory address of a variable or functions name!.&lt;/li&gt;
&lt;/ul&gt;
&lt;br /&gt;&amp;nbsp; &amp;nbsp; %@ Object, calls the Object&#39;s description method&lt;br /&gt;&amp;nbsp; &amp;nbsp; %d, %i signed int&lt;br /&gt;&amp;nbsp; &amp;nbsp; %u unsigned int&lt;br /&gt;&amp;nbsp; &amp;nbsp; %f float/double&lt;br /&gt;&amp;nbsp; &amp;nbsp; %p for pointers to show the memory address&lt;br /&gt;&amp;nbsp; &amp;nbsp; %zu value of type size_t (for sizeof(variable function)&lt;br /&gt;&amp;nbsp; &amp;nbsp; %s C strings&lt;br /&gt;&amp;nbsp; &amp;nbsp; \u can used for arbitrary unicode chars example:NSLog(@&quot;\u03c0&quot;);//π&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;------------------------------&lt;br /&gt;Variables:&lt;br /&gt;int i =17;&lt;br /&gt;printf(&quot;i stores the value at the address %p\n&quot;, &amp;amp;i);&lt;br /&gt;&lt;br /&gt;i stores its value at 0xbfffb749&lt;br /&gt;&lt;br /&gt;Function name&lt;br /&gt;printf(&quot;the main function starts at %p&quot;, main);&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;ul style=&quot;line-height: 1.4; list-style-image: initial; list-style-position: initial; margin: 0.5em 0px; padding: 0px 2.5em;&quot;&gt;
&lt;li style=&quot;border: none; margin: 0px 0px 0.25em; padding: 0px;&quot;&gt;With the %zu you can return a value of type size_t (for sizeof(variable) function)&lt;/li&gt;
&lt;/ul&gt;
&lt;br /&gt;printF(&quot;A pointer is %zu bytes&quot;, sizeof(int *));&lt;br /&gt;4 bytes long pointer = 32 bit mode&lt;br /&gt;8 bytes long pointer = 64 bit mode&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;ul style=&quot;line-height: 1.4; list-style-image: initial; list-style-position: initial; margin: 0.5em 0px; padding: 0px 2.5em;&quot;&gt;
&lt;li style=&quot;border: none; margin: 0px 0px 0.25em; padding: 0px;&quot;&gt;With&amp;nbsp;the \u you can use arbitrary unicode chars&amp;nbsp;&lt;/li&gt;
&lt;/ul&gt;
&lt;div&gt;
NSLog (@&quot;\u03c0&quot;); // π&amp;nbsp;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
Last edit: 19/5/2012&lt;br /&gt;&lt;strike&gt;Last edit: 21/4/2012&lt;/strike&gt;&lt;/div&gt;
&lt;div&gt;
&lt;i&gt;&lt;strike&gt;Last edit: 22/3/2012&lt;/strike&gt;&lt;/i&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://prasadiphonecode.blogspot.com/feeds/8279927600141470961/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://prasadiphonecode.blogspot.com/2012/09/nslog-tokens-p-memory-token-zu-sizet.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7998216469238959870/posts/default/8279927600141470961'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7998216469238959870/posts/default/8279927600141470961'/><link rel='alternate' type='text/html' href='http://prasadiphonecode.blogspot.com/2012/09/nslog-tokens-p-memory-token-zu-sizet.html' title='NSLog - Tokens - %@ - %p memory token, %zu size_T token (tip to find the type (32 or 64 bit) of environment)'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/01643993695594133107</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7998216469238959870.post-6658039841549333265</id><published>2012-09-28T01:54:00.004-07:00</published><updated>2012-09-28T01:54:54.507-07:00</updated><title type='text'>What Is Key-Value Coding?</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;







&lt;br /&gt;
&lt;div class=&quot;p1&quot;&gt;
What Is Key-Value Coding?&lt;/div&gt;
&lt;div class=&quot;p2&quot;&gt;
Key-value coding is a mechanism for accessing an object’s properties indirectly, using strings to identify properties, rather than through invocation of an accessor method or accessing them directly through instance variables. In essence, key-value coding defines the patterns and method signatures that your application’s accessor methods implement.&lt;/div&gt;
&lt;div class=&quot;p2&quot;&gt;
&lt;span class=&quot;s1&quot;&gt;&lt;a href=&quot;http://objectivecc.blogspot.in/2012/04/what-is-key-value-coding.html&quot;&gt;Accessor methods&lt;/a&gt;&lt;/span&gt;, as the name suggests, provide access to your application’s data model’s property values. There are two basic forms of accessor—get accessors and set accessors. Get accessors, also referred to as getters, return the values of a property. Set accessors, also referred to as setters, set the value of a property. There are getter and setter variants for dealing with both object attributes and to-many relationships.&lt;/div&gt;
&lt;div class=&quot;p2&quot;&gt;
Implementing key-value coding compliant accessors in your application is an important design principle. Accessors help to enforce proper data encapsulation, isolate&lt;a href=&quot;http://objectivecc.blogspot.in/2012/04/what-is-key-value-coding.html&quot;&gt;&lt;span class=&quot;s1&quot;&gt;memory management&lt;/span&gt;&lt;/a&gt;&amp;nbsp;to centralized locations, and facilitate integration with other technologies such as key-value observing, Core Data, Cocoa bindings, and scriptability. Key-value coding methods can, in many cases, also be utilized to simplify your application’s code. See&amp;nbsp;Model Object Implementation Guide&amp;nbsp;for more guidance on why your application should implement key-value coding compliant accessors and make use of them.&lt;/div&gt;
&lt;div class=&quot;p2&quot;&gt;
The essential methods for key-value coding are declared in the&amp;nbsp;&lt;a href=&quot;http://developer.apple.com/library/mac/documentation/Cocoa/Reference/Foundation/Protocols/NSKeyValueCoding_Protocol/Reference/Reference.html#//apple_ref/occ/cat/NSKeyValueCoding&quot;&gt;&lt;span class=&quot;s2&quot;&gt;NSKeyValueCoding&lt;/span&gt;&lt;/a&gt;&amp;nbsp;Objective-C informal protocol and default implementations are provided by&amp;nbsp;&lt;a href=&quot;http://developer.apple.com/library/mac/documentation/Cocoa/Reference/Foundation/Classes/NSObject_Class/Reference/Reference.html#//apple_ref/occ/cl/NSObject&quot;&gt;&lt;span class=&quot;s2&quot;&gt;NSObject&lt;/span&gt;&lt;/a&gt;.&lt;/div&gt;
&lt;div class=&quot;p2&quot;&gt;
Key-value coding supports properties with object values, as well as the scalar types and structs. Non-object parameters and return types are detected and automatically wrapped, and unwrapped, as described in&amp;nbsp;&lt;a href=&quot;http://developer.apple.com/library/mac/documentation/Cocoa/Conceptual/KeyValueCoding/Articles/DataTypes.html#//apple_ref/doc/uid/20002171-BAJEAIEE&quot;&gt;&lt;span class=&quot;s3&quot;&gt;“Scalar and Structure Support.”&lt;/span&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div class=&quot;p3&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;p4&quot;&gt;
examples:&lt;/div&gt;
&lt;div class=&quot;p5&quot;&gt;
Object types:&lt;/div&gt;
&lt;div class=&quot;p4&quot;&gt;
[a setProductName:@&quot;Washing Machine&quot;]&lt;/div&gt;
&lt;div class=&quot;p4&quot;&gt;
[a setValue:@&quot;Washing Machine&quot; forKey:@&quot;productName&quot;];&lt;/div&gt;
&lt;div class=&quot;p3&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;p4&quot;&gt;
[a valueForKey:@&quot;productName&quot;]&lt;/div&gt;
&lt;div class=&quot;p3&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;p5&quot;&gt;
Non-object types&lt;/div&gt;
&lt;div class=&quot;p4&quot;&gt;
[a setVoltage:240];&lt;/div&gt;
&lt;div class=&quot;p4&quot;&gt;
[a setValue:[NSNumber numberWithInt:240] forKey:@&quot;voltage&quot;];&lt;/div&gt;
&lt;div class=&quot;p3&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;p6&quot;&gt;
some notes from The Big Nerd Ranch Guide:&lt;/div&gt;
&lt;div class=&quot;p4&quot;&gt;
Note that even though you have no accessor methods for one object, the variable can still be set and read from others methods (via key-value coding). This is an obvious violation of the idea of object encapsulation - methods of an object are public, but the instance variables are delicate and should be kept private.&amp;nbsp;&lt;b&gt;If key-value coding weren&#39;t astonishingly useful, no one would tolerate it.&lt;/b&gt;&lt;/div&gt;
&lt;div class=&quot;p3&quot;&gt;
&lt;b&gt;&lt;/b&gt;&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;p7&quot;&gt;
&lt;a href=&quot;http://stackoverflow.com/questions/379133/key-value-coding-with-objective-c&quot;&gt;&lt;b&gt;and from stackoverflow&lt;/b&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div class=&quot;p8&quot;&gt;
Charbonneau is correct. I get an XML feed in which corresponds to an object on the iPhone/Mac client. Typically it&#39;ll be something like &lt;user&gt;&lt;name&gt;Bob&lt;/name&gt;&lt;age&gt;43&lt;/age&gt;&lt;/user&gt; I had a method before that would key/value code NSDictionary instances.&amp;nbsp;–&amp;nbsp;&lt;a href=&quot;http://stackoverflow.com/users/40882/coocoo4cocoa&quot;&gt;&lt;span class=&quot;s4&quot;&gt;Coocoo4Cocoa&lt;/span&gt;&lt;/a&gt;&amp;nbsp;&lt;a href=&quot;http://stackoverflow.com/questions/379133/key-value-coding-with-objective-c#comment206890_379143&quot;&gt;&lt;span class=&quot;s5&quot;&gt;Dec 18 &#39;08 at 20:53&lt;/span&gt;&lt;/a&gt;&lt;/div&gt;
&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://prasadiphonecode.blogspot.com/feeds/6658039841549333265/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://prasadiphonecode.blogspot.com/2012/09/what-is-key-value-coding.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7998216469238959870/posts/default/6658039841549333265'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7998216469238959870/posts/default/6658039841549333265'/><link rel='alternate' type='text/html' href='http://prasadiphonecode.blogspot.com/2012/09/what-is-key-value-coding.html' title='What Is Key-Value Coding?'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/01643993695594133107</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7998216469238959870.post-3182410131995554148</id><published>2012-09-28T01:53:00.002-07:00</published><updated>2012-09-28T01:53:40.179-07:00</updated><title type='text'>Blocks</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;br /&gt;
&lt;h3 class=&quot;post-title entry-title&quot; itemprop=&quot;name&quot; style=&quot;font-family: Georgia, Utopia, &#39;Palatino Linotype&#39;, Palatino, serif; font-size: 30px; font-weight: normal; margin: 0px; position: relative;&quot;&gt;
Blocks&lt;/h3&gt;
&lt;div class=&quot;post-header&quot; style=&quot;color: #997755; line-height: 1.6; margin: 0px 0px 1em;&quot;&gt;
&lt;div class=&quot;post-header-line-1&quot;&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div class=&quot;post-body entry-content&quot; id=&quot;post-body-229306577045303848&quot; itemprop=&quot;description articleBody&quot; style=&quot;font-size: 14px; line-height: 1.5; position: relative; width: 768px;&quot;&gt;
&lt;span style=&quot;background-color: #c0a154; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; line-height: 20px;&quot;&gt;^(double div, double divisor) {&lt;/span&gt;&lt;br style=&quot;background-color: #c0a154; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; line-height: 20px;&quot; /&gt;&lt;span style=&quot;background-color: #c0a154; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; line-height: 20px;&quot;&gt;&amp;nbsp; double quotient = div / divisor;&lt;/span&gt;&lt;br style=&quot;background-color: #c0a154; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; line-height: 20px;&quot; /&gt;&lt;span style=&quot;background-color: #c0a154; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; line-height: 20px;&quot;&gt;&amp;nbsp; return quotient;&lt;/span&gt;&lt;br style=&quot;background-color: #c0a154; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; line-height: 20px;&quot; /&gt;&lt;span style=&quot;background-color: #c0a154; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; line-height: 20px;&quot;&gt;};&lt;/span&gt;&lt;br style=&quot;background-color: #c0a154; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; line-height: 20px;&quot; /&gt;&lt;br style=&quot;background-color: #c0a154; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; line-height: 20px;&quot; /&gt;&lt;span style=&quot;background-color: #c0a154; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; line-height: 20px;&quot;&gt;^: identifies a block&lt;/span&gt;&lt;br style=&quot;background-color: #c0a154; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; line-height: 20px;&quot; /&gt;&lt;br style=&quot;background-color: #c0a154; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; line-height: 20px;&quot; /&gt;&lt;b style=&quot;background-color: #c0a154; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; line-height: 20px;&quot;&gt;Block can take arguments&lt;/b&gt;&lt;br style=&quot;background-color: #c0a154; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; line-height: 20px;&quot; /&gt;&lt;br style=&quot;background-color: #c0a154; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; line-height: 20px;&quot; /&gt;&lt;span style=&quot;background-color: #c0a154; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; line-height: 20px;&quot;&gt;If you want to access a block by a name, we have to&amp;nbsp;&lt;/span&gt;&lt;b style=&quot;background-color: #c0a154; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; line-height: 20px;&quot;&gt;assign it to a block variable.&lt;/b&gt;&lt;br style=&quot;background-color: #c0a154; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; line-height: 20px;&quot; /&gt;&lt;br style=&quot;background-color: #c0a154; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; line-height: 20px;&quot; /&gt;&lt;span style=&quot;background-color: #c0a154; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; line-height: 20px;&quot;&gt;void (^devow) (id, NSUInteger, BOOL *)&lt;/span&gt;&lt;br style=&quot;background-color: #c0a154; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; line-height: 20px;&quot; /&gt;&lt;b style=&quot;background-color: #c0a154; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; line-height: 20px;&quot;&gt;Block variable declaration&lt;/b&gt;&lt;br style=&quot;background-color: #c0a154; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; line-height: 20px;&quot; /&gt;&lt;b style=&quot;background-color: #c0a154; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; line-height: 20px;&quot;&gt;&lt;br /&gt;&lt;/b&gt;&lt;br style=&quot;background-color: #c0a154; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; line-height: 20px;&quot; /&gt;&lt;span style=&quot;background-color: #c0a154; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; line-height: 20px;&quot;&gt;notice that the block assignment ends with a semi-colon just like any variable assignment would.&lt;/span&gt;&lt;br style=&quot;background-color: #c0a154; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; line-height: 20px;&quot; /&gt;&lt;br style=&quot;background-color: #c0a154; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; line-height: 20px;&quot; /&gt;&lt;b style=&quot;background-color: #c0a154; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; line-height: 20px;&quot;&gt;You can use typedef to declare a block&lt;/b&gt;&lt;span style=&quot;background-color: #c0a154; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; line-height: 20px;&quot;&gt;&amp;nbsp;at the start of top of the file like&lt;/span&gt;&lt;br style=&quot;background-color: #c0a154; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; line-height: 20px;&quot; /&gt;&lt;b style=&quot;background-color: #c0a154; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; line-height: 20px;&quot;&gt;typedef void (^ArrayEnumerationBlock) (id, NSUInteger, BOOL *)&lt;/b&gt;&lt;span style=&quot;background-color: #c0a154; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; line-height: 20px;&quot;&gt;;&lt;/span&gt;&lt;br style=&quot;background-color: #c0a154; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; line-height: 20px;&quot; /&gt;&lt;br style=&quot;background-color: #c0a154; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; line-height: 20px;&quot; /&gt;&lt;span style=&quot;background-color: #c0a154; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; line-height: 20px;&quot;&gt;Rather to write: void (^devowelizer) (id, NSUINteger, BOOL *);&lt;/span&gt;&lt;br style=&quot;background-color: #c0a154; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; line-height: 20px;&quot; /&gt;&lt;span style=&quot;background-color: #c0a154; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; line-height: 20px;&quot;&gt;you can &amp;nbsp; write:&amp;nbsp;&lt;/span&gt;&lt;b style=&quot;background-color: #c0a154; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; line-height: 20px;&quot;&gt;ArrayEnumerationBlock devowelizer;&lt;/b&gt;&lt;br style=&quot;background-color: #c0a154; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; line-height: 20px;&quot; /&gt;&lt;br style=&quot;background-color: #c0a154; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; line-height: 20px;&quot; /&gt;&lt;b style=&quot;background-color: #c0a154; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; line-height: 20px;&quot;&gt;If a block returns a value&lt;/b&gt;&lt;span style=&quot;background-color: #c0a154; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; line-height: 20px;&quot;&gt;&amp;nbsp;you can call that block variable like a function&lt;/span&gt;&lt;br style=&quot;background-color: #c0a154; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; line-height: 20px;&quot; /&gt;&lt;br style=&quot;background-color: #c0a154; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; line-height: 20px;&quot; /&gt;&lt;span style=&quot;background-color: #c0a154; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; line-height: 20px;&quot;&gt;double (^divinationBlock) (double, double) = ^(double k, double j) {&lt;/span&gt;&lt;br style=&quot;background-color: #c0a154; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; line-height: 20px;&quot; /&gt;&lt;span style=&quot;background-color: #c0a154; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; line-height: 20px;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; return k/j;&lt;/span&gt;&lt;br style=&quot;background-color: #c0a154; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; line-height: 20px;&quot; /&gt;&lt;span style=&quot;background-color: #c0a154; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; line-height: 20px;&quot;&gt;}&lt;/span&gt;&lt;br style=&quot;background-color: #c0a154; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; line-height: 20px;&quot; /&gt;&lt;br style=&quot;background-color: #c0a154; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; line-height: 20px;&quot; /&gt;&lt;span style=&quot;background-color: #c0a154; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; line-height: 20px;&quot;&gt;Blocks are created and stored on the stack and will be destroyed (with the stack) when the function or method that created the block returns. To&amp;nbsp;&lt;/span&gt;&lt;b style=&quot;background-color: #c0a154; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; line-height: 20px;&quot;&gt;&lt;u&gt;copy a block from the stack to the heap&lt;/u&gt;&lt;/b&gt;&lt;span style=&quot;background-color: #c0a154; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; line-height: 20px;&quot;&gt;, you send it the copy message:&lt;/span&gt;&lt;br style=&quot;background-color: #c0a154; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; line-height: 20px;&quot; /&gt;&lt;b style=&quot;background-color: #c0a154; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; line-height: 20px;&quot;&gt;&lt;u&gt;ArrayEnumerationBlock iVarSomething = [something copy];&lt;/u&gt;&lt;/b&gt;&lt;span style=&quot;background-color: #c0a154; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; line-height: 20px;&quot;&gt;&amp;nbsp;(now the new block variable is a pointer to the block).&lt;/span&gt;&lt;b style=&quot;background-color: #c0a154; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; line-height: 20px;&quot;&gt;&lt;u&gt;Methods that takes blocks as arguments, are expected to copy blocks passed to them&lt;/u&gt;&lt;/b&gt;&lt;span style=&quot;background-color: #c0a154; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; line-height: 20px;&quot;&gt;.&lt;/span&gt;&lt;br style=&quot;background-color: #c0a154; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; line-height: 20px;&quot; /&gt;&lt;span style=&quot;background-color: #c0a154; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; line-height: 20px;&quot;&gt;A heap-based block behaving like an object comes with some memory management issues:&lt;/span&gt;&lt;br style=&quot;background-color: #c0a154; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; line-height: 20px;&quot; /&gt;&lt;br style=&quot;background-color: #c0a154; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; line-height: 20px;&quot; /&gt;&lt;span style=&quot;background-color: #c0a154; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; line-height: 20px;&quot;&gt;#Source: The Big Nerd Ranch Guide (Objective C) - kindle version&lt;/span&gt;&lt;br style=&quot;background-color: #c0a154; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; line-height: 20px;&quot; /&gt;&lt;br style=&quot;background-color: #c0a154; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; line-height: 20px;&quot; /&gt;&lt;br style=&quot;background-color: #c0a154; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; line-height: 20px;&quot; /&gt;&lt;ul style=&quot;background-color: #c0a154; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; line-height: 1.4; list-style-image: initial; list-style-position: initial; margin: 0.5em 0px; padding: 0px 2.5em;&quot;&gt;
&lt;li style=&quot;border: none; margin: 0px 0px 0.25em; padding: 0px;&quot;&gt;external variables are captured by the block when the copy is made.&lt;/li&gt;
&lt;li style=&quot;border: none; margin: 0px 0px 0.25em; padding: 0px;&quot;&gt;to avoid retain cycles declare a __weak pointer outside the block&lt;/li&gt;
&lt;li style=&quot;border: none; margin: 0px 0px 0.25em; padding: 0px;&quot;&gt;variables captured by a block are constant within the block and you cannot change their values (&lt;b&gt;you can still send the object messages that can change its contents&lt;/b&gt;,&amp;nbsp;&lt;i&gt;&lt;u&gt;you cannot modify the pointer itself&lt;/u&gt;&lt;/i&gt;).&lt;/li&gt;
&lt;li style=&quot;border: none; margin: 0px 0px 0.25em; padding: 0px;&quot;&gt;if you want to change them you need to use __block otherwise you get compilation error.&lt;/li&gt;
&lt;/ul&gt;
&lt;div style=&quot;background-color: #c0a154; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; line-height: 20px;&quot;&gt;
__block int counter =0 ;&lt;/div&gt;
&lt;div style=&quot;background-color: #c0a154; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; line-height: 20px;&quot;&gt;
void (^counterBlock) () = ^ {counter++;};&lt;/div&gt;
&lt;div style=&quot;background-color: #c0a154; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; line-height: 20px;&quot;&gt;
...&lt;/div&gt;
&lt;div style=&quot;background-color: #c0a154; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; line-height: 20px;&quot;&gt;
counterBlock (); //Increments&amp;nbsp;counter to 1&lt;/div&gt;
&lt;div style=&quot;background-color: #c0a154; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; line-height: 20px;&quot;&gt;
counterBlock ();//Increments counter to 2&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://prasadiphonecode.blogspot.com/feeds/3182410131995554148/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://prasadiphonecode.blogspot.com/2012/09/blocks.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7998216469238959870/posts/default/3182410131995554148'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7998216469238959870/posts/default/3182410131995554148'/><link rel='alternate' type='text/html' href='http://prasadiphonecode.blogspot.com/2012/09/blocks.html' title='Blocks'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/01643993695594133107</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7998216469238959870.post-7998355182131315898</id><published>2012-09-28T01:52:00.000-07:00</published><updated>2012-09-28T01:52:04.520-07:00</updated><title type='text'>Wy shouldn&#39;t I use accessor methodes in an init method?</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;br /&gt;
&lt;h3 class=&quot;post-title entry-title&quot; itemprop=&quot;name&quot; style=&quot;background-color: #c0a154; color: #333333; font-family: Georgia, Utopia, &#39;Palatino Linotype&#39;, Palatino, serif; font-size: 30px; font-weight: normal; margin: 0px; position: relative;&quot;&gt;
Wy shouldn&#39;t I use accessor methodes in an init method?&lt;/h3&gt;
&lt;div class=&quot;post-header&quot; style=&quot;background-color: #c0a154; color: #997755; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; line-height: 1.6; margin: 0px 0px 1em;&quot;&gt;
&lt;div class=&quot;post-header-line-1&quot;&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div class=&quot;post-body entry-content&quot; id=&quot;post-body-4123852273941555195&quot; itemprop=&quot;description articleBody&quot; style=&quot;background-color: #c0a154; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 14px; line-height: 1.5; position: relative; width: 768px;&quot;&gt;
&lt;b style=&quot;background-color: yellow;&quot;&gt;First: Apples Documentation says so...&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;&lt;div class=&quot;p1&quot;&gt;
&lt;b&gt;Don’t Use Accessor Methods in Initializer Methods and dealloc&lt;/b&gt;&lt;/div&gt;
&lt;div class=&quot;p2&quot;&gt;
The only places you shouldn’t use accessor methods to set an instance variable are in&amp;nbsp;&lt;span class=&quot;s1&quot;&gt;initializer&lt;/span&gt;&amp;nbsp;methods and&amp;nbsp;&lt;span class=&quot;s2&quot;&gt;dealloc&lt;/span&gt;. To initialize a counter object with a number object representing zero, you might implement an&amp;nbsp;&lt;span class=&quot;s2&quot;&gt;init&lt;/span&gt;&amp;nbsp;method as follows:&lt;/div&gt;
&lt;table cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; class=&quot;t1&quot;&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;td1&quot; valign=&quot;middle&quot;&gt;&lt;div class=&quot;p3&quot;&gt;
- init {&lt;/div&gt;
&lt;div class=&quot;p4&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;td1&quot; valign=&quot;middle&quot;&gt;&lt;div class=&quot;p3&quot;&gt;
&amp;nbsp; &amp;nbsp; self = [super init];&lt;/div&gt;
&lt;div class=&quot;p4&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;td1&quot; valign=&quot;middle&quot;&gt;&lt;div class=&quot;p3&quot;&gt;
&amp;nbsp; &amp;nbsp; if (self) {&lt;/div&gt;
&lt;div class=&quot;p4&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;td1&quot; valign=&quot;middle&quot;&gt;&lt;div class=&quot;p3&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; _count = [[NSNumber alloc] initWithInteger:0];&lt;/div&gt;
&lt;div class=&quot;p4&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;td1&quot; valign=&quot;middle&quot;&gt;&lt;div class=&quot;p3&quot;&gt;
&amp;nbsp; &amp;nbsp; }&lt;/div&gt;
&lt;div class=&quot;p4&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;td1&quot; valign=&quot;middle&quot;&gt;&lt;div class=&quot;p3&quot;&gt;
&amp;nbsp; &amp;nbsp; return self;&lt;/div&gt;
&lt;div class=&quot;p4&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;td1&quot; valign=&quot;middle&quot;&gt;&lt;div class=&quot;p3&quot;&gt;
}&lt;/div&gt;
&lt;div class=&quot;p4&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;div class=&quot;p2&quot;&gt;
To allow a counter to be initialized with a count other than zero, you might implement an&amp;nbsp;&lt;span class=&quot;s2&quot;&gt;initWithCount:&lt;/span&gt;&amp;nbsp;method as follows:&lt;/div&gt;
&lt;table cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; class=&quot;t1&quot;&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;td1&quot; valign=&quot;middle&quot;&gt;&lt;div class=&quot;p3&quot;&gt;
- initWithCount:(NSNumber *)startingCount {&lt;/div&gt;
&lt;div class=&quot;p4&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;td1&quot; valign=&quot;middle&quot;&gt;&lt;div class=&quot;p3&quot;&gt;
&amp;nbsp; &amp;nbsp; self = [super init];&lt;/div&gt;
&lt;div class=&quot;p4&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;td1&quot; valign=&quot;middle&quot;&gt;&lt;div class=&quot;p3&quot;&gt;
&amp;nbsp; &amp;nbsp; if (self) {&lt;/div&gt;
&lt;div class=&quot;p4&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;td1&quot; valign=&quot;middle&quot;&gt;&lt;div class=&quot;p3&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; _count = [startingCount copy];&lt;/div&gt;
&lt;div class=&quot;p4&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;td1&quot; valign=&quot;middle&quot;&gt;&lt;div class=&quot;p3&quot;&gt;
&amp;nbsp; &amp;nbsp; }&lt;/div&gt;
&lt;div class=&quot;p4&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;td1&quot; valign=&quot;middle&quot;&gt;&lt;div class=&quot;p3&quot;&gt;
&amp;nbsp; &amp;nbsp; return self;&lt;/div&gt;
&lt;div class=&quot;p4&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;td1&quot; valign=&quot;middle&quot;&gt;&lt;div class=&quot;p3&quot;&gt;
}&lt;/div&gt;
&lt;div class=&quot;p4&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;div class=&quot;p2&quot;&gt;
Since the Counter class has an object instance variable, you must also implement a&amp;nbsp;&lt;span class=&quot;s2&quot;&gt;dealloc&lt;/span&gt;&amp;nbsp;method. It should relinquish ownership of any instance variables by sending them a&amp;nbsp;&lt;span class=&quot;s2&quot;&gt;release&lt;/span&gt;&amp;nbsp;message, and ultimately it should invoke super’s implementation:&lt;/div&gt;
&lt;table cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; class=&quot;t1&quot;&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;td1&quot; valign=&quot;middle&quot;&gt;&lt;div class=&quot;p3&quot;&gt;
- (void)dealloc {&lt;/div&gt;
&lt;div class=&quot;p4&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;td1&quot; valign=&quot;middle&quot;&gt;&lt;div class=&quot;p3&quot;&gt;
&amp;nbsp; &amp;nbsp; [_count release];&lt;/div&gt;
&lt;div class=&quot;p4&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;td1&quot; valign=&quot;middle&quot;&gt;&lt;div class=&quot;p3&quot;&gt;
&amp;nbsp; &amp;nbsp; [super dealloc];&lt;/div&gt;
&lt;div class=&quot;p4&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;td1&quot; valign=&quot;middle&quot;&gt;&lt;div class=&quot;p3&quot;&gt;
}&lt;/div&gt;
&lt;div class=&quot;p4&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;background-color: yellow;&quot;&gt;What stackoverflow says?&amp;nbsp;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;ul style=&quot;line-height: 1.4; list-style-image: initial; list-style-position: initial; margin: 0.5em 0px; padding: 0px 2.5em;&quot;&gt;
&lt;li style=&quot;border: none; margin: 0px 0px 0.25em; padding: 0px;&quot;&gt;&lt;span style=&quot;background-color: white; font-family: Arial, &#39;Liberation Sans&#39;, &#39;DejaVu Sans&#39;, sans-serif; line-height: 18px;&quot;&gt;It&#39;s basically a guideline to minimize the potential for bugs.&lt;/span&gt;&lt;/li&gt;
&lt;li style=&quot;border: none; margin: 0px 0px 0.25em; padding: 0px;&quot;&gt;&lt;span style=&quot;background-color: white; font-family: Arial, &#39;Liberation Sans&#39;, &#39;DejaVu Sans&#39;, sans-serif; line-height: 18px;&quot;&gt;It is all about using idiomatically consistent code. If you pattern all of your code appropriately there are sets of rules that guarantee that using an accessor in init/dealloc is safe.&lt;/span&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;br /&gt;&lt;span style=&quot;background-color: white; font-family: Arial, &#39;Liberation Sans&#39;, &#39;DejaVu Sans&#39;, sans-serif; line-height: 18px;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;background-color: white; font-family: Arial, &#39;Liberation Sans&#39;, &#39;DejaVu Sans&#39;, sans-serif; line-height: 18px;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;background-color: yellow; font-family: Arial, &#39;Liberation Sans&#39;, &#39;DejaVu Sans&#39;, sans-serif; line-height: 18px;&quot;&gt;What Big Nerd Ranch guide says?&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;background-color: white; font-family: Arial, &#39;Liberation Sans&#39;, &#39;DejaVu Sans&#39;, sans-serif; line-height: 18px;&quot;&gt;&quot;..In most cases, there is a little reason to do one over the other, but it makes for a great argument. The argument goes like this: The assign guy says, &quot;You can&#39;t use an accessor method in an init method! The accessor asumes that the object is ready for work, and it isn&#39;t ready for work until after the init method is complete.&quot; Then the accessor method guy says, &quot;Oh, come on. In the real world that is almost never an issue. My accessor method might be taking care of other stuff for me. I use my accessor anytime I set that variable.&quot; In reality, either approach will work in the cast majority of cases.&amp;nbsp;&lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://prasadiphonecode.blogspot.com/feeds/7998355182131315898/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://prasadiphonecode.blogspot.com/2012/09/wy-shouldnt-i-use-accessor-methodes-in.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7998216469238959870/posts/default/7998355182131315898'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7998216469238959870/posts/default/7998355182131315898'/><link rel='alternate' type='text/html' href='http://prasadiphonecode.blogspot.com/2012/09/wy-shouldnt-i-use-accessor-methodes-in.html' title='Wy shouldn&#39;t I use accessor methodes in an init method?'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/01643993695594133107</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7998216469238959870.post-5620872807944989702</id><published>2012-09-28T01:50:00.003-07:00</published><updated>2012-09-28T01:50:27.293-07:00</updated><title type='text'>Top-level HeaderDoc tags</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;







&lt;br /&gt;
&lt;div class=&quot;p1&quot;&gt;
Top-level HeaderDoc tags&lt;/div&gt;
&lt;div class=&quot;p2&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;p3&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;table cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; class=&quot;t1&quot;&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td class=&quot;td1&quot; valign=&quot;middle&quot;&gt;
&lt;div class=&quot;p4&quot;&gt;
Tag&lt;/div&gt;
&lt;/td&gt;
&lt;td class=&quot;td2&quot; valign=&quot;middle&quot;&gt;
&lt;div class=&quot;p4&quot;&gt;
Example&lt;/div&gt;
&lt;/td&gt;
&lt;td class=&quot;td3&quot; valign=&quot;middle&quot;&gt;
&lt;div class=&quot;p4&quot;&gt;
Identifies&lt;/div&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;td4&quot; valign=&quot;middle&quot;&gt;
&lt;div class=&quot;p5&quot;&gt;
@availabilitymacro&lt;/div&gt;
&lt;/td&gt;
&lt;td class=&quot;td5&quot; valign=&quot;middle&quot;&gt;
&lt;div class=&quot;p5&quot;&gt;
@availabilitymacro AVAILABLE_IN_MYAPP_1_0_AND_LATER&lt;/div&gt;
&lt;div class=&quot;p5&quot;&gt;
Available in MyApp v1.0 and later.&lt;/div&gt;
&lt;/td&gt;
&lt;td class=&quot;td6&quot; valign=&quot;middle&quot;&gt;
&lt;div class=&quot;p6&quot;&gt;
This tag tells HeaderDoc that whenever the named token appears in a declaration, the token should be deleted and the “Availability:“ attribute for that declaration should be set to the string that follows.&lt;/div&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;td4&quot; valign=&quot;middle&quot;&gt;
&lt;div class=&quot;p5&quot;&gt;
@class&lt;/div&gt;
&lt;/td&gt;
&lt;td class=&quot;td5&quot; valign=&quot;middle&quot;&gt;
&lt;div class=&quot;p5&quot;&gt;
@class myClass&lt;/div&gt;
&lt;/td&gt;
&lt;td class=&quot;td6&quot; valign=&quot;middle&quot;&gt;
&lt;div class=&quot;p6&quot;&gt;
The name of the class.&lt;/div&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;td4&quot; valign=&quot;middle&quot;&gt;
&lt;div class=&quot;p5&quot;&gt;
@category&lt;/div&gt;
&lt;/td&gt;
&lt;td class=&quot;td5&quot; valign=&quot;middle&quot;&gt;
&lt;div class=&quot;p5&quot;&gt;
@category myCat(owningClass)&lt;/div&gt;
&lt;/td&gt;
&lt;td class=&quot;td6&quot; valign=&quot;middle&quot;&gt;
&lt;div class=&quot;p6&quot;&gt;
The full name of the category, as declared in the header. For example, “MyClass(MyCategory)”. HeaderDoc uses the “MyClass” portion of the name to identify the associated class.&lt;/div&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;td4&quot; valign=&quot;middle&quot;&gt;
&lt;div class=&quot;p5&quot;&gt;
@protocol&lt;/div&gt;
&lt;/td&gt;
&lt;td class=&quot;td5&quot; valign=&quot;middle&quot;&gt;
&lt;div class=&quot;p5&quot;&gt;
@protocol myProtocol&lt;/div&gt;
&lt;/td&gt;
&lt;td class=&quot;td6&quot; valign=&quot;middle&quot;&gt;
&lt;div class=&quot;p6&quot;&gt;
The name of the protocol.&lt;/div&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;td4&quot; valign=&quot;middle&quot;&gt;
&lt;div class=&quot;p5&quot;&gt;
@const&lt;span class=&quot;s1&quot;&gt;&amp;nbsp;or&amp;nbsp;&lt;/span&gt;@constant&lt;/div&gt;
&lt;/td&gt;
&lt;td class=&quot;td5&quot; valign=&quot;middle&quot;&gt;
&lt;div class=&quot;p6&quot;&gt;
@constant MyConst&lt;/div&gt;
&lt;/td&gt;
&lt;td class=&quot;td6&quot; valign=&quot;middle&quot;&gt;
&lt;div class=&quot;p6&quot;&gt;
Specifies the name of the constant.&lt;/div&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;td4&quot; valign=&quot;middle&quot;&gt;
&lt;div class=&quot;p5&quot;&gt;
@define&lt;/div&gt;
&lt;div class=&quot;p5&quot;&gt;
@defined&lt;/div&gt;
&lt;/td&gt;
&lt;td class=&quot;td5&quot; valign=&quot;middle&quot;&gt;
&lt;div class=&quot;p6&quot;&gt;
@define MyDefine&lt;/div&gt;
&lt;/td&gt;
&lt;td class=&quot;td6&quot; valign=&quot;middle&quot;&gt;
&lt;div class=&quot;p6&quot;&gt;
Name of the macro.&lt;/div&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;td4&quot; valign=&quot;middle&quot;&gt;
&lt;div class=&quot;p5&quot;&gt;
@function&lt;/div&gt;
&lt;/td&gt;
&lt;td class=&quot;td5&quot; valign=&quot;middle&quot;&gt;
&lt;div class=&quot;p5&quot;&gt;
@function myFunc&lt;/div&gt;
&lt;/td&gt;
&lt;td class=&quot;td6&quot; valign=&quot;middle&quot;&gt;
&lt;div class=&quot;p6&quot;&gt;
The name of the function.&lt;/div&gt;
&lt;div class=&quot;p6&quot;&gt;
&lt;b&gt;Note:&amp;nbsp;&lt;/b&gt;For historical reasons, you can also mark up function-like macros with the&amp;nbsp;&lt;span class=&quot;s2&quot;&gt;@function&lt;/span&gt;&amp;nbsp;tag. However, this is not recommended.&lt;/div&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;td4&quot; valign=&quot;middle&quot;&gt;
&lt;div class=&quot;p5&quot;&gt;
@enum&lt;/div&gt;
&lt;/td&gt;
&lt;td class=&quot;td5&quot; valign=&quot;middle&quot;&gt;
&lt;div class=&quot;p5&quot;&gt;
@enum MyEnum&lt;/div&gt;
&lt;/td&gt;
&lt;td class=&quot;td6&quot; valign=&quot;middle&quot;&gt;
&lt;div class=&quot;p6&quot;&gt;
The name of the enumeration. This is usually enum&#39;s tag, if it has one. Otherwise, supply a name you want to have the constants grouped under in the documentation.&lt;/div&gt;
&lt;div class=&quot;p6&quot;&gt;
The member fields should be enumerated with the&lt;span class=&quot;s2&quot;&gt;@constant&lt;/span&gt;&amp;nbsp;tag.&lt;/div&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;td4&quot; valign=&quot;middle&quot;&gt;
&lt;div class=&quot;p5&quot;&gt;
@file&lt;/div&gt;
&lt;/td&gt;
&lt;td class=&quot;td5&quot; valign=&quot;middle&quot;&gt;
&lt;div class=&quot;p5&quot;&gt;
@file Filename&lt;/div&gt;
&lt;div class=&quot;p5&quot;&gt;
Discussion goes here.&lt;/div&gt;
&lt;/td&gt;
&lt;td class=&quot;td6&quot; valign=&quot;middle&quot;&gt;
&lt;div class=&quot;p5&quot;&gt;
&lt;span class=&quot;s1&quot;&gt;See&amp;nbsp;&lt;/span&gt;@header&lt;span class=&quot;s1&quot;&gt;.&lt;/span&gt;&lt;/div&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;td4&quot; valign=&quot;middle&quot;&gt;
&lt;div class=&quot;p5&quot;&gt;
@framework&lt;/div&gt;
&lt;/td&gt;
&lt;td class=&quot;td5&quot; valign=&quot;middle&quot;&gt;
&lt;div class=&quot;p5&quot;&gt;
@framework Kernel Framework&lt;/div&gt;
&lt;/td&gt;
&lt;td class=&quot;td6&quot; valign=&quot;middle&quot;&gt;
&lt;div class=&quot;p6&quot;&gt;
The name of the framework. Must be in a file ending in&amp;nbsp;&lt;span class=&quot;s2&quot;&gt;.hdoc&lt;/span&gt;. This name is inserted as part of the master TOC (landing page) generation process wherever the&lt;span class=&quot;s2&quot;&gt;$$framework@@&lt;/span&gt;&amp;nbsp;tag appears.&lt;/div&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;td4&quot; valign=&quot;middle&quot;&gt;
&lt;div class=&quot;p5&quot;&gt;
@functiongroup&lt;/div&gt;
&lt;/td&gt;
&lt;td class=&quot;td5&quot; valign=&quot;middle&quot;&gt;
&lt;div class=&quot;p6&quot;&gt;
@functiongroup My Function Group&lt;/div&gt;
&lt;/td&gt;
&lt;td class=&quot;td6&quot; valign=&quot;middle&quot;&gt;
&lt;div class=&quot;p6&quot;&gt;
The name of the function group.&lt;/div&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;td4&quot; valign=&quot;middle&quot;&gt;
&lt;div class=&quot;p5&quot;&gt;
@header&lt;/div&gt;
&lt;/td&gt;
&lt;td class=&quot;td5&quot; valign=&quot;middle&quot;&gt;
&lt;div class=&quot;p5&quot;&gt;
@header Repast Manager&lt;/div&gt;
&lt;/td&gt;
&lt;td class=&quot;td6&quot; valign=&quot;middle&quot;&gt;
&lt;div class=&quot;p6&quot;&gt;
The name under which the API is categorized. Leave the name blank to just use the header filename.&lt;/div&gt;
&lt;div class=&quot;p6&quot;&gt;
The following additional subtags are available:&lt;/div&gt;
&lt;ul class=&quot;ul1&quot;&gt;
&lt;li class=&quot;li7&quot;&gt;@CFBundleIdentifier&lt;/li&gt;
&lt;li class=&quot;li7&quot;&gt;@charset&lt;/li&gt;
&lt;li class=&quot;li7&quot;&gt;@compilerflag&lt;/li&gt;
&lt;li class=&quot;li7&quot;&gt;@encoding&lt;/li&gt;
&lt;li class=&quot;li7&quot;&gt;@flag&lt;/li&gt;
&lt;li class=&quot;li7&quot;&gt;@ignore&lt;/li&gt;
&lt;li class=&quot;li7&quot;&gt;@ignorefuncmacro&lt;/li&gt;
&lt;li class=&quot;li7&quot;&gt;@preprocinfo&lt;/li&gt;
&lt;li class=&quot;li7&quot;&gt;@related&lt;/li&gt;
&lt;/ul&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;td4&quot; valign=&quot;middle&quot;&gt;
&lt;div class=&quot;p5&quot;&gt;
@method&lt;/div&gt;
&lt;/td&gt;
&lt;td class=&quot;td5&quot; valign=&quot;middle&quot;&gt;
&lt;div class=&quot;p5&quot;&gt;
@method myMethod:&lt;/div&gt;
&lt;/td&gt;
&lt;td class=&quot;td6&quot; valign=&quot;middle&quot;&gt;
&lt;div class=&quot;p6&quot;&gt;
The name of the Objective-C method.&lt;/div&gt;
&lt;div class=&quot;p6&quot;&gt;
&lt;b&gt;Note:&amp;nbsp;&lt;/b&gt;For historical reasons, you can also mark up C++ methods with the&amp;nbsp;&lt;span class=&quot;s2&quot;&gt;@method&lt;/span&gt;&amp;nbsp;tag. However, this is not recommended.&lt;/div&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;td4&quot; valign=&quot;middle&quot;&gt;
&lt;div class=&quot;p5&quot;&gt;
@property&lt;/div&gt;
&lt;/td&gt;
&lt;td class=&quot;td5&quot; valign=&quot;middle&quot;&gt;
&lt;div class=&quot;p5&quot;&gt;
@property myPropName&lt;/div&gt;
&lt;/td&gt;
&lt;td class=&quot;td6&quot; valign=&quot;middle&quot;&gt;
&lt;div class=&quot;p6&quot;&gt;
The name of the Objective-C property.&lt;/div&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;td4&quot; valign=&quot;middle&quot;&gt;
&lt;div class=&quot;p5&quot;&gt;
@struct&lt;/div&gt;
&lt;/td&gt;
&lt;td class=&quot;td5&quot; valign=&quot;middle&quot;&gt;
&lt;div class=&quot;p5&quot;&gt;
@struct myStruct&lt;/div&gt;
&lt;/td&gt;
&lt;td class=&quot;td6&quot; valign=&quot;middle&quot;&gt;
&lt;div class=&quot;p6&quot;&gt;
The name of the structure. (Also known as the structure’s tag.)&lt;/div&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;td4&quot; valign=&quot;middle&quot;&gt;
&lt;div class=&quot;p5&quot;&gt;
@typedef&lt;/div&gt;
&lt;/td&gt;
&lt;td class=&quot;td5&quot; valign=&quot;middle&quot;&gt;
&lt;div class=&quot;p5&quot;&gt;
@typedef MyType&lt;/div&gt;
&lt;/td&gt;
&lt;td class=&quot;td6&quot; valign=&quot;middle&quot;&gt;
&lt;div class=&quot;p6&quot;&gt;
The name of the defined type.&lt;/div&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;td4&quot; valign=&quot;middle&quot;&gt;
&lt;div class=&quot;p5&quot;&gt;
@union&lt;/div&gt;
&lt;/td&gt;
&lt;td class=&quot;td5&quot; valign=&quot;middle&quot;&gt;
&lt;div class=&quot;p5&quot;&gt;
@union myUnion&lt;/div&gt;
&lt;/td&gt;
&lt;td class=&quot;td6&quot; valign=&quot;middle&quot;&gt;
&lt;div class=&quot;p6&quot;&gt;
The name of the union. (Also known as the union&#39;s tag.)&lt;/div&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td class=&quot;td4&quot; valign=&quot;middle&quot;&gt;
&lt;div class=&quot;p5&quot;&gt;
@var&lt;/div&gt;
&lt;/td&gt;
&lt;td class=&quot;td5&quot; valign=&quot;middle&quot;&gt;
&lt;div class=&quot;p5&quot;&gt;
@var myVariable&lt;/div&gt;
&lt;/td&gt;
&lt;td class=&quot;td6&quot; valign=&quot;middle&quot;&gt;
&lt;div class=&quot;p6&quot;&gt;
The name of a global variable or class member variable.&lt;/div&gt;
&lt;div class=&quot;p8&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://prasadiphonecode.blogspot.com/feeds/5620872807944989702/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://prasadiphonecode.blogspot.com/2012/09/top-level-headerdoc-tags.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7998216469238959870/posts/default/5620872807944989702'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7998216469238959870/posts/default/5620872807944989702'/><link rel='alternate' type='text/html' href='http://prasadiphonecode.blogspot.com/2012/09/top-level-headerdoc-tags.html' title='Top-level HeaderDoc tags'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/01643993695594133107</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7998216469238959870.post-436353828506951285</id><published>2012-09-28T01:47:00.002-07:00</published><updated>2012-09-28T01:47:32.077-07:00</updated><title type='text'>Identical vs isEqual</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;br /&gt;
&lt;h3 class=&quot;post-title entry-title&quot; itemprop=&quot;name&quot; style=&quot;background-color: #c0a154; color: #333333; font-family: Georgia, Utopia, &#39;Palatino Linotype&#39;, Palatino, serif; font-size: 30px; font-weight: normal; margin: 0px; position: relative;&quot;&gt;
Identical vs isEqual&lt;/h3&gt;
&lt;div class=&quot;post-header&quot; style=&quot;background-color: #c0a154; color: #997755; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; line-height: 1.6; margin: 0px 0px 1em;&quot;&gt;
&lt;div class=&quot;post-header-line-1&quot;&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div class=&quot;post-body entry-content&quot; id=&quot;post-body-7042012283143638887&quot; itemprop=&quot;description articleBody&quot; style=&quot;background-color: #c0a154; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 14px; line-height: 1.5; position: relative; width: 768px;&quot;&gt;
&lt;br /&gt;&lt;h2 style=&quot;color: black; font-family: Georgia, Utopia, &#39;Palatino Linotype&#39;, Palatino, serif; font-size: 20px; font-weight: normal; line-height: normal; margin: 0px 0px 0.5em 0cm; position: relative; text-indent: 0cm;&quot;&gt;
&lt;span style=&quot;font-family: &#39;Times New Roman&#39;; font-size: 7pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&lt;/span&gt;Identical vs isEqual&lt;o:p&gt;&lt;/o:p&gt;&lt;/h2&gt;
&lt;table border=&quot;1&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; class=&quot;MsoTableGrid&quot; style=&quot;border-collapse: collapse; border: none;&quot;&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td style=&quot;background-color: #bfbfbf; background-position: initial initial; background-repeat: initial initial; border: 1pt solid black; padding: 0cm 5.4pt; width: 246.4pt;&quot; valign=&quot;top&quot; width=&quot;246&quot;&gt;&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;font-size: 9pt;&quot;&gt;-(BOOL) isEqual: (id) other&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/td&gt;&lt;td style=&quot;background-color: #bfbfbf; background-position: initial initial; background-repeat: initial initial; border: 1pt solid black; padding: 0cm 5.4pt; width: 232.15pt;&quot; valign=&quot;top&quot; width=&quot;232&quot;&gt;&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;font-size: 9pt;&quot;&gt;-(NSUInteger)indexOfObjectIdenticalTo:(id)anObject;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td style=&quot;border: 1pt solid black; padding: 0cm 5.4pt; width: 246.4pt;&quot; valign=&quot;top&quot; width=&quot;246&quot;&gt;&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;font-size: 9pt;&quot;&gt;if isEqual is overrided from the original NSObject simple implementation, usally isEqual means they have the same componets one by one example two strings are isEqual if they have the same letters in the same order.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/td&gt;&lt;td style=&quot;border-bottom-color: black; border-bottom-width: 1pt; border-right-color: black; border-right-width: 1pt; border-style: none solid solid none; padding: 0cm 5.4pt; width: 232.15pt;&quot; valign=&quot;top&quot; width=&quot;232&quot;&gt;&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;font-size: 9pt;&quot;&gt;Same pointers “== an Object”&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;font-size: 9pt;&quot;&gt;Example two strings are Identical if they contain the exact same address.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;div style=&quot;clear: both;&quot;&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div class=&quot;post-footer&quot; style=&quot;background-color: #c0a154; border-top-color: rgb(119, 119, 119); border-top-style: dashed; border-top-width: 1px; color: #997755; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; line-height: 1.6; margin: 10px 0px 0px; padding: 10px 0px 0px;&quot;&gt;
&lt;/div&gt;
&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://prasadiphonecode.blogspot.com/feeds/436353828506951285/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://prasadiphonecode.blogspot.com/2012/09/identical-vs-isequal.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7998216469238959870/posts/default/436353828506951285'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7998216469238959870/posts/default/436353828506951285'/><link rel='alternate' type='text/html' href='http://prasadiphonecode.blogspot.com/2012/09/identical-vs-isequal.html' title='Identical vs isEqual'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/01643993695594133107</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7998216469238959870.post-6775248910229567975</id><published>2012-09-28T01:46:00.000-07:00</published><updated>2012-09-28T01:46:18.453-07:00</updated><title type='text'>Why to use pointers?</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;







&lt;div class=&quot;p1&quot;&gt;
char *startOfASeriesOfChars ;&lt;br /&gt;
&lt;br /&gt;
Imagine a very long string like the above.&lt;br /&gt;
Is not always possible to pass a copy of your data (above)&lt;br /&gt;
but you can always pass the address of where that data begins.&lt;br /&gt;
&lt;br /&gt;
Same reason is, why the object in objective C are pointers.&lt;br /&gt;
How easy is to pass a big object as argument?&lt;br /&gt;
Obviously is easy if it&#39;s a pointer.&lt;br /&gt;
&lt;br /&gt;
Pointers are also called references.&lt;br /&gt;
Thus, using the pointer to read data at the address is sometimes called dereferencing pointer.&lt;br /&gt;
&lt;br /&gt;
Warning:&lt;br /&gt;
float *c, *d; // is the correct&lt;br /&gt;
float* c, b; // c is pointer to a float, b is float!!&lt;/div&gt;
&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://prasadiphonecode.blogspot.com/feeds/6775248910229567975/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://prasadiphonecode.blogspot.com/2012/09/why-to-use-pointers.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7998216469238959870/posts/default/6775248910229567975'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7998216469238959870/posts/default/6775248910229567975'/><link rel='alternate' type='text/html' href='http://prasadiphonecode.blogspot.com/2012/09/why-to-use-pointers.html' title='Why to use pointers?'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/01643993695594133107</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7998216469238959870.post-3066702767327344059</id><published>2012-09-28T01:27:00.002-07:00</published><updated>2012-09-28T01:27:51.904-07:00</updated><title type='text'>iPhone Development Flow chart.</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;br /&gt;
&lt;h3 class=&quot;post-title entry-title&quot; itemprop=&quot;name&quot; style=&quot;background-color: white; color: #29aae1; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 18px; margin: 0px; position: relative;&quot;&gt;
iPhone Development Flow chart.&lt;/h3&gt;
&lt;div class=&quot;post-header&quot; style=&quot;background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; line-height: 1.6; margin: 0px 0px 1em;&quot;&gt;
&lt;div class=&quot;post-header-line-1&quot;&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div class=&quot;post-body entry-content&quot; id=&quot;post-body-8238193474936691258&quot; itemprop=&quot;description articleBody&quot; style=&quot;background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; line-height: 18px; position: relative; width: 586px;&quot;&gt;
&lt;a href=&quot;http://cubiclemuses.com/page_attachments/0000/0019/iPhone-development-flowchart.png&quot; style=&quot;color: #015782; text-decoration: none;&quot;&gt;&lt;img alt=&quot;&quot; border=&quot;0&quot; src=&quot;http://cubiclemuses.com/page_attachments/0000/0019/iPhone-development-flowchart.png&quot; style=&quot;-webkit-box-shadow: rgba(0, 0, 0, 0.2) 0px 0px 20px; border-bottom-left-radius: 0px; border-bottom-right-radius: 0px; border-top-left-radius: 0px; border-top-right-radius: 0px; border: 1px solid rgb(204, 204, 204); box-shadow: rgba(0, 0, 0, 0.2) 0px 0px 20px; cursor: pointer; display: block; height: 1200px; margin: 0px auto 10px; padding: 8px; position: relative; text-align: center; width: 500px;&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://prasadiphonecode.blogspot.com/feeds/3066702767327344059/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://prasadiphonecode.blogspot.com/2012/09/iphone-development-flow-chart.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7998216469238959870/posts/default/3066702767327344059'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7998216469238959870/posts/default/3066702767327344059'/><link rel='alternate' type='text/html' href='http://prasadiphonecode.blogspot.com/2012/09/iphone-development-flow-chart.html' title='iPhone Development Flow chart.'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/01643993695594133107</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7998216469238959870.post-21426967368528749</id><published>2012-09-28T01:26:00.002-07:00</published><updated>2012-09-28T01:26:51.349-07:00</updated><title type='text'>Recording a voice audio in iPhone</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;br /&gt;
&lt;h3 class=&quot;post-title entry-title&quot; itemprop=&quot;name&quot; style=&quot;background-color: white; color: #29aae1; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 18px; margin: 0px; position: relative;&quot;&gt;
Recording a voice audio in iPhone&lt;/h3&gt;
&lt;div class=&quot;post-header&quot; style=&quot;background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; line-height: 1.6; margin: 0px 0px 1em;&quot;&gt;
&lt;div class=&quot;post-header-line-1&quot;&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div class=&quot;post-body entry-content&quot; id=&quot;post-body-2094350269962666674&quot; itemprop=&quot;description articleBody&quot; style=&quot;background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; line-height: 18px; position: relative; width: 586px;&quot;&gt;
This&amp;nbsp;&lt;a href=&quot;http://www.iwillapps.com/wordpress/?p=32&quot; style=&quot;color: #015782; text-decoration: none;&quot;&gt;tutorial&amp;nbsp;&lt;/a&gt;explains how to record a voice in iPhone.&lt;br /&gt;&lt;br /&gt;There are multiple ways to record audio on the iPhone, but some are suited to tasks better than others. I&#39;m going to show you a simple way to record audio into a file and get its power level (volume if you will). This tutorial makes use of the AudioToolbox framework which you must add to your project to get this code working. Firstly I highly recommend you make your own AudioRecorder class to deal with the low level recording, that way you can just port your class from project to project with little hassle, and save time writing your own code. Firstly create a header file like so:&lt;br /&gt;&lt;br /&gt;#import&amp;nbsp;&lt;foundation foundation.h=&quot;&quot;&gt;&lt;br /&gt;#import&amp;nbsp;&lt;audiotoolbox audiotoolbox.h=&quot;&quot;&gt;&lt;br /&gt;#import&amp;nbsp;&lt;audiotoolbox audiofile.h=&quot;&quot;&gt;&lt;br /&gt;&lt;br /&gt;@interface AudioRecorder : NSObject&lt;br /&gt;{&lt;br /&gt;AudioStreamBasicDescription dataFormat;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;-(id) init;&lt;br /&gt;&lt;br /&gt;@end&lt;br /&gt;&lt;br /&gt;This adds a description of your audio stream to your class, now you will want to write your initialisation code in your main file, this is where we will fill the dataFormat instance variable.&lt;br /&gt;&lt;br /&gt;-(id) init&lt;br /&gt;{&lt;br /&gt;dataFormat.mSampleRate = 44100.0f;&lt;br /&gt;dataFormat.mFormatID = kAudioFormatLinearPCM;&lt;br /&gt;dataFormat.mFramesPerPacket = 1;&lt;br /&gt;dataFormat.mChannelsPerFrame = 1;&lt;br /&gt;dataFormat.mBytesPerFrame = 2;&lt;br /&gt;dataFormat.mBytesPerPacket = 2;&lt;br /&gt;dataFormat.mBitsPerChannel = 16;&lt;br /&gt;dataFormat.mReserved = 0;&lt;br /&gt;dataFormat.mFormatFlags = kLinearPCMFormatFlagIsBigEndian | kLinearPCMFormatFlagIsSignedInteger | kLinearPCMFormatFlagIsPacked;&lt;br /&gt;return self;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;Basically what this code is saying is that we want a mono recording (mChannelsPerFrame) at a sample rate of 44.1kHz (mSampleRate) using SInt16&#39;s (mBytesPerFrame and kLinearPCMFormatFlagIsSignedInteger) and that we are recording in Linear PCM (pretty standard). So now that we have sorted those parameters out, we need to add the Audio Queue and the Input Callback, this means not only another instance variable in our header, but also a function that is outside the scope of the class, however by cleverly inputting the right data we can make it work for multiple instances of the class.&lt;br /&gt;&lt;br /&gt;@interface AudioRecorder : NSObject&lt;br /&gt;{&lt;br /&gt;AudioStreamBasicDescription dataFormat;&lt;br /&gt;AudioQueueRef queue;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;@property AudioQueueRef queue;&lt;br /&gt;&lt;br /&gt;// Our new C callback&lt;br /&gt;void AudioInputCallback(void* inUserData,AudioQueueRef inAQ,AudioQueueBufferRef inBuffer,const AudioTimeStamp *inStartTime,UInt32 inNumberPacketDescriptions,const AudioStreamPacketDescription *inPacketDescs)&lt;br /&gt;{&lt;br /&gt;}&lt;br /&gt;// Declaring the get/set of our new public variable&lt;br /&gt;@synthesize queue;&lt;br /&gt;// Add this code to the init function&lt;br /&gt;if(AudioQueueNewInput(&amp;amp;dataFormat,AudioInputCallback,self,CFRunLoopGetCurrent(),kCFRunLoopCommonModes,0,&amp;amp;queue) == noErr)&lt;br /&gt;{&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;So this declares the queue variable public, adds our AudioInputCallback C function, and inputs data into our audio queue. Next we have to deal with our audio buffers:&lt;br /&gt;&lt;br /&gt;// Add this variable to our interface&lt;br /&gt;AudioQueueBufferRef buffers[3];&lt;br /&gt;&lt;br /&gt;// Add this code into our init function&lt;br /&gt;for(int i=0;i&lt;3 br=&quot;br&quot; i=&quot;i&quot;&gt;{&lt;br /&gt;AudioQueueAllocateBuffer(queue,(dataFormat.mSampleRate/10.0f)*dataFormat.mBytesPerFrame,&amp;amp;buffers[i]);&lt;br /&gt;AudioQueueEnqueueBuffer(queue,buffers[i],0,nil);&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;This allocates our buffers with the right amount of space, and then Enqueue&#39;s them to await our audio recording input. Next we will kick start the process by using the AudioQueueStart function.&lt;br /&gt;&lt;br /&gt;AudioQueueStart(queue, NULL);&lt;br /&gt;&lt;br /&gt;Now we have a functioning audio recording code, you will notice if you put logs into AudioInputCallback, you will see it gets called every so often (ie when the buffers will up), however in the callback we will need to handle the continued Enqueue of our buffers defined in the interface, so we will need to add this into the AudioInputCallback function:&lt;br /&gt;&lt;br /&gt;AudioRecorder* recorder = (AudioRecorder*) inUserData;&lt;br /&gt;AudioQueueEnqueueBuffer(recorder.queue,inBuffer,0,nil);&lt;br /&gt;&lt;br /&gt;Now what this does is grabs our AudioRecorder class from the inUserData, then uses the queue defined in that class to enqueue the next buffer for getting more audio. Now we are functioning, but what about writing the recorded audio data to a file or getting the power of an audio recording? Well that&#39;s coming here, first I&#39;ll focus on the power level (because it&#39;s much easier than writing file data):&lt;br /&gt;&lt;br /&gt;// Define these functions in the interface&lt;br /&gt;-(float) getPeakPower;&lt;br /&gt;-(float) getAveragePower;&lt;br /&gt;&lt;br /&gt;// At the end of init&lt;br /&gt;UInt32 enabledLevelMeter = true;&lt;br /&gt;AudioQueueSetProperty(queue,kAudioQueueProperty_EnableLevelMetering,&amp;amp;enabledLevelMeter,sizeof(UInt32));&lt;br /&gt;// New functions&lt;br /&gt;-(float) getPeakPower&lt;br /&gt;{&lt;br /&gt;AudioQueueLevelMeterState levelMeter;&lt;br /&gt;UInt32 levelMeterSize = sizeof(AudioQueueLevelMeterState);&lt;br /&gt;AudioQueueGetProperty(queue,kAudioQueueProperty_CurrentLevelMeterDB,&amp;amp;levelMeter,&amp;amp;levelMeterSize);&lt;br /&gt;return levelMeter.mPeakPower;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;-(float) getAveragePower&lt;br /&gt;{&lt;br /&gt;AudioQueueLevelMeterState levelMeter;&lt;br /&gt;UInt32 levelMeterSize = sizeof(AudioQueueLevelMeterState);&lt;br /&gt;AudioQueueGetProperty(queue,kAudioQueueProperty_CurrentLevelMeterDB,&amp;amp;levelMeter,&amp;amp;levelMeterSize);&lt;br /&gt;return levelMeter.mAveragePower;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;Now you can simply call getPeakPower or getAveragePower to obtain the average or peak power of the audio being recorded in decibels. Now I usually gauge power by dividing the Average Power by -80.0, because I use that as a ceiling, and yes I am well aware volume can get up to 120dB in power, but for most purposes a ceiling of 80dB is fine. Now for the complex stuff, file writing. What we are going to do is add a specific function to our class that allows us to define a file to write to, and some functions that tell us whether we are recording to a file or not as well as allowing us to stop the file recording.&lt;br /&gt;&lt;br /&gt;// New interface variables&lt;br /&gt;AudioFileID audioFile;&lt;br /&gt;bool fileRecording;&lt;br /&gt;SInt64 currentPacket;&lt;br /&gt;NSString* recordFile;&lt;br /&gt;// Functions to add to our class&lt;br /&gt;-(bool) isRecording;&lt;br /&gt;-(bool) record:(NSString*)filename;&lt;br /&gt;-(void) stopRecording;&lt;br /&gt;&lt;br /&gt;-(bool) isRecording&lt;br /&gt;{&lt;br /&gt;return fileRecording;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;-(bool) record:(NSString*)file&lt;br /&gt;{&lt;br /&gt;char cfile[256];&lt;br /&gt;[file getCString:cfile maxLength:sizeof(cfile) encoding:NSUTF8StringEncoding];&lt;br /&gt;CFURLRef fileURL = CFURLCreateFromFileSystemRepresentation(NULL,(UInt8*)cfile,strlen(cfile),false);&lt;br /&gt;OSStatus result = AudioFileCreateWithURL(fileURL,kAudioFileAIFFType,&amp;amp;dataFormat,kAudioFileFlags_EraseFile,&amp;amp;audioFile);&lt;br /&gt;if(result != noErr)&lt;br /&gt;fileRecording = false;&lt;br /&gt;else fileRecording = true;&lt;br /&gt;if(fileRecording)&lt;br /&gt;recordFile = file;&lt;br /&gt;return fileRecording;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;-(void) stopRecording&lt;br /&gt;{&lt;br /&gt;fileRecording = false;&lt;br /&gt;AudioFileClose(audioFile);&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;Now there&#39;s a lot of code here, so I&#39;ll try to explain it. The isRecording function basically informs other classes on whether we are currently recording, the record function is where our imagine happens. It uses AudioFileCreateWithURL to create an audio file header based on our format definition in the earlier part of this tutorial, the rest of that function is basically setting the recording fileRecording variable and changing the NSString to a CFURLRef type. The stop recording function is also very self explanatory, it just closes the audio file and shutdowns the fileRecording variable. But we still aren&#39;t using the AudioInputCallback to record! Well that&#39;s the last piece of the puzzle:&lt;br /&gt;&lt;br /&gt;// Add these properties to the interface&lt;br /&gt;@property AudioFileID audioFile;&lt;br /&gt;@property bool fileRecording;&lt;br /&gt;@property SInt64 currentPacket;&lt;br /&gt;&lt;br /&gt;// Add this code to AudioInputCallback&lt;br /&gt;if(recorder.fileRecording)&lt;br /&gt;{&lt;br /&gt;AudioFileWritePackets(recorder.audioFile,false,inBuffer-&amp;gt;mAudioDataByteSize,inPacketDescs,recorder.currentPacket,&amp;amp;inNumberPacketDescriptions,inBuffer-&amp;gt;mAudioData);&lt;br /&gt;recorder.currentPacket += inNumberPacketDescriptions;&lt;br /&gt;}&lt;br /&gt;// Synthesize these variables&lt;br /&gt;@synthesize audioFile,fileRecording,currentPacket;&lt;br /&gt;&lt;br /&gt;Now here we basically make the fileRecording, audioFile and currentPacket variable public, so we can use them in the AudioInputCallback, then we write the audio packets to our file. It&#39;s as simple as that.&lt;/3&gt;&lt;/audiotoolbox&gt;&lt;/audiotoolbox&gt;&lt;/foundation&gt;&lt;/div&gt;
&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://prasadiphonecode.blogspot.com/feeds/21426967368528749/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://prasadiphonecode.blogspot.com/2012/09/recording-voice-audio-in-iphone.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7998216469238959870/posts/default/21426967368528749'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7998216469238959870/posts/default/21426967368528749'/><link rel='alternate' type='text/html' href='http://prasadiphonecode.blogspot.com/2012/09/recording-voice-audio-in-iphone.html' title='Recording a voice audio in iPhone'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/01643993695594133107</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7998216469238959870.post-2229913193102345728</id><published>2012-09-28T01:24:00.001-07:00</published><updated>2012-09-28T01:24:47.172-07:00</updated><title type='text'>Different kinds of file Parsing in iPhone</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;br /&gt;
&lt;h3 class=&quot;post-title entry-title&quot; itemprop=&quot;name&quot; style=&quot;background-color: white; color: #29aae1; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 18px; margin: 0px; position: relative;&quot;&gt;
Different kinds of file Parsing in iPhone&lt;/h3&gt;
&lt;div class=&quot;post-header&quot; style=&quot;background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; line-height: 1.6; margin: 0px 0px 1em;&quot;&gt;
&lt;div class=&quot;post-header-line-1&quot;&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div class=&quot;post-body entry-content&quot; id=&quot;post-body-3550227461093235969&quot; itemprop=&quot;description articleBody&quot; style=&quot;background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; line-height: 18px; position: relative; width: 586px;&quot;&gt;
1)HTML File Parsing&lt;br /&gt;&lt;br /&gt;&lt;a href=&quot;http://blog.objectgraph.com/index.php/2010/02/24/parsing-html-iphone-development/&quot; style=&quot;color: #015782; text-decoration: none;&quot;&gt;Example-1&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href=&quot;http://www.dimzzy.com/blog/2009/10/hyperparser-tolerant-html-parser/&quot; style=&quot;color: #015782; text-decoration: none;&quot;&gt;Example-2&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;2)XML File Parsing&lt;br /&gt;&lt;br /&gt;&lt;a href=&quot;http://cid-b1af21619e6fb207.spaces.live.com/blog/cns!B1AF21619E6FB207!434.entry&quot; style=&quot;color: #015782; text-decoration: none;&quot;&gt;Example-1&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href=&quot;http://cocoawithlove.com/2008/10/using-libxml2-for-parsing-and-xpath.html&quot; style=&quot;color: #015782; text-decoration: none;&quot;&gt;Example-2&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href=&quot;http://www.w3schools.com/xpath/xpath_intro.asp&quot; style=&quot;color: #015782; text-decoration: none;&quot;&gt;Knowledge of XPath&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Following&amp;nbsp;&lt;a href=&quot;http://www.cnblogs.com/tracy-e/archive/2010/08/29/1812075.html&quot; style=&quot;color: #015782; text-decoration: none;&quot;&gt;Tutorial&lt;/a&gt;&amp;nbsp;Describes two common XML parsing mode (NSXMLParser &amp;amp; GDataXMLNode)&lt;br /&gt;&lt;br /&gt;Commonly used analytical XML are two ways, they are based on a different API :&lt;br /&gt;1.Tree-based API : The API approach is to XML as a tree structure, then the various parts of the tree as an object to handle, this is what we mean DOM (Document Object Model) approach. In the iPhone &#39;s SDK contains a libxml2 framework (Framework) will be able to DOM parsing mode.Google &#39;s GDataXML is also based on libxml2 , and therefore the use of GDataXML , you need to first import libxml2 .&lt;br /&gt;&lt;br /&gt;2.Event-driven API: This is often used to resolve event-based, SAX parsing mode is representative of this analytical method. In the iPhone developed in this way can also be used to parse XML , but this is not Iphone SDK attributes ah, but Objective-C functions. In Objectvie-C species have special parsing XML class NSXMLParser .&lt;br /&gt;&lt;br /&gt;NSXMLParser and CGataXML to use:&lt;br /&gt;&lt;br /&gt;1. NSXMLParser analytical method&lt;br /&gt;NSXMLParser parsing XML in the main work is relied on the agent (NSXMLParserDelegate) to achieve.&lt;br /&gt;&lt;br /&gt;- ( void ) {viewDidLoad&lt;br /&gt;[ Super viewDidLoad ];&lt;br /&gt;//........&lt;br /&gt;NSXMLParser * Parser = [[ NSXMLParser alloc ] initWithContentsOfURL : [ NSURL URLWithString : @ &quot; http://lab.xxxxxx.com/xxx/xxx.xml &quot; ]];&lt;br /&gt;[Parser setDelegate : self ];&lt;br /&gt;[Parser parse ];&lt;br /&gt;&lt;br /&gt;for ( int i = 0 ; i &amp;lt;[ newsArray count ]; i + +) {&lt;br /&gt;NSLog ( &quot;%@&quot; , [ newsArray objectAtIndex : i]);&lt;br /&gt;}&lt;br /&gt;}&lt;br /&gt;To so few, they begin to resolve, and how to get XML data inside it?&lt;br /&gt;Then go to agents to find it inside!&lt;br /&gt;# Pragma mark NSMXLParser Delegate Methods&lt;br /&gt;- ( void ) Parser: ( NSXMLParser *) Parser didStartElement: ( NSString *) elementName&lt;br /&gt;namespaceURI: ( NSString *) namespaceURI QualifiedName: ( NSString *) qName attributes: ( NSDictionary *) attributeDict {&lt;br /&gt;if ([elementName isEqualToString : @ &quot;DocTitle&quot; ]) {&lt;br /&gt;if (! newsArray ) {&lt;br /&gt;newsArray = [[ NSMutableArray alloc ] init ];&lt;br /&gt;return ;&lt;br /&gt;}&lt;br /&gt;}&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;- ( void ) Parser: ( NSXMLParser *) Parser foundCharacters: ( NSString *) {String&lt;br /&gt;if (! currentString ) {&lt;br /&gt;currentString = [[ NSMutableString alloc ] init ];&lt;br /&gt;}&lt;br /&gt;[ currentString appendString : String];&lt;br /&gt;[ currentString setString : [ currentString stringByTrimmingCharactersInSet : [ NSCharacterSet whitespaceAndNewlineCharacterSet ]]];&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;- ( void ) Parser: ( NSXMLParser *) Parser didEndElement: ( NSString *) elementName&lt;br /&gt;namespaceURI: ( NSString *) namespaceURI QualifiedName: ( NSString *) qName {&lt;br /&gt;if ([elementName isEqualToString : @ &quot;DocTitle&quot; ]) {&lt;br /&gt;[ newsArray addObject : currentString ];&lt;br /&gt;}&lt;br /&gt;[ currentString Release ];&lt;br /&gt;currentString = nil ;&lt;br /&gt;}&lt;br /&gt;Let me talk about the process to run, when the parser to initialize and run parse statement ([Parser parse ]), the program will jump to the first proxy agent approach which way to go. Method will be the first agent xml traverse again, and identify xml element name inside (elementName) , I&#39;m looking at the information found (docTitle) , create an array to store the information, and of course not the first agent begin storing information.&lt;br /&gt;The next will take a second agent, it will the first phase we are looking for agent information is stored in currentString in. Which I added a deal on access to the string statement [ currentString setString : [ currentString stringByTrimmingCharactersInSet : [ NSCharacterSet whitespaceAndNewlineCharacterSet ]]] , it can start the string with spaces and line breaks removed (as often encountered xml file format not standard).&lt;br /&gt;Finally, the third proxy methods to access the information stored in our array.&lt;br /&gt;Of course, this three-step program is running in the order of execution is not so strict, and the execution will be repeated, but generally the process is this.&lt;br /&gt;&lt;br /&gt;1. DOM parsing method of GDataXMLNode&lt;br /&gt;GDataXMLNode is based on libxml2 the third-party documents, more powerful features.&lt;br /&gt;NSError * Error = nil ;&lt;br /&gt;NSString * documentStr = [[ NSString alloc ] initWithContentsOfURL : [ NSURL URLWithString : @ &quot;http://www.xxxx.com/x/xxx.xml&quot; ] encoding : NSUTF8StringEncoding Error : &amp;amp; Error];&lt;br /&gt;GDataXMLDocument * XMLDocument = [[ GDataXMLDocument alloc ] initWithXMLString : documentStr Options : 0 Error : &amp;amp; Error];&lt;br /&gt;[DocumentStr Release ];&lt;br /&gt;GDataXMLElement * rootElement = [XMLDocument rootElement ];&lt;br /&gt;NSArray * newsArray = [rootElement elementsForName : @ &quot;DocTitle&quot; ];&lt;br /&gt;for ( int i = 0 ; i &amp;lt;[newsArray count ]; i + +) {&lt;br /&gt;NSLog ( &quot;%@&quot; , [[newsArray objectAtIndex : i] stringValue ]);&lt;br /&gt;}&lt;br /&gt;To so few, features, and above NSXMLParser , of course, is stored in the array GDataXMLElement objects rather than strings.&lt;br /&gt;In the DOM parsing mode, the first XML file into an object or link, here is GDataXMLDocument object, and then each part of the object which is seen as an object, such as rootElement a GDataXMLElement object, which is the XML root of the tree , including the XML of all information. We directly rootElement look under the name: DocTitle the object, put it inside the array (because such objects may be more than one). We want to take docTitle object inside the contents of the&lt;doctitle&gt;Hello iPhone&amp;nbsp;, the object stringValue is.&lt;/doctitle&gt;&lt;/div&gt;
&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://prasadiphonecode.blogspot.com/feeds/2229913193102345728/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://prasadiphonecode.blogspot.com/2012/09/different-kinds-of-file-parsing-in.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7998216469238959870/posts/default/2229913193102345728'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7998216469238959870/posts/default/2229913193102345728'/><link rel='alternate' type='text/html' href='http://prasadiphonecode.blogspot.com/2012/09/different-kinds-of-file-parsing-in.html' title='Different kinds of file Parsing in iPhone'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/01643993695594133107</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7998216469238959870.post-3649001159704755683</id><published>2012-09-28T01:23:00.002-07:00</published><updated>2012-09-28T01:23:39.616-07:00</updated><title type='text'>@property(nonatomic, retain) ?</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;br /&gt;
&lt;h3 class=&quot;post-title entry-title&quot; itemprop=&quot;name&quot; style=&quot;background-color: white; color: #29aae1; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 18px; margin: 0px; position: relative;&quot;&gt;
@property(nonatomic, retain) ?&lt;/h3&gt;
&lt;div class=&quot;post-header&quot; style=&quot;background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; line-height: 1.6; margin: 0px 0px 1em;&quot;&gt;
&lt;div class=&quot;post-header-line-1&quot;&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div class=&quot;post-body entry-content&quot; id=&quot;post-body-6452365869637764495&quot; itemprop=&quot;description articleBody&quot; style=&quot;background-color: white; color: #333333; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; line-height: 18px; position: relative; width: 586px;&quot;&gt;
By default, property accessors are atomic. Also there is no &quot;atomic&quot; keyword, if you do not specify &quot;nonatomic&quot; then the property is atomic, but specifying &quot;atomic&quot; explicitly will result in an error.&lt;br /&gt;&lt;br /&gt;So if any one write&lt;br /&gt;&lt;br /&gt;@property(atomic, retain) UITextField *userName;&lt;br /&gt;or&lt;br /&gt;@property(retain) UITextField *userName;&lt;br /&gt;&lt;br /&gt;They mean the same thing.&lt;br /&gt;&lt;br /&gt;So an Atomic accessors in a non garbage collected environment (i.e. when using retain/release/autorelease) will use a lock to ensure that another thread doesn&#39;t interfere with the correct setting/getting of the value.&lt;br /&gt;&lt;br /&gt;With atomic, the synthesized setter/getter will ensure that a whole value is always returned from the getter or set by the setter, regardless of setter activity on any other thread. That is, if thread A is in the middle of the getter while thread B calls the setter, an actual viable value -- an autoreleased object, most likely -- will be returned to the caller in A.&lt;br /&gt;&lt;br /&gt;In nonatomic, no such guarantees are made. Thus, nonatomic is considerably faster than atomic.&lt;br /&gt;&lt;br /&gt;What atomic does not do is make any guarantees about thread safety. If thread A is calling the getter simultaneously with thread B and C calling the setter with different values, thread A may get any one of the three values returned -- the one prior to any setters being called or either of the values passed into the setters in B and C. Likewise, the object may end up with the value from B or C, no way to tell.&lt;/div&gt;
&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://prasadiphonecode.blogspot.com/feeds/3649001159704755683/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://prasadiphonecode.blogspot.com/2012/09/propertynonatomic-retain.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7998216469238959870/posts/default/3649001159704755683'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7998216469238959870/posts/default/3649001159704755683'/><link rel='alternate' type='text/html' href='http://prasadiphonecode.blogspot.com/2012/09/propertynonatomic-retain.html' title='@property(nonatomic, retain) ?'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/01643993695594133107</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry></feed>