<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	xmlns:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
	>

<channel>
	<title>iPhone Development</title>
	<atom:link href="http://iphone2020.wordpress.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://iphone2020.wordpress.com</link>
	<description>Just another iPhone Blog</description>
	<lastBuildDate>Tue, 24 Jan 2012 13:35:41 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
<cloud domain='iphone2020.wordpress.com' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>http://s2.wp.com/i/buttonw-com.png</url>
		<title>iPhone Development</title>
		<link>http://iphone2020.wordpress.com</link>
	</image>
	<atom:link rel="search" type="application/opensearchdescription+xml" href="http://iphone2020.wordpress.com/osd.xml" title="iPhone Development" />
	<atom:link rel='hub' href='http://iphone2020.wordpress.com/?pushpress=hub'/>
		<item>
		<title>An Idea for replacement of TweetLonger!</title>
		<link>http://iphone2020.wordpress.com/2011/11/09/an-idea-for-replacement-of-tweetlonger/</link>
		<comments>http://iphone2020.wordpress.com/2011/11/09/an-idea-for-replacement-of-tweetlonger/#comments</comments>
		<pubDate>Wed, 09 Nov 2011 15:35:10 +0000</pubDate>
		<dc:creator>bharath2020</dc:creator>
				<category><![CDATA[idea]]></category>
		<category><![CDATA[tweetlonger]]></category>

		<guid isPermaLink="false">https://iphone2020.wordpress.com/?p=520</guid>
		<description><![CDATA[Hey Folks, Just got this crazy idea which I would like to share. I was just annoyed for the way we have to read the tweets with 140+ characters. With most of the twitter clients ( almost all ) it takes the user to a website to read the whole tweet which in the process [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=iphone2020.wordpress.com&amp;blog=9201814&amp;post=520&amp;subd=iphone2020&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Hey Folks,</p>
<p>Just got this crazy idea which I would like to share.</p>
<p>I was just annoyed for the way we have to read the tweets with 140+ characters. With most of the twitter clients ( almost all ) it takes the user to a website to read the whole tweet which in the process is truncating the user experience of reading the tweets within the client and disconnecting the user from the twitter client.</p>
<p>With due respect for 140 characters limit twitter has placed, we could use below trick to solve this issue. This trick uses the <em>in-reply-to</em> feature of the twitter and the ability of most twitter clients to align the chain of tweets (tweets which have been originated as a reply of other tweet) in a linear fashion which helps read the broken tweets without any fuss.</p>
<p> </p>
<p><img style="display:block;margin-left:auto;margin-right:auto;" title="Screen shot 2011-11-09 at 8.51.57 PM.png" src="http://iphone2020.files.wordpress.com/2011/11/screen-shot-2011-11-09-at-8-51-57-pm.png?w=313&#038;h=429" border="0" alt="Screen shot 2011-11-09 at 8.51.57 PM.png" width="313" height="429" /></p>
<p style="text-align:center;"><strong>Fig:</strong> <em>A Snapshot of Linked tweets from Twitter for Mac</em> Read the text in the image excluding the twitter handle (i.e. bharath2020) at the start of each tweet.</p>
<p style="text-align:center;"> </p>
<p><img style="display:block;margin-left:auto;margin-right:auto;" title="Screen shot 2011-11-09 at 9.10.31 PM.png" src="http://iphone2020.files.wordpress.com/2011/11/screen-shot-2011-11-09-at-9-10-31-pm.png?w=312&#038;h=290" border="0" alt="Screen shot 2011-11-09 at 9.10.31 PM.png" width="312" height="290" /></p>
<p style="text-align:center;"><strong>Fig:</strong> <em>One more way of displaying linked tweets by </em><strong><em>Twitter</em></strong><em> Application for Mac</em></p>
<p style="text-align:center;"> </p>
<p>This trick could be deployed in all twitter clients with the user typing the whole tweet and twitter client will takes care of breaking the tweets and creating a link between them,</p>
<p>Let me know what do you think of this.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/iphone2020.wordpress.com/520/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/iphone2020.wordpress.com/520/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/iphone2020.wordpress.com/520/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/iphone2020.wordpress.com/520/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/iphone2020.wordpress.com/520/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/iphone2020.wordpress.com/520/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/iphone2020.wordpress.com/520/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/iphone2020.wordpress.com/520/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/iphone2020.wordpress.com/520/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/iphone2020.wordpress.com/520/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/iphone2020.wordpress.com/520/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/iphone2020.wordpress.com/520/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/iphone2020.wordpress.com/520/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/iphone2020.wordpress.com/520/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=iphone2020.wordpress.com&amp;blog=9201814&amp;post=520&amp;subd=iphone2020&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://iphone2020.wordpress.com/2011/11/09/an-idea-for-replacement-of-tweetlonger/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/28ecd692537748282f01a42f2c2ac910?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">Bharath</media:title>
		</media:content>

		<media:content url="http://iphone2020.files.wordpress.com/2011/11/screen-shot-2011-11-09-at-8-51-57-pm.png" medium="image">
			<media:title type="html">Screen shot 2011-11-09 at 8.51.57 PM.png</media:title>
		</media:content>

		<media:content url="http://iphone2020.files.wordpress.com/2011/11/screen-shot-2011-11-09-at-9-10-31-pm.png" medium="image">
			<media:title type="html">Screen shot 2011-11-09 at 9.10.31 PM.png</media:title>
		</media:content>
	</item>
		<item>
		<title>[self class] and static methods in Objective-C</title>
		<link>http://iphone2020.wordpress.com/2011/11/05/self-class-and-static-methods-in-objective-c/</link>
		<comments>http://iphone2020.wordpress.com/2011/11/05/self-class-and-static-methods-in-objective-c/#comments</comments>
		<pubDate>Sat, 05 Nov 2011 12:24:22 +0000</pubDate>
		<dc:creator>bharath2020</dc:creator>
				<category><![CDATA[Objective C]]></category>
		<category><![CDATA[[self class]]]></category>

		<guid isPermaLink="false">https://iphone2020.wordpress.com/?p=517</guid>
		<description><![CDATA[Its been 5+ years of Objective-C programming and If I turn back and see, I have still a lot to learn. I recently was working on a project, where a small design mistake look costlier. To overcome that, I had to override a set of static methods. Let me give some insight into what happened [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=iphone2020.wordpress.com&amp;blog=9201814&amp;post=517&amp;subd=iphone2020&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Its been 5+ years of Objective-C programming and If I turn back and see, I have still a lot to learn.</p>
<p>I recently was working on a project, where a small design mistake look costlier. To overcome that, I had to override a set of static methods.</p>
<p>Let me give some insight into what happened before this.</p>
<p> </p>
<p>I have seen many people use [self class] method in a static method, and I had always thought (my fault, i did not test it <img src='http://s0.wp.com/wp-includes/images/smilies/icon_sad.gif' alt=':(' class='wp-smiley' />  ) that this would be always equal to the class name where the method is defined. But, I was wrong</p>
<p> </p>
<p>So I had the following static method to create the Message model object</p>
<p> </p>
<blockquote>
<p>+(BBMessage*)newMessage</p>
<p>{</p>
<p>return [[[BBMessage alloc] init] autorelease];</p>
<p>}</p>
<p>+(BBMessage*)messageFromDictionary:(NSDictionary*)messageInfoDict</p>
<p>{</p>
<p>&#8230;</p>
<p>BBMessage *newMessage = [BBMessage newMessage];</p>
<p>&#8230;.</p>
<p>}</p>
</blockquote>
<p> </p>
<p>This method was widely used to create the BBMessage object throughout the application. As it turned out be at the near end of the project, I had to add a subclass of BBMessage named BBHistoryMessage. However, the difference between BBHistoryMessage and BBMessage was a couple of  attributes in BBHistoryMessage, but their creation using method messageFromDictionary: remained same.</p>
<p>However, since it had [BBMessage newMessage] statement, the object created by messageFromDictionary: always created BBMessage instance rather than BBHistoryMessage&#8217;s instance</p>
<p>This is when I realized that replacing the appearances of BBMessage class name with [self class] as the [self class] would return the name of the class which invoked the method</p>
<p> </p>
<p>For eg: if the BBHistoryMessage class  is used to invoke messageFromDictionary: then [self class] will be BBHistoryMessage class and hence newMessage would be creating BBHistoryMessage Class.</p>
<p> </p>
<p> </p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/iphone2020.wordpress.com/517/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/iphone2020.wordpress.com/517/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/iphone2020.wordpress.com/517/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/iphone2020.wordpress.com/517/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/iphone2020.wordpress.com/517/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/iphone2020.wordpress.com/517/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/iphone2020.wordpress.com/517/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/iphone2020.wordpress.com/517/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/iphone2020.wordpress.com/517/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/iphone2020.wordpress.com/517/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/iphone2020.wordpress.com/517/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/iphone2020.wordpress.com/517/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/iphone2020.wordpress.com/517/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/iphone2020.wordpress.com/517/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=iphone2020.wordpress.com&amp;blog=9201814&amp;post=517&amp;subd=iphone2020&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://iphone2020.wordpress.com/2011/11/05/self-class-and-static-methods-in-objective-c/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/28ecd692537748282f01a42f2c2ac910?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">Bharath</media:title>
		</media:content>
	</item>
		<item>
		<title>Pattern Drawing with CGPattern in iOS or Mac</title>
		<link>http://iphone2020.wordpress.com/2011/07/09/pattern-drawing-with-cgpattern-in-ios-or-mac/</link>
		<comments>http://iphone2020.wordpress.com/2011/07/09/pattern-drawing-with-cgpattern-in-ios-or-mac/#comments</comments>
		<pubDate>Sat, 09 Jul 2011 06:46:41 +0000</pubDate>
		<dc:creator>bharath2020</dc:creator>
				<category><![CDATA[iPad]]></category>
		<category><![CDATA[iPhone]]></category>
		<category><![CDATA[Quartz2D]]></category>
		<category><![CDATA[Sample Code]]></category>
		<category><![CDATA[cgpattern]]></category>
		<category><![CDATA[pattern drawing]]></category>
		<category><![CDATA[patterns]]></category>

		<guid isPermaLink="false">https://iphone2020.wordpress.com/?p=496</guid>
		<description><![CDATA[If you are looking for help on how to stroke or fill up a pattern in iOS or Mac OS X, then You have landed at the right place. NOTE: A reader of this post is assumed to have prior knowledge of custom drawing in iOS&#8217;s UIView, CGContext, and Quartz 2D basics You can find [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=iphone2020.wordpress.com&amp;blog=9201814&amp;post=496&amp;subd=iphone2020&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>If you are looking for help on how to stroke or fill up a pattern in iOS or Mac OS X, then You have landed at the right place.</p>
<p><strong>NOTE</strong>: A reader of this post is assumed to have prior knowledge of custom drawing in iOS&#8217;s UIView, CGContext, and Quartz 2D basics</p>
<p><a href="https://github.com/bharath2020/QuartzPatterns" target="_blank">You can find the Code sample from Github</a></p>
<p>The Sample code demonstrates the following things:</p>
<ul>
<li>Creation of 3 Different kinds of patterns using CGPattern</li>
<li>In the Sample, tap &#8220;Change Pattern&#8221; to switch to next pattern</li>
<li>Use the slider, to increase the size of pattern cell</li>
</ul>
<p>A <em>pattern</em> is an image, usually small, used for <em>filling</em> regions by tiling, that is, by placing copies of the <em>pattern</em> side by side like ceramic tiles. Here we see how we can achieve pattern filling in iOS or Mac using CGPattern.</p>
<p>A step by step explanation on usage of CGPatterns</p>
<p>Quartz draw the patterns using cell based drawing technique, where it would provide us the option to draw a single pattern cell in a context, and uses the context to tile across the remaining area evenly.</p>
<p><strong>STEP 1</strong> : Create a CGPattern instance as below</p>
<blockquote>
<p style="font:11px Menlo;color:#1c8700;margin:0;">//Pattern Callback methods</p>
<p style="font:11px Menlo;color:#1c8700;margin:0;"><span style="color:#000000;"> </span>// drawPatternCell &#8211; callback to draw a single cell</p>
<p style="font:11px Menlo;color:#1c8700;margin:0;"><span style="color:#000000;"> </span>//PatternReleaseInfoCallback &#8211; invoked when a pattern is released</p>
<p style="font:11px Menlo;color:#7131a9;margin:0;"><span style="color:#000000;"> </span>CGPatternCallbacks<span style="color:#000000;"> callBack;</span></p>
<p style="font:11px Menlo;margin:0;">callBack.<span style="color:#7131a9;">drawPattern</span> = &amp;<span style="color:#38595d;">drawPatternCell</span>;</p>
<p style="font:11px Menlo;color:#38595d;margin:0;"><span style="color:#000000;"> callBack.</span><span style="color:#7131a9;">releaseInfo</span><span style="color:#000000;"> = &amp;</span>PatternReleaseInfoCallback<span style="color:#000000;">;</span></p>
<p style="font:11px Menlo;margin:0;">callBack.<span style="color:#7131a9;">version</span> = <span style="color:#3f00d8;">0</span>;</p>
<p style="font:11px Menlo;min-height:13px;margin:0;"> </p>
<p style="font:11px Menlo;margin:0;"><span style="color:#1c8700;">// param1 &#8211; &amp;patters_types[patternCount] - a context info, here which defines which pattern to be drawn</span></p>
<p style="font:11px Menlo;margin:0;"><span style="color:#1c8700;"><br /></span></p>
<p style="font:11px Menlo;color:#1c8700;margin:0;"><span style="color:#000000;"> </span>// param2 &#8211; rect of a single pattern cell</p>
<p style="font:11px Menlo;color:#1c8700;margin:0;"> </p>
<p style="font:11px Menlo;color:#1c8700;margin:0;"><span style="color:#000000;"> </span>// param3 &#8211; transformation matrix</p>
<p style="font:11px Menlo;color:#1c8700;margin:0;"> </p>
<p style="font:11px Menlo;color:#1c8700;margin:0;"><span style="color:#000000;"> </span>// offsetX &#8211; a offset or horizontal gap between each cell.. minimum should be width of the cell</p>
<p style="font:11px Menlo;color:#1c8700;margin:0;"> </p>
<p style="font:11px Menlo;color:#1c8700;margin:0;"><span style="color:#000000;"> </span>// offsetY &#8211; a offset of vertical gap between each cell. minimum should be heigh of the cell</p>
<p style="font:11px Menlo;color:#1c8700;margin:0;"> </p>
<p style="font:11px Menlo;color:#1c8700;margin:0;"><span style="color:#000000;"> </span>// Style of &#8211; how the pattern cell are to be placed where are drawn on a region bigger than the single pattern cell</p>
<p style="font:11px Menlo;color:#1c8700;margin:0;"> </p>
<p style="font:11px Menlo;color:#1c8700;margin:0;"><span style="color:#000000;"> </span>// shouldColor &#8211;   a pattern can also be used as a mask, where the color is applied during the actual context where the pattern is drawn. So, literally you have to say true, if the pattern cell can chose its color, or no if the color at its main context is to be chosen</p>
<p style="font:11px Menlo;color:#1c8700;margin:0;"> </p>
<p style="font:11px Menlo;color:#1c8700;margin:0;">// callback &#8211; 2 callbacks encapsulated in a struct CGPatterCallbacks</p>
<p style="font:11px Menlo;color:#1c8700;margin:0;"> </p>
<p style="font:11px Menlo;margin:0;"><span style="color:#578187;">_patterns</span>[patternCount] = <span style="color:#410a81;">CGPatternCreate</span>(&amp;<span style="color:#578187;">patters_types</span>[patternCount], <span style="color:#410a81;">CGRectMake</span>(<span style="color:#3f00d8;">0.0</span>, <span style="color:#3f00d8;">0.0</span>, <span style="color:#73492c;">PATTERN_CELL_WIDTH</span>, <span style="color:#73492c;">PATTERN_CELL_HEIGHT</span>), <span style="color:#7131a9;">CGAffineTransformIdentity</span>, <span style="color:#73492c;">PATTERN_CELL_WIDTH</span>, <span style="color:#73492c;">PATTERN_CELL_HEIGHT</span>, <span style="color:#410a81;">kCGPatternTilingConstantSpacing</span>, <span style="color:#b411a3;">true</span>, &amp;callBack);</p>
<p style="font:11px Menlo;min-height:13px;margin:0;"> </p>
</blockquote>
<p> </p>
<p><strong>STEP 2</strong>:  <strong>(Important)</strong> define the drawPattern callback as below. This is the place where you are allowed to draw a single cell of a pattern. The drawing technique of pattern cell is same as one would draw in View&#8217;s <em>drawRect</em> method or drawing with any CGBitmapContext.</p>
<p> </p>
<p><strong>Pattern 1 &#8211; Chequered flag -</strong></p>
<p><img title="chequered_flag_pattern.png" src="http://iphone2020.files.wordpress.com/2011/07/chequered_flag_pattern.png?w=97&#038;h=98" border="0" alt="Chequered Flag Pattern" width="97" height="98" /></p>
<blockquote>
<p style="font:11px Menlo;color:#1c8700;margin:0;">//Chequered Flag</p>
<p style="font:11px Menlo;color:#1c8700;margin:0;"><span style="color:#000000;"> </span>//Fill the entire background with white color</p>
<p style="font:11px Menlo;color:#410a81;margin:0;"><span style="color:#000000;"> </span>CGContextSetFillColorWithColor<span style="color:#000000;">(context, [</span><span style="color:#7131a9;">UIColor</span><span style="color:#000000;"> </span>whiteColor<span style="color:#000000;">].</span><span style="color:#7131a9;">CGColor</span><span style="color:#000000;">);</span></p>
<p style="font:11px Menlo;margin:0;"><span style="color:#410a81;">CGContextFillRect</span>(context, <span style="color:#410a81;">CGRectMake</span>(<span style="color:#3f00d8;">0.0</span>, <span style="color:#3f00d8;">0.0</span>, cellWidth, cellHeight));</p>
<p style="font:11px Menlo;min-height:13px;margin:0;"> </p>
<p style="font:11px Menlo;color:#410a81;margin:0;"><span style="color:#000000;"> </span>CGContextSetFillColorWithColor<span style="color:#000000;">(context, [</span><span style="color:#7131a9;">UIColor</span><span style="color:#000000;"> </span>blackColor<span style="color:#000000;">].</span><span style="color:#7131a9;">CGColor</span><span style="color:#000000;">);</span></p>
<p style="font:11px Menlo;color:#1c8700;margin:0;"><span style="color:#000000;"> </span>//Fill the top left quarter of the cell with black</p>
<p style="font:11px Menlo;margin:0;"><span style="color:#410a81;">CGContextFillRect</span>(context, <span style="color:#410a81;">CGRectMake</span>(<span style="color:#3f00d8;">0.0</span>, <span style="color:#3f00d8;">0.0</span>, cellWidth/<span style="color:#3f00d8;">2.0</span>, cellHeight/<span style="color:#3f00d8;">2.0</span>));</p>
<p style="font:11px Menlo;min-height:13px;margin:0;"> </p>
<p style="font:11px Menlo;color:#1c8700;margin:0;"><span style="color:#000000;"> </span>//Fill the bottom right quarter of the cell with black</p>
<p style="font:11px Menlo;margin:0;"><span style="color:#410a81;">CGContextFillRect</span>(context, <span style="color:#410a81;">CGRectMake</span>(cellWidth/<span style="color:#3f00d8;">2.0</span>, cellHeight/<span style="color:#3f00d8;">2.0</span>, cellWidth/<span style="color:#3f00d8;">2.0</span>, cellHeight/<span style="color:#3f00d8;">2.0</span>));</p>
</blockquote>
<p> </p>
<p><strong>Pattern 2 </strong></p>
<p><img title="pattern_2.png" src="http://iphone2020.files.wordpress.com/2011/07/pattern_2.png?w=100&#038;h=98" border="0" alt="pattern_2" width="100" height="98" /></p>
<blockquote>
<p style="font:11px Menlo;color:#4000fe;margin:0;"><span style="color:#000000;"> </span><span style="color:#1c8700;">//<a href="http://www.kitchenbeforeandafter.com/wp-content/uploads/2009/05/kitchen-backsplash-tile-patterns2-300x216.gif" target="_blank"><span style="color:#4000fe;">http://www.kitchenbeforeandafter.com/wp-content/uploads/2009/05/kitchen-backsplash-tile-patterns2-300&#215;216.gif</span></a></span></p>
<p style="font:11px Menlo;color:#1c8700;margin:0;"><span style="color:#000000;"> </span>//\       /</p>
<p style="font:11px Menlo;color:#1c8700;margin:0;"><span style="color:#000000;"> </span>// \     /</p>
<p style="font:11px Menlo;color:#1c8700;margin:0;"><span style="color:#000000;"> </span>//  \ _ /</p>
<p style="font:11px Menlo;color:#1c8700;margin:0;"><span style="color:#000000;"> </span>//   |_|</p>
<p style="font:11px Menlo;color:#1c8700;margin:0;"><span style="color:#000000;"> </span>//  /   \</p>
<p style="font:11px Menlo;color:#1c8700;margin:0;"><span style="color:#000000;"> </span>// /     \</p>
<p style="font:11px Menlo;color:#1c8700;margin:0;"><span style="color:#000000;"> </span>///       \</p>
<p style="font:11px Menlo;min-height:13px;margin:0;"> </p>
<p style="font:11px Menlo;min-height:13px;margin:0;"> </p>
<p style="font:11px Menlo;color:#1c8700;margin:0;"><span style="color:#000000;"> </span>//stroke middle square</p>
<p style="font:11px Menlo;color:#410a81;margin:0;"><span style="color:#000000;"> </span>CGContextSetFillColorWithColor<span style="color:#000000;">(context, [</span><span style="color:#7131a9;">UIColor</span><span style="color:#000000;"> </span>whiteColor<span style="color:#000000;">].</span><span style="color:#7131a9;">CGColor</span><span style="color:#000000;">);</span></p>
<p style="font:11px Menlo;margin:0;"><span style="color:#410a81;">CGContextFillRect</span>(context, <span style="color:#410a81;">CGRectMake</span>(<span style="color:#3f00d8;">0.0</span>, <span style="color:#3f00d8;">0.0</span>, cellWidth, cellHeight));</p>
<p style="font:11px Menlo;min-height:13px;margin:0;"> </p>
<p style="font:11px Menlo;min-height:13px;margin:0;"> </p>
<p style="font:11px Menlo;color:#1c8700;margin:0;"><span style="color:#000000;"> </span>//stroke diagonal</p>
<p style="font:11px Menlo;color:#410a81;margin:0;"><span style="color:#000000;"> </span>CGContextSetStrokeColorWithColor<span style="color:#000000;">(context, [</span><span style="color:#7131a9;">UIColor</span><span style="color:#000000;"> </span>redColor<span style="color:#000000;">].</span><span style="color:#7131a9;">CGColor</span><span style="color:#000000;">);</span></p>
<p style="font:11px Menlo;margin:0;"><span style="color:#7131a9;">CGPoint</span> points [] = {{<span style="color:#3f00d8;">0.0</span>,<span style="color:#3f00d8;">0.0</span>}, {cellWidth,cellHeight }, {cellWidth,<span style="color:#3f00d8;">0.0</span>}, {<span style="color:#3f00d8;">0.0</span>,cellHeight}};</p>
<p style="font:11px Menlo;margin:0;"><span style="color:#410a81;">CGContextStrokeLineSegments</span>(context, points, <span style="color:#3f00d8;">4</span>);</p>
<p style="font:11px Menlo;min-height:13px;margin:0;"> </p>
<p style="font:11px Menlo;color:#410a81;margin:0;"><span style="color:#000000;"> </span>CGContextSetFillColorWithColor<span style="color:#000000;">(context, [</span><span style="color:#7131a9;">UIColor</span><span style="color:#000000;"> </span>blackColor<span style="color:#000000;">].</span><span style="color:#7131a9;">CGColor</span><span style="color:#000000;">);</span></p>
<p style="font:11px Menlo;margin:0;"><span style="color:#b411a3;">int</span> num_of_parts = <span style="color:#3f00d8;">8</span>;</p>
<p style="font:11px Menlo;margin:0;"><span style="color:#b411a3;">float</span> partWitdth = cellWidth / num_of_parts;</p>
<p style="font:11px Menlo;margin:0;"><span style="color:#7131a9;">CGRect</span> middleSpot = <span style="color:#410a81;">CGRectMake</span>(partWitdth * <span style="color:#3f00d8;">3</span>, partWitdth*<span style="color:#3f00d8;">3</span>, <span style="color:#3f00d8;">2</span>* partWitdth, <span style="color:#3f00d8;">2</span>*partWitdth);</p>
<p style="font:11px Menlo;min-height:13px;margin:0;"> </p>
<p style="font:11px Menlo;margin:0;"><span style="color:#410a81;">CGContextFillRect</span>(context, middleSpot);</p>
</blockquote>
<p><strong><br /></strong></p>
<p><strong>Pattern 3</strong></p>
<p><img title="pattern_3.png" src="http://iphone2020.files.wordpress.com/2011/07/pattern_3.png?w=98&#038;h=98" border="0" alt="Circular_pattern" width="98" height="98" /></p>
<p>The Elements involve in this pattern are a circle drawn with various transformations</p>
<ul>
<li><strong>Circle </strong></li>
<li><strong>Semi-Circle</strong><br /> 
<ul>
<li>Circle shifted towards left by half the width of the cell</li>
<li>Circle shifted towards right by half the width of the cell</li>
<li>Circle shifted towards top by half the height of the cell</li>
<li>Circle shifted towards bottom by half the height of the cell</li>
</ul>
</li>
<li><strong>Arc</strong><br /> 
<ul>
<li>Circle shifted towards left &amp; top by half the width and half the height of the cell respectively</li>
<li>Circle shifted towards left &amp; bottom by half the width and half the height of the cell respectively</li>
<li>Circle shifted towards right &amp; top by half the width and half the height of the cell respectively</li>
<li>Circle shifted towards right &amp; bottom by half the width and half the height of the cell respectively</li>
</ul>
</li>
</ul>
<p><a href="https://github.com/bharath2020/QuartzPatterns" target="_blank">You can clone a copy of this Sample project from GitHub</a></p>
<p><strong>STEP 3:</strong> Applying the Pattern.</p>
<p>Finally we would be applying the pattern in drawRect method of BBQuartzView in this sample.</p>
<blockquote>
<p style="font:11px Menlo;color:#1c8700;margin:0;">// Drawing code</p>
<p style="font:11px Menlo;margin:0;"><span style="color:#b411a3;">float</span> alpha = <span style="color:#3f00d8;">1</span>;</p>
<p style="font:11px Menlo;min-height:13px;margin:0;"> </p>
<p style="font:11px Menlo;color:#1c8700;margin:0;"><span style="color:#000000;"> </span>//choose the pattern to be filled based on the currentPattern selected</p>
<p style="font:11px Menlo;color:#410a81;margin:0;"><span style="color:#000000;"> </span><span style="color:#7131a9;">CGContextRef</span><span style="color:#000000;"> context = </span>UIGraphicsGetCurrentContext<span style="color:#000000;">();</span></p>
<p style="font:11px Menlo;margin:0;"><span style="color:#7131a9;">CGColorSpaceRef</span> patternSpace = <span style="color:#410a81;">CGColorSpaceCreatePattern</span> (<span style="color:#b411a3;">NULL</span>);<span style="color:#1c8700;">// 6</span></p>
<p style="font:11px Menlo;margin:0;"><span style="color:#410a81;">CGContextSetFillColorSpace</span> (context, patternSpace);<span style="color:#1c8700;">// 7</span></p>
<p style="font:11px Menlo;margin:0;"><span style="color:#410a81;">CGColorSpaceRelease</span> (patternSpace);</p>
<p style="font:11px Menlo;min-height:13px;margin:0;"> </p>
<p style="font:11px Menlo;color:#1c8700;margin:0;"><span style="color:#000000;"> </span>//set the pattern as the Current Context&#8217;s fill pattern</p>
<p style="font:11px Menlo;color:#1c8700;margin:0;"> </p>
<p style="font:11px Menlo;color:#1c8700;margin:0;"><span style="color:#000000;"> </span>//we dont need to set any color, as the pattern cell itself has chosen its own color</p>
<p style="font:11px Menlo;margin:0;"><span style="color:#410a81;">CGContextSetFillPattern</span>(context, <span style="color:#578187;">_patterns</span>[<span style="color:#578187;">_currentPattern</span>],   &amp;alpha);</p>
<p style="font:11px Menlo;color:#1c8700;margin:0;"><span style="color:#000000;"><span style="color:#1c8700;"><br /></span></span></p>
<p style="font:11px Menlo;color:#1c8700;margin:0;"><span style="color:#000000;"> </span>//We would be filling the entire portion of this view</p>
<p style="font:11px Menlo;color:#410a81;margin:0;"><span style="color:#000000;"> </span>CGContextFillRect<span style="color:#000000;">(context, [</span><span style="color:#b411a3;">self</span><span style="color:#000000;"> </span>bounds<span style="color:#000000;">]);</span></p>
</blockquote>
<ul>
<li>Choose the pattern that needs to be applied. In this sample, the pattern is chosen based on the <em>_currentPattern </em>variable value (0- Chequered pattern, 1- Pattern2, 3- Pattern3)</li>
<li>Patterns are created at the time of initializing the view. In sample, it is in <em>initWithCoder</em> method of BBQuartzView</li>
<li>The drawPattern callback is invoked only when the pattern is all set to be drawn. In my case, it is invoked when <em>CGContextFillRect</em> in the above drawing code snippet. You can use this pattern to fill any shape. The selected pattern would also be reflected while using CGContext drawing API like, CGContextFill variants, CGContextFillPath variants</li>
<li>The drawPattern Callback is called only once in its lifetime and for subsequent drawing, the pattern cell buffer would be re-used. So resize the single pattern cell, the patterns are re-created</li>
</ul>
<p>Here is are the pics how the patterns would look like(captured from sample code).</p>
<pre style="text-align:center;"><img style="float:left;" title="patterns.png" src="http://iphone2020.files.wordpress.com/2011/07/patterns.png?w=600&#038;h=300" border="0" alt="patterns.png" width="600" height="300" /></pre>
<p> </p>
<p><a href="https://github.com/bharath2020/QuartzPatterns" target="_blank">You can clone a copy of this Sample project from GitHub</a></p>
<p>Hope, you find this piece of info useful. Fill in your comments or queries in below comment&#8217;s section. Waiting for you comments.</p>
<div>Happy Coding <img src='http://s0.wp.com/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> </div>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/iphone2020.wordpress.com/496/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/iphone2020.wordpress.com/496/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/iphone2020.wordpress.com/496/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/iphone2020.wordpress.com/496/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/iphone2020.wordpress.com/496/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/iphone2020.wordpress.com/496/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/iphone2020.wordpress.com/496/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/iphone2020.wordpress.com/496/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/iphone2020.wordpress.com/496/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/iphone2020.wordpress.com/496/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/iphone2020.wordpress.com/496/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/iphone2020.wordpress.com/496/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/iphone2020.wordpress.com/496/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/iphone2020.wordpress.com/496/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=iphone2020.wordpress.com&amp;blog=9201814&amp;post=496&amp;subd=iphone2020&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://iphone2020.wordpress.com/2011/07/09/pattern-drawing-with-cgpattern-in-ios-or-mac/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/28ecd692537748282f01a42f2c2ac910?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">Bharath</media:title>
		</media:content>

		<media:content url="http://iphone2020.files.wordpress.com/2011/07/chequered_flag_pattern.png" medium="image">
			<media:title type="html">chequered_flag_pattern.png</media:title>
		</media:content>

		<media:content url="http://iphone2020.files.wordpress.com/2011/07/pattern_2.png" medium="image">
			<media:title type="html">pattern_2.png</media:title>
		</media:content>

		<media:content url="http://iphone2020.files.wordpress.com/2011/07/pattern_3.png" medium="image">
			<media:title type="html">pattern_3.png</media:title>
		</media:content>

		<media:content url="http://iphone2020.files.wordpress.com/2011/07/patterns.png" medium="image">
			<media:title type="html">patterns.png</media:title>
		</media:content>
	</item>
		<item>
		<title>AGE Meter LIVE as iChat Status via Apple Script</title>
		<link>http://iphone2020.wordpress.com/2011/06/24/age-meter-live-as-ichat-status-via-apple-script/</link>
		<comments>http://iphone2020.wordpress.com/2011/06/24/age-meter-live-as-ichat-status-via-apple-script/#comments</comments>
		<pubDate>Fri, 24 Jun 2011 12:49:05 +0000</pubDate>
		<dc:creator>bharath2020</dc:creator>
				<category><![CDATA[Apple Script]]></category>
		<category><![CDATA[apple script]]></category>
		<category><![CDATA[datedifference]]></category>
		<category><![CDATA[php]]></category>

		<guid isPermaLink="false">https://iphone2020.wordpress.com/?p=487</guid>
		<description><![CDATA[&#8220;Necessity is the Mother of Invention&#8221; &#8211; I just experienced the truth of it. Wait, I haven&#8217;t invented anything here. Since, I had the appetite do something new and noticeable on my Birthday, I came with AGE Meter, which displays your AGE as iChat status message, and its LIVE, updated every second     I [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=iphone2020.wordpress.com&amp;blog=9201814&amp;post=487&amp;subd=iphone2020&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p style="font:12px Helvetica;margin:0;">&#8220;<strong>Necessity is the Mother of Invention</strong>&#8221; &#8211; I just experienced the truth of it. Wait, I haven&#8217;t invented anything here. Since, I had the appetite do something new and noticeable on my Birthday, I came with AGE Meter, which displays your AGE as iChat status message, and its LIVE, updated every second</p>
<p style="font:12px Helvetica;margin:0;"> </p>
<p style="font:12px Helvetica;margin:0;"><img style="border:0 initial initial;" title="ichatStatus.png" src="http://iphone2020.files.wordpress.com/2011/06/ichatstatus.png?w=558&#038;h=42" border="0" alt="iChatStatus" width="558" height="42" /></p>
<p style="font:12px Helvetica;margin:0;"> </p>
<p style="font:12px Helvetica;margin:0;">I had written an Apple Script to set the Chat Message, and since many people follow my iChat status message, I thought let me update my AGE every second, which is something new in a status message, Right?. It received awesome response and I would like to share this script and let you experience the awesomeness of it.</p>
<p style="font:12px Helvetica;min-height:14px;margin:0;"> </p>
<p style="font:12px Helvetica;min-height:14px;margin:0;"> </p>
<p style="font:12px Helvetica;margin:0;"><em><strong>NOTE: This script requires Mac OS X 10.4 and above, AppleScript Editor, iChat Messager for Mac OS X , PHP Installed</strong></em></p>
<p style="font:12px Helvetica;min-height:14px;margin:0;"> </p>
<p style="font:12px Helvetica;margin:0;">The Script is divided in to two parts</p>
<p style="font:12px Helvetica;min-height:14px;margin:0;"> </p>
<p style="font:12px Helvetica;margin:0;">1. <strong>Apple Script </strong>- to update the iChat Message status</p>
<p style="font:12px Helvetica;min-height:14px;margin:0;"> </p>
<p style="font:12px Helvetica;margin:0;">2.<strong> PHP script</strong> &#8211; to calculate the difference between current date and your Birthdate. This script is invoked by AppleScript and its result (the Age in Years, Months, Days, Hours, Minutes, Seconds ) is piped to AppleScript for final display</p>
<p style="font:12px Helvetica;min-height:14px;margin:0;"> </p>
<p style="font:12px Helvetica;margin:0;"><a href="http://cl.ly/0C2o1o0k413Z3v3R0p0t">You can find the script here</a>.</p>
<p style="font:12px Helvetica;min-height:14px;margin:0;"> </p>
<p style="font:12px Helvetica;margin:0;"><strong>Installation</strong></p>
<p style="font:12px Helvetica;min-height:14px;margin:0;"> </p>
<p style="font:12px Helvetica;margin:0;">1. Unzip the BirthdayCounter.zip, which you have downloaded. Once unzipped, you  should find a &#8220;BirthdayCounter&#8221; Folder. This folder has two files &#8220;BirthdayCounter_AppleScript&#8221; and &#8220;DateDifference.php&#8221;</p>
<p style="font:12px Helvetica;min-height:14px;margin:0;"> </p>
<p style="font:12px Helvetica;margin:0;">2. Update your Birthdate here in this line in <em>DateDifference.php </em>file, located at the end of the script. Please note that the time should be in GMT.</p>
<p style="font:12px Helvetica;min-height:14px;margin:0;"> </p>
<blockquote>
<p style="font:12px Helvetica;margin:0;">echo dateDiff(&#8220;1976-06-23 02:00:00&#8243;, &#8220;now&#8221;) . &#8220;\n&#8221;;</p>
</blockquote>
<p style="font:12px Helvetica;min-height:14px;margin:0;"> </p>
<p style="font:12px Helvetica;margin:0;">3. Open &#8220;BirthdayCounter_AppleScript&#8221; in Apple Script Editor and Tap Run. There you go, the AGE meter has started.</p>
<p style="font:12px Helvetica;min-height:14px;margin:0;"> </p>
<p style="font:12px Helvetica;min-height:14px;margin:0;"> </p>
<p style="font:12px Helvetica;margin:0;">Let me know if it looks awesomely for you <img src='http://s0.wp.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p style="font:12px Helvetica;margin:0;"> </p>
<p> </p>
<p style="font:12px Helvetica;margin:0;"><span style="font-size:medium;"><br /></span></p>
<p> </p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/iphone2020.wordpress.com/487/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/iphone2020.wordpress.com/487/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/iphone2020.wordpress.com/487/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/iphone2020.wordpress.com/487/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/iphone2020.wordpress.com/487/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/iphone2020.wordpress.com/487/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/iphone2020.wordpress.com/487/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/iphone2020.wordpress.com/487/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/iphone2020.wordpress.com/487/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/iphone2020.wordpress.com/487/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/iphone2020.wordpress.com/487/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/iphone2020.wordpress.com/487/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/iphone2020.wordpress.com/487/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/iphone2020.wordpress.com/487/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=iphone2020.wordpress.com&amp;blog=9201814&amp;post=487&amp;subd=iphone2020&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://iphone2020.wordpress.com/2011/06/24/age-meter-live-as-ichat-status-via-apple-script/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/28ecd692537748282f01a42f2c2ac910?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">Bharath</media:title>
		</media:content>

		<media:content url="http://iphone2020.files.wordpress.com/2011/06/ichatstatus.png" medium="image">
			<media:title type="html">ichatStatus.png</media:title>
		</media:content>
	</item>
		<item>
		<title>10000 HITS!!</title>
		<link>http://iphone2020.wordpress.com/2011/06/20/10000-hits/</link>
		<comments>http://iphone2020.wordpress.com/2011/06/20/10000-hits/#comments</comments>
		<pubDate>Mon, 20 Jun 2011 18:04:39 +0000</pubDate>
		<dc:creator>bharath2020</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[celeberation]]></category>

		<guid isPermaLink="false">https://iphone2020.wordpress.com/?p=484</guid>
		<description><![CDATA[Hey Folks, This blog just got its 10,000 hit and thank you each one you who have shown good support towards this blog. I think this is just the beginning. Just to give some stat on this short journey, the most liked posts in this blog are Efficient Memory Handling in UIViewController-Part 1 iOS Open [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=iphone2020.wordpress.com&amp;blog=9201814&amp;post=484&amp;subd=iphone2020&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Hey Folks,</p>
<p>This blog just got its 10,000 hit and thank you each one you who have shown good support towards this blog. I think this is just the beginning. Just to give some stat on this short journey, the most liked posts in this blog are</p>
<p><a href="https://iphone2020.wordpress.com/2010/05/30/efficient-memory-handling-in-uiviewcontroller-part-1/">Efficient Memory Handling in UIViewController-Part 1</a></p>
<p><a href="https://iphone2020.wordpress.com/2011/02/17/ios-open-folder-animation/">iOS Open Folder Animation</a></p>
<p>And Apologize for not updating this blog for past 5 months, I have bee caught up in too many things viz ICC Cricket World Cup 2011(hey India Won it <img src='http://s0.wp.com/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' />  ), IPL (RCB made it to Finals) and shifting focus to Android OS.</p>
<p>And lately, burnt my fingers by updating iOS 5 Beta onto my iPad ( unofficially the iPAd 1), and after experiencing its flaws (I don&#8217;t like it being tagged as BETA) tried to restore it to 4.3.3 successfully( in an ugly way ) but none of the third party apps are working anymore.</p>
<p>If you are planning to upgrade to iOS 5 BETA, then I would say spend your valuable time onto something else, and if you are still want to do, Make sure you BACKUP YOUR DEVICE before attempting it.</p>
<p>Will get back to you sooner.</p>
<p>All the Best!!</p>
<p>Happy Coding <img src='http://s0.wp.com/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> </p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/iphone2020.wordpress.com/484/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/iphone2020.wordpress.com/484/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/iphone2020.wordpress.com/484/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/iphone2020.wordpress.com/484/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/iphone2020.wordpress.com/484/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/iphone2020.wordpress.com/484/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/iphone2020.wordpress.com/484/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/iphone2020.wordpress.com/484/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/iphone2020.wordpress.com/484/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/iphone2020.wordpress.com/484/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/iphone2020.wordpress.com/484/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/iphone2020.wordpress.com/484/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/iphone2020.wordpress.com/484/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/iphone2020.wordpress.com/484/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=iphone2020.wordpress.com&amp;blog=9201814&amp;post=484&amp;subd=iphone2020&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://iphone2020.wordpress.com/2011/06/20/10000-hits/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/28ecd692537748282f01a42f2c2ac910?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">Bharath</media:title>
		</media:content>
	</item>
		<item>
		<title>Things I Learnt Today</title>
		<link>http://iphone2020.wordpress.com/2011/05/04/things-i-learnt-today/</link>
		<comments>http://iphone2020.wordpress.com/2011/05/04/things-i-learnt-today/#comments</comments>
		<pubDate>Wed, 04 May 2011 18:05:06 +0000</pubDate>
		<dc:creator>bharath2020</dc:creator>
				<category><![CDATA[Mac]]></category>
		<category><![CDATA[Python]]></category>
		<category><![CDATA[mac ports]]></category>
		<category><![CDATA[python imaging library]]></category>
		<category><![CDATA[_imaging]]></category>

		<guid isPermaLink="false">https://iphone2020.wordpress.com/?p=402</guid>
		<description><![CDATA[Mac Ports: An awesome initiation by the Open-source community to provide a single application, called as Ports, which keeps track of most of the open-source projects thus reducing the hassle of manual compilation of your favorite open source project manual tracking of the latest version of your favorite open source project All you have to [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=iphone2020.wordpress.com&amp;blog=9201814&amp;post=402&amp;subd=iphone2020&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p><strong>Mac Ports:</strong></p>
<p>An awesome initiation by the Open-source community to provide a single application, called as Ports, which keeps track of most of the open-source projects thus reducing</p>
<ul>
<li>the hassle of manual compilation of your favorite open source project </li>
<li>manual tracking of the latest version of your favorite open source project</li>
</ul>
<p>All you have to say is the open source project name / software title , a.k.a port, you are interested, and Port utility will take care of</p>
<ul>
<li>Finding the Latest stable version for the latest OS Version</li>
<li>Downloading the appropriate source</li>
<li>compiling and creating an executable</li>
</ul>
<p>With Mac Ports available it is very easy to compile your JPEG library, or for that matter installing python, which is as easy as saying</p>
<blockquote>
<p><strong>sudo ports &#8211; v python +universal</strong></p>
</blockquote>
<p>This is the tool which help the Novice developers / or the ones who are very much interested in getting their Favorite open source project up and running rather than indulging in dirt of compilation</p>
<p>For more information on Mac Ports Visit the community site <a href="http://www.macports.org/">here</a></p>
<p> </p>
<p><strong>Python Imaging Library(PIL)</strong></p>
<p>Did a Hands On on setting up Python Imaging Library and there came the use of ports where I had to Install JPEG, XML, FreeType libraries. This is wonderful library which supports a various Image Processing Options, with Image Comparison is the one which I was interested upon.</p>
<p>Installation of PIL is explained step by step <a href="http://passingcuriosity.com/2009/installing-pil-on-mac-os-x-leopard/">here</a>, I was installing this on Snow Leopard and was with this issue</p>
<p>&#8220;_imaging.so module not installed&#8221;</p>
<p>OR</p>
<pre style="line-height:18px;margin-bottom:1em;border-left-width:0;border-left-style:solid;border-left-color:#cccccc;letter-spacing:0;font-family:Courier, 'Courier New', Monaco, monospace;font-size:.9em;background-image:initial;background-attachment:initial;background-color:#eeeeee;width:46.705882352941em;background-position:initial initial;background-repeat:initial initial;padding:1em 0 1em 1em;"><span class="n">Traceback</span> <span class="p">(</span><span class="n">most</span> <span class="n">recent</span> <span class="n">call</span> <span class="n">last</span><span class="p">):</span>
  <span class="n">File</span> <span class="s" style="color:#006699;">"&lt;stdin&gt;"</span><span class="p">,</span> <span class="n">line</span> <span class="mf" style="color:#009999;">1</span><span class="p">,</span> <span class="ow" style="font-weight:bold;">in</span> <span class="o" style="font-weight:bold;">&lt;</span><span class="n">module</span><span class="o" style="font-weight:bold;">&gt;</span>
<span class="ne" style="color:#006699;font-weight:bold;">ImportError</span><span class="p">:</span> <span class="n">dlopen</span><span class="p">(</span><span class="o" style="font-weight:bold;">/</span><span class="n">Library</span><span class="o" style="font-weight:bold;">/</span><span class="n">Python</span><span class="o" style="font-weight:bold;">/</span><span class="mf" style="color:#009999;">2.6</span><span class="o" style="font-weight:bold;">/</span><span class="n">site</span><span class="o" style="font-weight:bold;">-</span><span class="n">packages</span><span class="o" style="font-weight:bold;">/</span><span class="n">PIL</span><span class="o" style="font-weight:bold;">/</span><span class="n">_imaging</span><span class="o" style="font-weight:bold;">.</span><span class="n">so</span><span class="p">,</span> <span class="mf" style="color:#009999;">2</span><span class="p">):</span> \
<span class="n">Symbol</span> <span class="ow" style="font-weight:bold;">not</span> <span class="n">found</span><span class="p">:</span> <span class="n">_jpeg_resync_to_restart</span>
  <span class="n">Referenced</span> <span class="n">from</span><span class="p">:</span> <span class="o" style="font-weight:bold;">/</span><span class="n">Library</span><span class="o" style="font-weight:bold;">/</span><span class="n">Python</span><span class="o" style="font-weight:bold;">/</span><span class="mf" style="color:#009999;">2.6</span><span class="o" style="font-weight:bold;">/</span><span class="n">site</span><span class="o" style="font-weight:bold;">-</span><span class="n">packages</span><span class="o" style="font-weight:bold;">/</span><span class="n">PIL</span><span class="o" style="font-weight:bold;">/</span><span class="n">_imaging</span><span class="o" style="font-weight:bold;">.</span><span class="n">so</span>
  <span class="n">Expected</span> <span class="ow" style="font-weight:bold;">in</span><span class="p">:</span> <span class="n">flat</span> <span class="n">namespace</span>
 <span class="ow" style="font-weight:bold;">in</span> <span class="o" style="font-weight:bold;">/</span><span class="n">Library</span><span class="o" style="font-weight:bold;">/</span><span class="n">Python</span><span class="o" style="font-weight:bold;">/</span><span class="mf" style="color:#009999;">2.6</span><span class="o" style="font-weight:bold;">/</span><span class="n">site</span><span class="o" style="font-weight:bold;">-</span><span class="n">packages</span><span class="o" style="font-weight:bold;">/</span><span class="n">PIL</span><span class="o" style="font-weight:bold;">/</span><span class="n">_imaging</span><span class="o" style="font-weight:bold;">.</span><span class="n">so</span></pre>
<p>If Ypur not so lucky enough to get the PIL installed due to this Error, then you have come to the right place. This issue is because the Python in Snow Leapard is looking for 64 bit JPEG library by default.</p>
<p>I have followed the steps nailed <a href="http://www.arnebrodowski.de/blog/libjpeg-symbol-not-found-error-with-pil-on-10.6-snow-leopard.html?c=22436">here</a> and it worked for me</p>
<p>Hope this helps.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/iphone2020.wordpress.com/402/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/iphone2020.wordpress.com/402/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/iphone2020.wordpress.com/402/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/iphone2020.wordpress.com/402/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/iphone2020.wordpress.com/402/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/iphone2020.wordpress.com/402/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/iphone2020.wordpress.com/402/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/iphone2020.wordpress.com/402/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/iphone2020.wordpress.com/402/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/iphone2020.wordpress.com/402/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/iphone2020.wordpress.com/402/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/iphone2020.wordpress.com/402/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/iphone2020.wordpress.com/402/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/iphone2020.wordpress.com/402/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=iphone2020.wordpress.com&amp;blog=9201814&amp;post=402&amp;subd=iphone2020&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://iphone2020.wordpress.com/2011/05/04/things-i-learnt-today/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/28ecd692537748282f01a42f2c2ac910?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">Bharath</media:title>
		</media:content>
	</item>
		<item>
		<title>iOS Open Folder Animation</title>
		<link>http://iphone2020.wordpress.com/2011/02/17/ios-open-folder-animation/</link>
		<comments>http://iphone2020.wordpress.com/2011/02/17/ios-open-folder-animation/#comments</comments>
		<pubDate>Thu, 17 Feb 2011 20:16:39 +0000</pubDate>
		<dc:creator>bharath2020</dc:creator>
				<category><![CDATA[iPad]]></category>
		<category><![CDATA[iPhone]]></category>
		<category><![CDATA[Objective C]]></category>
		<category><![CDATA[bounds]]></category>
		<category><![CDATA[Core animation]]></category>
		<category><![CDATA[folder animation]]></category>
		<category><![CDATA[frame]]></category>
		<category><![CDATA[iOS folder animation]]></category>
		<category><![CDATA[open folder]]></category>
		<category><![CDATA[UIView]]></category>
		<category><![CDATA[view animation]]></category>

		<guid isPermaLink="false">https://iphone2020.wordpress.com/?p=356</guid>
		<description><![CDATA[As I was fiddling with my iPad,  Open Folder Animation in iOS caught my attention. After giving it a serious though on how to achieve it, It looked Trivial.   Let us get together to write a piece of code which does this cool animation.   1. Plan We can achieve this using 3 Main [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=iphone2020.wordpress.com&amp;blog=9201814&amp;post=356&amp;subd=iphone2020&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>As I was fiddling with my iPad,  Open Folder Animation in iOS caught my attention. After giving it a serious though on how to achieve it, It looked Trivial.</p>
<p><img style="display:block;margin-left:auto;margin-right:auto;" title="iOS Folder View.PNG" src="http://iphone2020.files.wordpress.com/2011/02/ios-folder-view.png?w=600&#038;h=450" border="0" alt="iOS Folder View" width="600" height="450" /></p>
<p> </p>
<p>Let us get together to write a piece of code which does this cool animation.</p>
<p> </p>
<p><span style="font-size:18px;font-weight:bold;">1. Plan</span></p>
<p><img style="display:block;margin-left:auto;margin-right:auto;" title="iOS_Folder_View_Plan.png" src="http://iphone2020.files.wordpress.com/2011/02/ios_folder_view_plan1.png?w=560&#038;h=432" border="0" alt="iOS_Folder_View_Plan.png" width="560" height="432" /></p>
<p><strong>We can achieve this using 3 Main Layers</strong></p>
<p>1. Layer -1 (Main View) : The Lowest layer contains the main screen which stores the main content</p>
<p>2. Layer -2  (Folder View): The Folder View, which hosts the Folder Icons. Once the Folder Opens, This is the only view which is active accepting the Touch Event. This layer resides above Layer-1</p>
<p>3. Layer-2.1 (Arrow ) : The Arrow, which points to the selected folder. This is movable on x-Axis.</p>
<p>4. Layer-3 (Layer to host Bottom part of Main Content View) : This layer hosts the bottom part of the Main Content View (Layer -1) i.e from point where Folder View ( Layer-2) occupies to the end of the Main Content View. This Layer is place above the Folder View (Layer-2 ) in terms of Level. In Terms of position on screen, this layer is placed just below the Folder View(Layer-2)</p>
<p> </p>
<h1>2. Execution</h1>
<p><strong>We can achieve Open Folder Animation effect in 3 Simple Steps</strong></p>
<p><strong>STEP 1: Capture the Main View Content into an image </strong></p>
<ul>
<li>Capturing Main View Content Image can be achieve using <strong><em><a href="http://developer.apple.com/library/ios/#qa/qa2010/qa1714.html">renderInContex</a></em><a href="http://developer.apple.com/library/ios/#qa/qa2010/qa1714.html">t:</a></strong> API. as shown in code snippet below</li>
<li>Clip the Main View into two parts, One part is the visible portion above the Folder view and rest of the image would be hosted in Layer -3. The Trick used in sample code below to avoid the cutting of the image into two parts, is by setting the Layer-3 bounds, such that it should hide the top portion (Part-1) of the Main Content view.</li>
</ul>
<blockquote>
<p style="font:10px Monaco;margin:0;">-(<span style="color:#b411a3;">void</span>)captureImageFromPointAndSetupMaskView:(<span style="color:#7131a9;">CGPoint</span>)selectedFolderPoint</p>
<p style="font:10px Monaco;margin:0;">{</p>
<p style="font:10px Monaco;color:#410a81;margin:0;"><span style="color:#000000;"> </span> UIGraphicsBeginImageContext<span style="color:#000000;">(</span><span style="color:#578187;">mMainBackgroundView</span><span style="color:#000000;">.</span><span style="color:#7131a9;">frame</span><span style="color:#000000;">.</span><span style="color:#7131a9;">size</span><span style="color:#000000;">);</span></p>
<p style="font:10px Monaco;min-height:14px;margin:0;"><span style="white-space:pre;"> </span></p>
<p style="font:10px Monaco;color:#1c8700;margin:0;"><span style="color:#000000;"><span style="white-space:pre;"> </span></span>//capture the main content view</p>
<p style="font:10px Monaco;color:#410a81;margin:0;"><span style="color:#000000;"><span style="white-space:pre;"> </span>[</span><span style="color:#578187;">mMainBackgroundView</span><span style="color:#000000;">.</span><span style="color:#7131a9;">layer</span><span style="color:#000000;"> </span>renderInContext<span style="color:#000000;">:</span>UIGraphicsGetCurrentContext<span style="color:#000000;">()];</span></p>
<p style="font:10px Monaco;color:#410a81;margin:0;"><span style="color:#000000;"><span style="white-space:pre;"> </span></span><span style="color:#7131a9;">UIImage</span><span style="color:#000000;"> *backgroundImage = </span>UIGraphicsGetImageFromCurrentImageContext<span style="color:#000000;">();</span></p>
<p style="font:10px Monaco;color:#578187;margin:0;"><span style="color:#000000;"><span style="white-space:pre;"> </span>[</span>mBottomPartOfMainBackgroundView<span style="color:#000000;"> </span><span style="color:#410a81;">setImage</span><span style="color:#000000;">:backgroundImage];</span></p>
<p style="font:10px Monaco;min-height:14px;margin:0;"><span style="white-space:pre;"> </span></p>
<p style="font:10px Monaco;color:#1c8700;margin:0;"><span style="color:#000000;"><span style="white-space:pre;"> </span></span>//set the bounds such that the we hide the part of the main content image, which is visible just above the Folder View.</p>
<p style="font:10px Monaco;color:#1c8700;margin:0;"><span style="color:#000000;"><span style="white-space:pre;"> </span></span>//This gets the continuation effect on the image once the folder view appears on screen</p>
<p style="font:10px Monaco;color:#578187;margin:0;"><span style="color:#000000;"><span style="white-space:pre;"> </span>[</span>mBottomPartOfMainBackgroundView<span style="color:#000000;">.</span><span style="color:#7131a9;">superview</span><span style="color:#000000;"> </span><span style="color:#410a81;">setBounds</span><span style="color:#000000;">:</span><span style="color:#410a81;">CGRectMake</span><span style="color:#000000;">(</span><span style="color:#3f00d8;">0.0</span><span style="color:#000000;">, selectedFolderPoint.</span><span style="color:#7131a9;">y</span><span style="color:#000000;"> + </span>mSelectedArrowTipView<span style="color:#000000;">.</span><span style="color:#7131a9;">frame</span><span style="color:#000000;">.</span><span style="color:#7131a9;">size</span><span style="color:#000000;">.</span><span style="color:#7131a9;">height</span><span style="color:#000000;">, </span>mMainBackgroundView<span style="color:#000000;">.</span><span style="color:#7131a9;">frame</span><span style="color:#000000;">.</span><span style="color:#7131a9;">size</span><span style="color:#000000;">.</span><span style="color:#7131a9;">width</span><span style="color:#000000;">, </span>mMainBackgroundView<span style="color:#000000;">.</span><span style="color:#7131a9;">frame</span><span style="color:#000000;">.</span><span style="color:#7131a9;">size</span><span style="color:#000000;">.</span><span style="color:#7131a9;">height</span><span style="color:#000000;">)];</span></p>
<p style="font:10px Monaco;color:#578187;margin:0;"><span style="color:#000000;"><br /></span></p>
<p style="font:10px Monaco;margin:0;">}</p>
</blockquote>
<p> </p>
<p><strong>STEP 2: Layout the Folder View(Layer 2 &amp; 2.1) and Bottom Part Of Main Content View (Layer -3)</strong></p>
<ul>
<li>Folder View and Arrow View are grouped in Single View.</li>
<li>Place The Arrow View such that it is right below and to the Center of the Tapped Folder Icon Tapped</li>
<li>Place the Folder View Just below Arrow View</li>
</ul>
<blockquote>
<p style="font:10px Monaco;margin:0;">-(<span style="color:#b411a3;">void</span>)layoutBottomPartOfMainViewRelativeToPointInMainView:(<span style="color:#7131a9;">CGPoint</span>)selectedFolderPoint</p>
<p style="font:10px Monaco;margin:0;">{</p>
<p style="font:10px Monaco;color:#1c8700;margin:0;"><span style="color:#000000;"><span style="white-space:pre;"> </span></span>//Place the Folder View Just below Arrow View</p>
<p style="font:10px Monaco;margin:0;"><span style="white-space:pre;"> </span><span style="color:#7131a9;">CGRect</span> folderViewFrame = [<span style="color:#578187;">mFolderView</span> <span style="color:#410a81;">frame</span>];</p>
<p style="font:10px Monaco;margin:0;"><span style="white-space:pre;"> </span>folderViewFrame.<span style="color:#7131a9;">origin</span>.<span style="color:#7131a9;">y</span> = <span style="color:#410a81;">floorf</span>(selectedFolderPoint.<span style="color:#7131a9;">y</span>);</p>
<p style="font:10px Monaco;margin:0;">[<span style="color:#578187;">mFolderView</span> <span style="color:#410a81;">setFrame</span>:folderViewFrame];<span style="white-space:pre;"> </span></p>
<p style="font:10px Monaco;min-height:14px;margin:0;"><span style="white-space:pre;"> </span></p>
<p style="font:10px Monaco;color:#1c8700;margin:0;"><span style="color:#000000;"><span style="white-space:pre;"> </span></span>//making sure the View which displays bottom part of Main Backgorund View is just below  the Folder View</p>
<p style="font:10px Monaco;color:#578187;margin:0;"><span style="color:#000000;"><span style="white-space:pre;"> </span></span><span style="color:#7131a9;">CGRect</span><span style="color:#000000;"> maskFrame = </span>mBottomPartOfMainBackgroundView<span style="color:#000000;">.</span><span style="color:#7131a9;">superview</span><span style="color:#000000;">.</span><span style="color:#7131a9;">frame</span><span style="color:#000000;">;</span></p>
<p style="font:10px Monaco;margin:0;"><span style="white-space:pre;"> </span>maskFrame.<span style="color:#7131a9;">origin</span>.<span style="color:#7131a9;">y</span> = folderViewFrame.<span style="color:#7131a9;">origin</span>.<span style="color:#7131a9;">y</span> + <span style="color:#578187;">mSelectedArrowTipView</span>.<span style="color:#7131a9;">frame</span>.<span style="color:#7131a9;">size</span>.<span style="color:#7131a9;">height</span>;</p>
<p style="font:10px Monaco;color:#578187;margin:0;"><span style="color:#000000;"><span style="white-space:pre;"> </span></span>mBottomPartOfMainBackgroundView<span style="color:#000000;">.</span><span style="color:#7131a9;">superview</span><span style="color:#000000;">.</span><span style="color:#7131a9;">frame</span><span style="color:#000000;"> = maskFrame;</span></p>
<p style="font:10px Monaco;min-height:14px;margin:0;"><span style="white-space:pre;"> </span></p>
<p style="font:10px Monaco;color:#1c8700;margin:0;"><span style="color:#000000;"><span style="white-space:pre;"> </span></span>//Place The Arrow View such that it is right below and to the Center of the Tapped Folder Icon Tapped</p>
<p style="font:10px Monaco;color:#410a81;margin:0;"><span style="color:#000000;"><span style="white-space:pre;"> </span>[</span><span style="color:#7131a9;">UIView</span><span style="color:#000000;"> </span>setAnimationsEnabled<span style="color:#000000;">:</span><span style="color:#b411a3;">NO</span><span style="color:#000000;">];</span></p>
<p style="font:10px Monaco;margin:0;"><span style="white-space:pre;"> </span><span style="color:#578187;">mSelectedArrowTipView</span>.<span style="color:#7131a9;">center</span> = <span style="color:#410a81;">CGPointMake</span>(selectedFolderPoint.<span style="color:#7131a9;">x</span>, <span style="color:#3f00d8;">0.0</span>);</p>
<p style="font:10px Monaco;color:#578187;margin:0;"><span style="color:#000000;"><span style="white-space:pre;"> </span></span><span style="color:#7131a9;">CGRect</span><span style="color:#000000;"> arrowFrame = </span>mSelectedArrowTipView<span style="color:#000000;">.</span><span style="color:#7131a9;">frame</span><span style="color:#000000;">;</span></p>
<p style="font:10px Monaco;margin:0;"><span style="white-space:pre;"> </span>arrowFrame.<span style="color:#7131a9;">origin</span>.<span style="color:#7131a9;">y</span> = <span style="color:#3f00d8;">0.0</span>;</p>
<p style="font:10px Monaco;color:#578187;margin:0;"><span style="color:#000000;"><span style="white-space:pre;"> </span></span>mSelectedArrowTipView<span style="color:#000000;">.</span><span style="color:#7131a9;">frame</span><span style="color:#000000;"> = arrowFrame;</span></p>
<p style="font:10px Monaco;min-height:14px;margin:0;"> </p>
<p style="font:10px Monaco;color:#410a81;margin:0;"><span style="color:#000000;"><span style="white-space:pre;"> </span>[</span><span style="color:#7131a9;">UIView</span><span style="color:#000000;"> </span>setAnimationsEnabled<span style="color:#000000;">:</span><span style="color:#b411a3;">YES</span><span style="color:#000000;">];</span></p>
<p style="font:10px Monaco;margin:0;">}</p>
<p style="font:11px Monaco;margin:0;"><span style="font-family:Helvetica;"><span style="font-size:medium;"><span style="font-family:Monaco;font-size:small;"><span style="font-size:11px;"><br /></span></span></span></span></p>
</blockquote>
<p> </p>
<p><strong>STEP 3- Push The Layer-3 which hosts the other part of the Main Content View</strong></p>
<blockquote>
<p style="font:10px Monaco;margin:0;">-(<span style="color:#b411a3;">void</span>)layoutFinalFrameOfBottomPartOfMainContentView</p>
<p style="font:10px Monaco;margin:0;">{</p>
<p style="font:10px Monaco;color:#1c8700;margin:0;"><span style="color:#000000;"><span style="white-space:pre;"> </span></span>//Push The Layer-3 which hosts the other part of the Main Content View</p>
<p style="font:10px Monaco;color:#578187;margin:0;"><span style="color:#000000;"><span style="white-space:pre;"> </span></span><span style="color:#7131a9;">CGRect</span><span style="color:#000000;"> maskFrame = </span>mBottomPartOfMainBackgroundView<span style="color:#000000;">.</span><span style="color:#7131a9;">superview</span><span style="color:#000000;">.</span><span style="color:#7131a9;">frame</span><span style="color:#000000;">;</span></p>
<p style="font:10px Monaco;min-height:14px;margin:0;"><span style="white-space:pre;"> </span></p>
<p style="font:10px Monaco;color:#7131a9;margin:0;"><span style="color:#000000;"><span style="white-space:pre;"> </span>maskFrame.</span>origin<span style="color:#000000;">.</span>y<span style="color:#000000;"> = </span><span style="color:#578187;">mFolderView</span><span style="color:#000000;">.</span>frame<span style="color:#000000;">.</span>origin<span style="color:#000000;">.</span>y<span style="color:#000000;"> + </span><span style="color:#578187;">mFolderView</span><span style="color:#000000;">.</span>frame<span style="color:#000000;">.</span>size<span style="color:#000000;">.</span>height<span style="color:#000000;">;</span></p>
<p style="font:10px Monaco;color:#578187;margin:0;"><span style="color:#000000;"><span style="white-space:pre;"> </span></span>mBottomPartOfMainBackgroundView<span style="color:#000000;">.</span><span style="color:#7131a9;">superview</span><span style="color:#000000;">.</span><span style="color:#7131a9;">frame</span><span style="color:#000000;"> = maskFrame;</span></p>
<p style="font:10px Monaco;margin:0;">}</p>
</blockquote>
<p> </p>
<p><span style="font-family:Helvetica;"><span><em>Thats it !!</em> The above 3 steps would be called upon tapping a Folder  Icon as show in below code snippet</span></span></p>
<blockquote>
<p style="font:10px Monaco;margin:0;">-(<span style="color:#b411a3;">IBAction</span>)openFolder:(<span style="color:#b411a3;">id</span>)sender</p>
<p style="font:10px Monaco;margin:0;">{<span style="white-space:pre;"> </span></p>
<p style="font:10px Monaco;color:#1c8700;margin:0;"><span style="color:#000000;"><span style="white-space:pre;"> </span></span>//get the center point of the tapped folder</p>
<p style="font:10px Monaco;margin:0;"><span style="white-space:pre;"> </span><span style="color:#7131a9;">CGPoint</span> selectedFolderPoint = <span style="color:#410a81;">CGPointMake</span>([sender <span style="color:#410a81;">center</span>].<span style="color:#7131a9;">x</span>, [sender <span style="color:#410a81;">frame</span>].<span style="color:#7131a9;">origin</span>.<span style="color:#7131a9;">y</span> + [sender <span style="color:#410a81;">frame</span>].<span style="color:#7131a9;">size</span>.<span style="color:#7131a9;">height</span>);</p>
<p style="font:10px Monaco;min-height:14px;margin:0;"><span style="white-space:pre;"> </span></p>
<p style="font:10px Monaco;color:#1c8700;margin:0;"><span style="color:#000000;"><span style="white-space:pre;"> </span></span><span style="color:#b411a3;">if</span><span style="color:#000000;">( </span><span style="color:#578187;">mFolderView</span><span style="color:#000000;">.</span><span style="color:#7131a9;">hidden</span><span style="color:#000000;"> )</span>//if folder is not opened</p>
<p style="font:10px Monaco;margin:0;"><span style="white-space:pre;"> </span>{</p>
<p style="font:10px Monaco;color:#1c8700;margin:0;"><span style="color:#000000;"><span style="white-space:pre;"> </span></span>//open folder animation</p>
<p style="font:10px Monaco;color:#1c8700;margin:0;"><span style="color:#000000;"><span style="white-space:pre;"> </span></span>//STEP 1: Capture the Main View Content into an image</p>
<p style="font:10px Monaco;color:#38595d;margin:0;"><span style="color:#000000;"><span style="white-space:pre;"> </span>[</span><span style="color:#b411a3;">self</span><span style="color:#000000;"> </span>captureImageFromPointAndSetupMaskView<span style="color:#000000;">:selectedFolderPoint];</span></p>
<p style="font:10px Monaco;min-height:14px;margin:0;"><span style="white-space:pre;"> </span></p>
<p style="font:10px Monaco;color:#1c8700;margin:0;"><span style="color:#000000;"><span style="white-space:pre;"> </span></span>//STEP 2: Layout the Folder View(Layer 2 &amp; 2.1) and Bottom Part Of Main Content View (Layer -3)</p>
<p style="font:10px Monaco;color:#38595d;margin:0;"><span style="color:#000000;"><span style="white-space:pre;"> </span>[</span><span style="color:#b411a3;">self</span><span style="color:#000000;"> </span>layoutBottomPartOfMainViewRelativeToPointInMainView<span style="color:#000000;">:selectedFolderPoint];</span></p>
<p style="font:10px Monaco;min-height:14px;margin:0;"><span style="white-space:pre;"> </span></p>
<p style="font:10px Monaco;color:#410a81;margin:0;"><span style="color:#000000;"><span style="white-space:pre;"> </span>[</span><span style="color:#7131a9;">UIView</span><span style="color:#000000;"> </span>beginAnimations<span style="color:#000000;">:</span><span style="color:#c62826;">@"FolderOpen"</span><span style="color:#000000;"> </span>context<span style="color:#000000;">:</span><span style="color:#b411a3;">NULL</span><span style="color:#000000;">];</span></p>
<p style="font:10px Monaco;color:#410a81;margin:0;"><span style="color:#000000;"><span style="white-space:pre;"> </span>[</span><span style="color:#7131a9;">UIView</span><span style="color:#000000;"> </span>setAnimationDuration<span style="color:#000000;">:</span><span style="color:#3f00d8;">0.5</span><span style="color:#000000;">];</span></p>
<p style="font:10px Monaco;color:#410a81;margin:0;"><span style="color:#000000;"><span style="white-space:pre;"> </span>[</span><span style="color:#7131a9;">UIView</span><span style="color:#000000;"> </span>setAnimationCurve<span style="color:#000000;">:</span>UIViewAnimationCurveEaseOut<span style="color:#000000;">];<span style="white-space:pre;"> </span></span></p>
<p style="font:10px Monaco;color:#1c8700;margin:0;"><span style="color:#000000;"><span style="white-space:pre;"> </span></span>//captures the main background view&#8217;s image</p>
<p style="font:10px Monaco;min-height:14px;margin:0;"><span style="white-space:pre;"> </span></p>
<p style="font:10px Monaco;color:#578187;margin:0;"><span style="color:#000000;"><span style="white-space:pre;"> </span></span>mFolderView<span style="color:#000000;">.</span><span style="color:#7131a9;">hidden</span><span style="color:#000000;">=</span><span style="color:#b411a3;">NO</span><span style="color:#000000;">;</span></p>
<p style="font:10px Monaco;color:#578187;margin:0;"><span style="color:#000000;"><span style="white-space:pre;"> </span></span>mBottomPartOfMainBackgroundView<span style="color:#000000;">.</span><span style="color:#7131a9;">superview</span><span style="color:#000000;">.</span><span style="color:#7131a9;">hidden</span><span style="color:#000000;">=</span><span style="color:#b411a3;">NO</span><span style="color:#000000;">;</span></p>
<p style="font:10px Monaco;color:#1c8700;margin:0;"><span style="color:#000000;"><span style="white-space:pre;"> </span></span>//STEP 3- Push The Layer-3 which hosts the other part of the Main Content View</p>
<p style="font:10px Monaco;color:#38595d;margin:0;"><span style="color:#000000;"><span style="white-space:pre;"> </span>[</span><span style="color:#b411a3;">self</span><span style="color:#000000;"> </span>layoutFinalFrameOfBottomPartOfMainContentView<span style="color:#000000;">];</span></p>
<p style="font:10px Monaco;color:#410a81;margin:0;"><span style="color:#000000;"><span style="white-space:pre;"> </span>[</span><span style="color:#7131a9;">UIView</span><span style="color:#000000;"> </span>commitAnimations<span style="color:#000000;">];</span></p>
<p style="font:10px Monaco;margin:0;"><span style="white-space:pre;"> </span>}</p>
<p style="font:10px Monaco;color:#b411a3;margin:0;"><span style="color:#000000;"><span style="white-space:pre;"> </span></span>else<span style="color:#000000;"> {</span></p>
<p style="font:10px Monaco;min-height:14px;margin:0;"><span style="white-space:pre;"> </span></p>
<p style="font:10px Monaco;color:#1c8700;margin:0;"><span style="color:#000000;"><span style="white-space:pre;"> </span></span>//close folder animation</p>
<p style="font:10px Monaco;color:#410a81;margin:0;"><span style="color:#000000;"><span style="white-space:pre;"> </span>[</span><span style="color:#7131a9;">UIView</span><span style="color:#000000;"> </span>beginAnimations<span style="color:#000000;">:</span><span style="color:#c62826;">@"FolderClose"</span><span style="color:#000000;"> </span>context<span style="color:#000000;">:</span><span style="color:#b411a3;">NULL</span><span style="color:#000000;">];</span></p>
<p style="font:10px Monaco;color:#410a81;margin:0;"><span style="color:#000000;"><span style="white-space:pre;"> </span>[</span><span style="color:#7131a9;">UIView</span><span style="color:#000000;"> </span>setAnimationDuration<span style="color:#000000;">:</span><span style="color:#3f00d8;">0.5</span><span style="color:#000000;">];</span></p>
<p style="font:10px Monaco;color:#410a81;margin:0;"><span style="color:#000000;"><span style="white-space:pre;"> </span>[</span><span style="color:#7131a9;">UIView</span><span style="color:#000000;"> </span>setAnimationCurve<span style="color:#000000;">:</span>UIViewAnimationCurveEaseOut<span style="color:#000000;">];</span></p>
<p style="font:10px Monaco;color:#410a81;margin:0;"><span style="color:#000000;"><span style="white-space:pre;"> </span>[</span><span style="color:#7131a9;">UIView</span><span style="color:#000000;"> </span>setAnimationDidStopSelector<span style="color:#000000;">:</span><span style="color:#b411a3;">@selector</span><span style="color:#000000;">(</span><span style="color:#38595d;">animation</span><span style="color:#000000;">:</span><span style="color:#38595d;">didFinish</span><span style="color:#000000;">:</span><span style="color:#38595d;">context</span><span style="color:#000000;"> <img src='http://s0.wp.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> ];</span></p>
<p style="font:10px Monaco;color:#410a81;margin:0;"><span style="color:#000000;"><span style="white-space:pre;"> </span>[</span><span style="color:#7131a9;">UIView</span><span style="color:#000000;"> </span>setAnimationDelegate<span style="color:#000000;">:</span><span style="color:#b411a3;">self</span><span style="color:#000000;">];</span></p>
<p style="font:10px Monaco;color:#1c8700;margin:0;"><span style="color:#000000;"><span style="white-space:pre;"> </span></span>//restore the layout and hide the folder view after animation</p>
<p style="font:10px Monaco;margin:0;"><span style="white-space:pre;"> </span>[<span style="color:#b411a3;">self</span> <span style="color:#38595d;">closeFolder</span>:selectedFolderPoint];</p>
<p style="font:10px Monaco;color:#410a81;margin:0;"><span style="color:#000000;"><span style="white-space:pre;"> </span>[</span><span style="color:#7131a9;">UIView</span><span style="color:#000000;"> </span>commitAnimations<span style="color:#000000;">];</span></p>
<p style="font:10px Monaco;margin:0;"><span style="white-space:pre;"> </span>}</p>
<p style="font:10px Monaco;margin:0;">}</p>
</blockquote>
<p> </p>
<h1>3. Result</h1>
<p>Download the Full Source Code Here : <a href="http://cl.ly/400o0Q1c2M3f2W2J4725">iOS Open Folder Animation.zip</a></p>
<p>A Video of the Sample Code can be found here: <a href="http://www.youtube.com/watch?v=xBB1humerBw">iOS Open Folder Animation Video</a></p>
<span style="text-align:center; display: block;"><a href="http://iphone2020.wordpress.com/2011/02/17/ios-open-folder-animation/"><img src="http://img.youtube.com/vi/xBB1humerBw/2.jpg" alt="" /></a></span>
<p>If you like this post, Please leave your feedback / comment and Share this (See below for sharing options) to spread to all others who might be interested <img src='http://s0.wp.com/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> </p>
<p>Happy Coding <img src='http://s0.wp.com/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> </p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/iphone2020.wordpress.com/356/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/iphone2020.wordpress.com/356/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/iphone2020.wordpress.com/356/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/iphone2020.wordpress.com/356/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/iphone2020.wordpress.com/356/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/iphone2020.wordpress.com/356/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/iphone2020.wordpress.com/356/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/iphone2020.wordpress.com/356/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/iphone2020.wordpress.com/356/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/iphone2020.wordpress.com/356/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/iphone2020.wordpress.com/356/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/iphone2020.wordpress.com/356/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/iphone2020.wordpress.com/356/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/iphone2020.wordpress.com/356/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=iphone2020.wordpress.com&amp;blog=9201814&amp;post=356&amp;subd=iphone2020&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://iphone2020.wordpress.com/2011/02/17/ios-open-folder-animation/feed/</wfw:commentRss>
		<slash:comments>13</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/28ecd692537748282f01a42f2c2ac910?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">Bharath</media:title>
		</media:content>

		<media:content url="http://iphone2020.files.wordpress.com/2011/02/ios-folder-view.png" medium="image">
			<media:title type="html">iOS Folder View.PNG</media:title>
		</media:content>

		<media:content url="http://iphone2020.files.wordpress.com/2011/02/ios_folder_view_plan1.png" medium="image">
			<media:title type="html">iOS_Folder_View_Plan.png</media:title>
		</media:content>
	</item>
		<item>
		<title>How to compare objects of your custom classes?</title>
		<link>http://iphone2020.wordpress.com/2010/12/30/how-to-compare-objects-of-your-custom-classes/</link>
		<comments>http://iphone2020.wordpress.com/2010/12/30/how-to-compare-objects-of-your-custom-classes/#comments</comments>
		<pubDate>Thu, 30 Dec 2010 17:18:07 +0000</pubDate>
		<dc:creator>bharath2020</dc:creator>
				<category><![CDATA[Objective C]]></category>
		<category><![CDATA[compare objects]]></category>
		<category><![CDATA[hash]]></category>
		<category><![CDATA[how to search in array]]></category>
		<category><![CDATA[isEqual]]></category>
		<category><![CDATA[NSArray]]></category>
		<category><![CDATA[NSMutableArray]]></category>
		<category><![CDATA[sortedArray]]></category>
		<category><![CDATA[sortUsingSelector]]></category>

		<guid isPermaLink="false">https://iphone2020.wordpress.com/?p=329</guid>
		<description><![CDATA[[This post is intended only for audiences with Basic knowledge in Objective-C] With Cocoa / UIKit framework has built-in support for comparing objects like NSDate, NSString, NSData, NSNumber and few others which would help us to identify whether two objects are EQUAL, GREATER THAN or LESSER THAN the other object. This in-turn is used in [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=iphone2020.wordpress.com&amp;blog=9201814&amp;post=329&amp;subd=iphone2020&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p><strong>[This post is intended only for audiences with Basic knowledge in Objective-C]</strong></p>
<p>With Cocoa / UIKit framework has built-in support for comparing objects like NSDate, NSString, NSData, NSNumber and few others which would help us to identify whether two objects are EQUAL, GREATER THAN or LESSER THAN the other object. This in-turn is used in cases like sorting, searching.</p>
<p> </p>
<p>We would like to see how the same can be achieved for the custom classes we write, where we can specify the Equality condition by our own.</p>
<p>By default, NSObject class allows us to determine equality between two objects whose class is derived from NSObject through</p>
<p><strong>isEqual:</strong> method,</p>
<p>where Apple documentation defines it as</p>
<blockquote>
<p>&#8220;<span style="font-family:'Lucida Grande', Geneva, Helvetica, Arial, sans-serif;font-size:12px;"><em>This method defines what it means for instances to be equal. For example, a container object might define two containers as equal if their corresponding objects all respond YES</em></span><span style="font-family:'Lucida Grande', Geneva, Helvetica, Arial, sans-serif;font-size:12px;"><em> to an isEqual:</em></span><span style="font-family:'Lucida Grande', Geneva, Helvetica, Arial, sans-serif;font-size:12px;"><em> request. See the <strong>NSArray</strong>, <strong>NSDictionary</strong>, <strong>NSString</strong> and <strong>NSData</strong></em></span><span style="font-family:'Lucida Grande', Geneva, Helvetica, Arial, sans-serif;font-size:12px;"><em> class specifications for examples of the use of this method.</em></span></p>
<p style="margin-top:0;margin-bottom:.833em;font:normal normal normal 100%/normal 'Lucida Grande', Geneva, Helvetica, Arial, sans-serif;"><em>If two objects are equal, they must have the same hash value. This last point is particularly important if you define <strong>isEqual:</strong></em><em> in a subclass and intend to put instances of that subclass into a collection. Make sure you also define <span style="font-family:Courier, Consolas, monospace;font-size:small;"><span style="font-size:13px;"><strong>hash</strong></span></span></em><em> in your subclass.</em> &#8220;</p>
</blockquote>
<p style="margin-top:0;margin-bottom:.833em;font:normal normal normal 100%/normal 'Lucida Grande', Geneva, Helvetica, Arial, sans-serif;"> </p>
<p style="margin-top:0;margin-bottom:.833em;font:normal normal normal 100%/normal 'Lucida Grande', Geneva, Helvetica, Arial, sans-serif;"> </p>
<p style="margin-top:0;margin-bottom:.833em;font:normal normal normal 100%/normal 'Lucida Grande', Geneva, Helvetica, Arial, sans-serif;"><span style="font-family:Helvetica;font-size:medium;">In short, At NSObject (root class) level, two objects are said be equal </span></p>
<ul>
<li><span style="font-family:Helvetica;font-size:medium;"> if their </span><span style="font-family:Helvetica;font-size:medium;"><strong>hash</strong></span><span style="font-family:Helvetica;font-size:medium;"> value are same</span></li>
<li><span style="font-family:Helvetica;font-size:medium;"> two objects have same address.</span></li>
</ul>
<p>Well this may not be the case when we write our custom class,  for example,  two NSString objects might have different  pointer addresses, but have same string value. Hence, one must override <strong>hash</strong> method and<strong> isEqual:</strong> method of NSObject. NSString class would have hash and isEqual defined as below</p>
<blockquote>
<p><span style="font-family:Courier;">- (NSUInteger)hash</span></p>
<p><span style="font-family:Courier;">{</span></p>
<p><span style="font-family:Courier;"><span style="color:#5d40fe;"><span style="color:#3f8646;">//return the hash value generated from the string.</span></span></span></p>
<p><span style="font-family:Courier;">}</span></p>
<p><span style="font-family:Courier;">-(BOOL)isEqual:(id)otherObject</span></p>
<p><span style="font-family:Courier;">{</span></p>
<p><span style="font-family:Courier;"> // return strcmp ( [self's cString] , [otherObject's cString] )</span></p>
<p>}</p>
</blockquote>
<p> </p>
<p><span style="font-family:Helvetica;"><strong>Where do I apply this?</strong></span></p>
<p>Well, if you encounter a situation where you have an array (or in general collection) of Employees for eg, and you would want to remove an employee of particular ID, then you can do it with a single call like this. This would save you from writing an search algorithm.</p>
<blockquote>
<p>Employee *employeeToRemove;</p>
<p>[myEmployees <strong>removeObject</strong>: employeeToRemove]; <span style="font-family:Helvetica;"><span style="color:#418a48;">// assuming myEmployees is of type NSMutableArray</span></span></p>
</blockquote>
<p>As Apple document says, removeObject and its variants (see below list for variants) would pick the object to remove for which <strong>isEqual:</strong> would return TRUE</p>
<blockquote>
<ul style="list-style-type:none;">
<li style="font:13px Courier;margin:0;">– removeObject:</li>
<li style="font:13px Courier;margin:0;">– removeObjectIdenticalTo:</li>
<li style="font:13px Courier;margin:0;">– removeObjectIdenticalTo:inRange:</li>
<li style="font:13px Courier;margin:0;">– removeObjectsInArray:</li>
</ul>
<ul style="list-style-type:none;">
<li style="font:13px Courier;margin:0;">– indexOfObject:</li>
<li style="font:13px Courier;margin:0;">– indexOfObject:inRange:</li>
<li style="font:13px Courier;margin:0;">– indexOfObjectIdenticalTo:</li>
<li style="font:13px Courier;margin:0;">– indexOfObjectIdenticalTo:inRange:</li>
</ul>
<ul style="list-style-type:none;">
</ul>
</blockquote>
<p> </p>
<p>Another method that does fall in this category, is <strong>compare:</strong> method (actually you can give a custom name to this method ) whose signature is</p>
<blockquote>
<p>-(NSComparisonResult)<strong>compare</strong> <img src='http://s0.wp.com/wp-includes/images/smilies/icon_sad.gif' alt=':(' class='wp-smiley' /> id)otherObject</p>
</blockquote>
<p>NSComparisonResult is an enum with values  as below</p>
<blockquote>
<pre class="declaration" style="font-size:13px;font-family:Courier, Consolas, monospace;color:#666666;white-space:pre;margin:-.083em .333em -.25em .5em;">
<p style="font:13px Courier;margin:0;">enum {
<p style="font:13px Courier;margin:0;"><a href="///Developer/Platforms/iPhoneOS.platform/Developer/Documentation/DocSets/com.apple.adc.documentation.AppleiOS4_1.iOSLibrary.docset/Contents/Resources/Documents/documentation/Cocoa/Reference/Foundation/Miscellaneous/Foundation_DataTypes/Reference/reference.html#//apple_ref/doc/c_ref/NSOrderedAscending">NSOrderedAscending</a> = -1,
<p style="font:13px Courier;margin:0;"><a href="///Developer/Platforms/iPhoneOS.platform/Developer/Documentation/DocSets/com.apple.adc.documentation.AppleiOS4_1.iOSLibrary.docset/Contents/Resources/Documents/documentation/Cocoa/Reference/Foundation/Miscellaneous/Foundation_DataTypes/Reference/reference.html#//apple_ref/doc/c_ref/NSOrderedSame">NSOrderedSame</a>,
<p style="font:13px Courier;margin:0;"><a href="///Developer/Platforms/iPhoneOS.platform/Developer/Documentation/DocSets/com.apple.adc.documentation.AppleiOS4_1.iOSLibrary.docset/Contents/Resources/Documents/documentation/Cocoa/Reference/Foundation/Miscellaneous/Foundation_DataTypes/Reference/reference.html#//apple_ref/doc/c_ref/NSOrderedDescending">NSOrderedDescending</a>
<p style="font:13px Courier;margin:0;">};
</pre>
</blockquote>
<p> </p>
<p>With this method implemented in your Custom class (for example, Employee class), you can sort your objects in a collection (NSMutableArray , NSArray) with a single statement</p>
<blockquote>
<p>[ myEmployee <strong>sortArrayUsingSelector</strong>(compare:)];</p>
</blockquote>
<p>Other variants where this strategy can be used are</p>
<blockquote>
<p style="font:12px Helvetica;margin:0 0 12px;">– sortedArrayUsingSelector:</p>
<p style="font:12px Helvetica;margin:0 0 12px;">– sortUsingSelector:</p>
</blockquote>
<p> </p>
<p>Hope this tutorial find useful for you.</p>
<p>Happy Coding <img src='http://s0.wp.com/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> </p>
<p> </p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/iphone2020.wordpress.com/329/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/iphone2020.wordpress.com/329/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/iphone2020.wordpress.com/329/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/iphone2020.wordpress.com/329/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/iphone2020.wordpress.com/329/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/iphone2020.wordpress.com/329/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/iphone2020.wordpress.com/329/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/iphone2020.wordpress.com/329/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/iphone2020.wordpress.com/329/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/iphone2020.wordpress.com/329/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/iphone2020.wordpress.com/329/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/iphone2020.wordpress.com/329/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/iphone2020.wordpress.com/329/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/iphone2020.wordpress.com/329/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=iphone2020.wordpress.com&amp;blog=9201814&amp;post=329&amp;subd=iphone2020&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://iphone2020.wordpress.com/2010/12/30/how-to-compare-objects-of-your-custom-classes/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/28ecd692537748282f01a42f2c2ac910?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">Bharath</media:title>
		</media:content>
	</item>
		<item>
		<title>Simple Steps to unlink your E-mail from AppleID</title>
		<link>http://iphone2020.wordpress.com/2010/12/20/simple-steps-to-unlink-your-e-mail-from-appleid/</link>
		<comments>http://iphone2020.wordpress.com/2010/12/20/simple-steps-to-unlink-your-e-mail-from-appleid/#comments</comments>
		<pubDate>Mon, 20 Dec 2010 18:13:38 +0000</pubDate>
		<dc:creator>bharath2020</dc:creator>
				<category><![CDATA[Utilities]]></category>
		<category><![CDATA[appleid]]></category>
		<category><![CDATA[itunes free account]]></category>
		<category><![CDATA[payment option]]></category>
		<category><![CDATA[remove appleID]]></category>
		<category><![CDATA[unlink Apple ID]]></category>

		<guid isPermaLink="false">https://iphone2020.wordpress.com/?p=323</guid>
		<description><![CDATA[Wondering how to unlink your email from AppleID? Don&#8217;t worry, you landed at right place. Follow the simple steps below 1. Create a dummy email ID (maybe from not so popular Email-Services) 2. Go to appleid.apple.com 3. Clicl &#8220;Manage you Account&#8221;  and Enter your appleID credentials, for which you are willing to unlink now 4. [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=iphone2020.wordpress.com&amp;blog=9201814&amp;post=323&amp;subd=iphone2020&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Wondering how to unlink your email from AppleID? Don&#8217;t worry, you landed at right place. Follow the simple steps below</p>
<p><strong>1.</strong> Create a dummy email ID (maybe from not so popular Email-Services)</p>
<p><strong>2</strong>. Go to <a href="http://appleid.apple.com">appleid.apple.com</a></p>
<p><strong>3.</strong> Clicl &#8220;Manage you Account&#8221;  and Enter your appleID credentials, for which you are willing to unlink now</p>
<p><img title="Screen shot 2010-12-20 at 11.32.57 PM.png" src="http://iphone2020.files.wordpress.com/2010/12/screen-shot-2010-12-20-at-11-32-57-pm.png?w=285&#038;h=199" border="0" alt="Screen shot 2010-12-20 at 11.32.57 PM.png" width="285" height="199" /></p>
<p><strong>4.</strong> After signing in successfully, Edit &#8220;AppleID and your Primary Email Address&#8221; section and enter the Dummy email address you had just created in Step1.</p>
<p> </p>
<p><img title="Screen shot 2010-12-20 at 11.37.19 PM.png" src="http://iphone2020.files.wordpress.com/2010/12/screen-shot-2010-12-20-at-11-37-19-pm.png?w=541&#038;h=182" border="0" alt="Screen shot 2010-12-20 at 11.37.19 PM.png" width="541" height="182" /></p>
<p><strong>5.</strong> After Editing, Click &#8216;Save Changes&#8217; and make sure you verify the new Email Address(Dummy Email) (Not sure if required)</p>
<p> </p>
<p>Well, We&#8217;re done!! your Email address is no longer linked to AppleID.</p>
<p><em>[ This was really helpful for me when I had accidentally created an AppleID with my primary Email and realized that I could not use it to download free Content / Apps from the AppStore as it would kept pinging me for Reviewing Billing Details, where the 'None' option was disappeared from Payment options ]</em></p>
<p>Hope you find it useful,</p>
<p>Njoy</p>
<p> </p>
<p> </p>
<p> </p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/iphone2020.wordpress.com/323/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/iphone2020.wordpress.com/323/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/iphone2020.wordpress.com/323/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/iphone2020.wordpress.com/323/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/iphone2020.wordpress.com/323/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/iphone2020.wordpress.com/323/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/iphone2020.wordpress.com/323/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/iphone2020.wordpress.com/323/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/iphone2020.wordpress.com/323/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/iphone2020.wordpress.com/323/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/iphone2020.wordpress.com/323/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/iphone2020.wordpress.com/323/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/iphone2020.wordpress.com/323/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/iphone2020.wordpress.com/323/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=iphone2020.wordpress.com&amp;blog=9201814&amp;post=323&amp;subd=iphone2020&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://iphone2020.wordpress.com/2010/12/20/simple-steps-to-unlink-your-e-mail-from-appleid/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/28ecd692537748282f01a42f2c2ac910?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">Bharath</media:title>
		</media:content>

		<media:content url="http://iphone2020.files.wordpress.com/2010/12/screen-shot-2010-12-20-at-11-32-57-pm.png" medium="image">
			<media:title type="html">Screen shot 2010-12-20 at 11.32.57 PM.png</media:title>
		</media:content>

		<media:content url="http://iphone2020.files.wordpress.com/2010/12/screen-shot-2010-12-20-at-11-37-19-pm.png" medium="image">
			<media:title type="html">Screen shot 2010-12-20 at 11.37.19 PM.png</media:title>
		</media:content>
	</item>
		<item>
		<title>Core Data v/s SQL Database</title>
		<link>http://iphone2020.wordpress.com/2010/08/26/core-data-vs-sql-database/</link>
		<comments>http://iphone2020.wordpress.com/2010/08/26/core-data-vs-sql-database/#comments</comments>
		<pubDate>Thu, 26 Aug 2010 15:28:58 +0000</pubDate>
		<dc:creator>bharath2020</dc:creator>
				<category><![CDATA[Core Data]]></category>
		<category><![CDATA[database]]></category>
		<category><![CDATA[iPhone]]></category>
		<category><![CDATA[SQLite]]></category>

		<guid isPermaLink="false">http://iphone2020.wordpress.com/?p=290</guid>
		<description><![CDATA[Found a Nice Article here<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=iphone2020.wordpress.com&amp;blog=9201814&amp;post=290&amp;subd=iphone2020&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p style="font:12px Helvetica;margin:0 0 12px;">Found a Nice Article <a href="http://blancer.com/tutorials/i-phone/72215/the-differences-between-core-data-and-a-database/"><span style="text-decoration:underline;">here</span></a></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/iphone2020.wordpress.com/290/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/iphone2020.wordpress.com/290/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/iphone2020.wordpress.com/290/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/iphone2020.wordpress.com/290/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/iphone2020.wordpress.com/290/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/iphone2020.wordpress.com/290/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/iphone2020.wordpress.com/290/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/iphone2020.wordpress.com/290/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/iphone2020.wordpress.com/290/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/iphone2020.wordpress.com/290/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/iphone2020.wordpress.com/290/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/iphone2020.wordpress.com/290/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/iphone2020.wordpress.com/290/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/iphone2020.wordpress.com/290/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=iphone2020.wordpress.com&amp;blog=9201814&amp;post=290&amp;subd=iphone2020&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://iphone2020.wordpress.com/2010/08/26/core-data-vs-sql-database/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/28ecd692537748282f01a42f2c2ac910?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">Bharath</media:title>
		</media:content>
	</item>
	</channel>
</rss>
