<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:georss='http://www.georss.org/georss' xmlns:gd='http://schemas.google.com/g/2005' xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-8547759854250510773</id><updated>2012-02-16T01:44:24.893-08:00</updated><title type='text'>iPhone Power Coding</title><subtitle type='html'>In this blog I will be discussing some very power full techniques in objective-C. I have been writing some unconventional stuffs for newbies on iPhone development here http://www.ved-dimensions.blogspot.com.
Unlikely for this blog I am assuming that the reader should have considerable amount of expertise to fully appreciate it.</subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://iphonepowercoding.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8547759854250510773/posts/default?max-results=100'/><link rel='alternate' type='text/html' href='http://iphonepowercoding.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>Ved Surtani</name><uri>http://www.blogger.com/profile/09714144214521232179</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>1</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>100</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-8547759854250510773.post-8660826412879686807</id><published>2009-02-16T12:27:00.000-08:00</published><updated>2009-02-16T13:22:27.091-08:00</updated><title type='text'>iPhone Development: A Self Directed Aproach</title><content type='html'>A few days back I saw a question on a forum saying "how do we send  request to a http server from iPhone?". I instantly replied with an example which will send and process HTTP GET response from a server. I left a note at the end saying you can now read the documentation to do the rest. Guess what, the next question was "I have an xml how do I send it to server?".&lt;br /&gt;All those who have been following forums for technical trouble shooting must agree with me that most of the questions asked these days are purely fixable if you go through the software documentation. But unfortunately many people are unaware of the benefits of making it a habit instead they prefer asking for the complete code which should do their job.&lt;br /&gt;Let me assure you, once you develop a taste for reading documentation for everything you don't know, it will be a million times easy to solve problems. After all you don't have to wait for some1 to reply, besides you never know how bad practices get inherited from some stranger.&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Here I am going to discuss some tips &amp;amp; tricks which will make your job much easier&lt;/span&gt;.&lt;br /&gt;`&lt;br /&gt;Lets start with a question. You are making a &lt;span style="font-style: italic;"&gt;UITableView&lt;/span&gt; and you want that each cell has a disclosure indicator at the right side. You are doing this for the first time and you don't know that you have set the &lt;span style="font-style: italic;"&gt;accessoryType &lt;/span&gt;variable to &lt;span style="font-style: italic;"&gt;UITableViewCellAccessoryDisclosureIndicator&lt;/span&gt;. What will you do? There can be two approaches:&lt;br /&gt;&lt;ol&gt;&lt;li&gt;Type some keywords on google and look through 3-4 links and you will find the solution.&lt;/li&gt;&lt;li&gt;Refer the documentation.&lt;/li&gt;&lt;/ol&gt;But who wants to scan the crowded header files for the solution, when option 1 is just a 5-10 minutes job. I will tell you how you can do the job in less than 5 seconds.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Tip#1&lt;span style="font-weight: bold;"&gt;&lt;span style="font-weight: bold;"&gt;&lt;span style="font-weight: bold;"&gt;&lt;br /&gt;&lt;span style="font-weight: bold; color: rgb(255, 0, 0);"&gt;I&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="color: rgb(255, 0, 0); font-weight: bold;"&gt;n your code, type&lt;/span&gt; &lt;span style="color: rgb(0, 102, 0); font-weight: bold; font-style: italic;"&gt;&lt;span style="font-size:85%;"&gt;[cell setAccessoryType:&lt;/span&gt;]&lt;/span&gt; &lt;span style="color: rgb(255, 0, 0); font-weight: bold;"&gt;and press [Esc]&lt;/span&gt;. Yes here you will be able to see all the available types of Accessory types. Please note that you should place the cursor after the colon (:) and then press [Esc]. Now you see! In less then 5 seconds you not only found you solution but you also learnt about other types of CellAccessories.&lt;span style="font-weight: bold;"&gt;&lt;span style="font-weight: bold;"&gt;&lt;span style="font-weight: bold;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-weight: bold;"&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-weight: bold;"&gt;&lt;span style="font-weight: bold;"&gt;&lt;span style="font-weight: bold;"&gt;&lt;/span&gt;S&lt;/span&gt;&lt;/span&gt;imilarly you can do anything you don't know. For example you want to create a &lt;span style="font-style: italic;"&gt;UIActivityIndicator&lt;/span&gt;. All you have to do is type:&lt;br /&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="font-style: italic; color: rgb(0, 102, 0); font-weight: bold;"&gt;UIActivityIndicator *spinner = [[UIActivityIndicator alloc] ]&lt;/span&gt;&lt;/span&gt; and press [esc]. All the options of init will be listed in the IDE. Now you want to start the spinner, then type &lt;span style="font-weight: bold; color: rgb(0, 102, 0); font-style: italic;"&gt;[spinner ]&lt;/span&gt; and [ress escape. All the methods will be listed and among them one will be &lt;span style="font-weight: bold; font-style: italic; color: rgb(0, 102, 0);"&gt;startAnimation&lt;/span&gt;. Easy na? Besides you also got to know that there is one &lt;span style="font-weight: bold; font-style: italic; color: rgb(0, 102, 0);"&gt;stopAnimation&lt;/span&gt; method also. Just keep one thing in mind that you have to keep your cursor inside the rectangular brackets.&lt;br /&gt;`&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Tip#2&lt;/span&gt;&lt;br /&gt;Let us now assume that you didn't even know if there is something called accessoryType in previous case but you have seen some where that cells can have different indicators on the right side. Now you don't have an option but to search google for the code or open the header files of UITableViewCell. Here I will tell you how you can quickly browse through the class references and header files. &lt;span style="font-weight: bold; color: rgb(255, 0, 0);"&gt;To open the reference window you can use the shortcut [ctrl]+[window]+[shift]+[?]. A window will open up. Now in the xCode if type UITableViewCell, the refrence window will automatically open heade file, class reference and guide&lt;/span&gt;.  The refrence is very well structured in terms of tasks. So all you have to do is select a task and see the methods. Alternatively you can look at the header files for Declared Variables and structures, from there you will get instant access to what you want.&lt;br /&gt;`&lt;br /&gt;Although google remains the most popular source for code references, referring documentation saves a lot of time besides adding to your knowledge more than what you intended to.&lt;br /&gt;Still it's a question open for debate, comments and suggestions will be highly appreciated.&lt;br /&gt;`&lt;br /&gt;In the next few posts I am going to discuss Introspection which is really a power full technique in objective c. You ever faced a problem writing loong parsers for every web service you implemented? I will tell you how you can write an xml parser in just TEN lines of code!&lt;br /&gt;&lt;br /&gt;`&lt;br /&gt;`&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8547759854250510773-8660826412879686807?l=iphonepowercoding.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://iphonepowercoding.blogspot.com/feeds/8660826412879686807/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://iphonepowercoding.blogspot.com/2009/02/iphone-development-self-directed.html#comment-form' title='41 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8547759854250510773/posts/default/8660826412879686807'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8547759854250510773/posts/default/8660826412879686807'/><link rel='alternate' type='text/html' href='http://iphonepowercoding.blogspot.com/2009/02/iphone-development-self-directed.html' title='iPhone Development: A Self Directed Aproach'/><author><name>Ved Surtani</name><uri>http://www.blogger.com/profile/09714144214521232179</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>41</thr:total></entry></feed>
