<?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/"
	>

<channel>
	<title>Notes of a Developer &#187; OOP</title>
	<atom:link href="http://www.developers-life.com/category/oop/feed" rel="self" type="application/rss+xml" />
	<link>http://www.developers-life.com</link>
	<description>Develop on Objective-C, UIKit, C, OpenGL for  iPhone, iPad, Mac OS X</description>
	<lastBuildDate>Fri, 03 Feb 2012 11:49:47 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>ScrollView with scroll&#8217;s indicators, which are shown all the time.</title>
		<link>http://www.developers-life.com/scrollview-with-scrolls-indicators-which-are-shown-all-the-time.html</link>
		<comments>http://www.developers-life.com/scrollview-with-scrolls-indicators-which-are-shown-all-the-time.html#comments</comments>
		<pubDate>Thu, 22 Dec 2011 09:53:13 +0000</pubDate>
		<dc:creator>Vladimir Boychentsov</dc:creator>
				<category><![CDATA[iOS]]></category>
		<category><![CDATA[iPad]]></category>
		<category><![CDATA[iPhone]]></category>
		<category><![CDATA[OOP]]></category>
		<category><![CDATA[Category]]></category>
		<category><![CDATA[objective-c]]></category>
		<category><![CDATA[pattern]]></category>
		<category><![CDATA[scroll]]></category>
		<category><![CDATA[UIImageView]]></category>
		<category><![CDATA[UIKit]]></category>
		<category><![CDATA[UIScrollView]]></category>

		<guid isPermaLink="false">http://www.developers-life.com/?p=1334</guid>
		<description><![CDATA[My simple solution by writing category for UIImageView, because scroller is imageview. How to use :) Just setup tag for your scrollview and you will get one with scroll indicators, which are shown all the time. 1234567891011121314151617181920212223242526272829303132#define noDisableVerticalScrollTag 836913 #define noDisableHorizontalScrollTag 836914 @implementation UIImageView &#40;ForScrollView&#41; - &#40;void&#41; setAlpha:&#40;float&#41;alpha &#123; &#160; &#160; &#160; &#160; if &#40;self.superview.tag [...]]]></description>
			<content:encoded><![CDATA[<p>My simple solution by writing category for UIImageView, because scroller is imageview.</p>
<p>How to use :)<br />
Just setup tag for your scrollview and you will get one with scroll indicators, which are shown all the time.</p>
<div class="codecolorer-container objc geshi" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:810px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br />3<br />4<br />5<br />6<br />7<br />8<br />9<br />10<br />11<br />12<br />13<br />14<br />15<br />16<br />17<br />18<br />19<br />20<br />21<br />22<br />23<br />24<br />25<br />26<br />27<br />28<br />29<br />30<br />31<br />32<br /></div></td><td><div class="objc codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #6e371a;">#define noDisableVerticalScrollTag 836913</span><br />
<span style="color: #6e371a;">#define noDisableHorizontalScrollTag 836914</span><br />
<br />
<span style="color: #a61390;">@implementation</span> UIImageView <span style="color: #002200;">&#40;</span>ForScrollView<span style="color: #002200;">&#41;</span> <br />
<br />
<span style="color: #002200;">-</span> <span style="color: #002200;">&#40;</span><span style="color: #a61390;">void</span><span style="color: #002200;">&#41;</span> setAlpha<span style="color: #002200;">:</span><span style="color: #002200;">&#40;</span><span style="color: #a61390;">float</span><span style="color: #002200;">&#41;</span>alpha <span style="color: #002200;">&#123;</span><br />
&nbsp; &nbsp; <br />
&nbsp; &nbsp; <span style="color: #a61390;">if</span> <span style="color: #002200;">&#40;</span>self.superview.tag <span style="color: #002200;">==</span> noDisableVerticalScrollTag<span style="color: #002200;">&#41;</span> <span style="color: #002200;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #a61390;">if</span> <span style="color: #002200;">&#40;</span>alpha <span style="color: #002200;">==</span> <span style="color: #2400d9;">0</span> <span style="color: #002200;">&amp;&amp;</span> self.autoresizingMask <span style="color: #002200;">==</span> UIViewAutoresizingFlexibleLeftMargin<span style="color: #002200;">&#41;</span> <span style="color: #002200;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #a61390;">if</span> <span style="color: #002200;">&#40;</span>self.frame.size.width &lt; <span style="color: #2400d9;">10</span> <span style="color: #002200;">&amp;&amp;</span> self.frame.size.height &gt; self.frame.size.width<span style="color: #002200;">&#41;</span> <span style="color: #002200;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; UIScrollView <span style="color: #002200;">*</span>sc <span style="color: #002200;">=</span> <span style="color: #002200;">&#40;</span>UIScrollView<span style="color: #002200;">*</span><span style="color: #002200;">&#41;</span>self.superview;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #a61390;">if</span> <span style="color: #002200;">&#40;</span>sc.frame.size.height &lt; sc.contentSize.height<span style="color: #002200;">&#41;</span> <span style="color: #002200;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #a61390;">return</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #002200;">&#125;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #002200;">&#125;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #002200;">&#125;</span><br />
&nbsp; &nbsp; <span style="color: #002200;">&#125;</span><br />
&nbsp; &nbsp; <br />
&nbsp; &nbsp; <span style="color: #a61390;">if</span> <span style="color: #002200;">&#40;</span>self.superview.tag <span style="color: #002200;">==</span> noDisableHorizontalScrollTag<span style="color: #002200;">&#41;</span> <span style="color: #002200;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #a61390;">if</span> <span style="color: #002200;">&#40;</span>alpha <span style="color: #002200;">==</span> <span style="color: #2400d9;">0</span> <span style="color: #002200;">&amp;&amp;</span> self.autoresizingMask <span style="color: #002200;">==</span> UIViewAutoresizingFlexibleTopMargin<span style="color: #002200;">&#41;</span> <span style="color: #002200;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #a61390;">if</span> <span style="color: #002200;">&#40;</span>self.frame.size.height &lt; <span style="color: #2400d9;">10</span> <span style="color: #002200;">&amp;&amp;</span> self.frame.size.height &lt; self.frame.size.width<span style="color: #002200;">&#41;</span> <span style="color: #002200;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; UIScrollView <span style="color: #002200;">*</span>sc <span style="color: #002200;">=</span> <span style="color: #002200;">&#40;</span>UIScrollView<span style="color: #002200;">*</span><span style="color: #002200;">&#41;</span>self.superview;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #a61390;">if</span> <span style="color: #002200;">&#40;</span>sc.frame.size.width &lt; sc.contentSize.width<span style="color: #002200;">&#41;</span> <span style="color: #002200;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #a61390;">return</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #002200;">&#125;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #002200;">&#125;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #002200;">&#125;</span><br />
&nbsp; &nbsp; <span style="color: #002200;">&#125;</span><br />
&nbsp; &nbsp; <br />
&nbsp; &nbsp; <span style="color: #002200;">&#91;</span>super setAlpha<span style="color: #002200;">:</span>alpha<span style="color: #002200;">&#93;</span>;<br />
<span style="color: #002200;">&#125;</span><br />
<span style="color: #a61390;">@end</span></div></td></tr></tbody></table></div>
<p>If you want both scroll it&#8217;s easy to change code.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.developers-life.com/scrollview-with-scrolls-indicators-which-are-shown-all-the-time.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Integrate High Scores service of mob1serv</title>
		<link>http://www.developers-life.com/integrate-high-scores-service-of-mob1serv.html</link>
		<comments>http://www.developers-life.com/integrate-high-scores-service-of-mob1serv.html#comments</comments>
		<pubDate>Mon, 08 Nov 2010 15:32:14 +0000</pubDate>
		<dc:creator>Vladimir Boychentsov</dc:creator>
				<category><![CDATA[Apple]]></category>
		<category><![CDATA[iPad]]></category>
		<category><![CDATA[iPhone]]></category>
		<category><![CDATA[Mob1serv]]></category>
		<category><![CDATA[OOP]]></category>
		<category><![CDATA[others]]></category>
		<category><![CDATA[iOS]]></category>
		<category><![CDATA[objective-c]]></category>
		<category><![CDATA[XML]]></category>

		<guid isPermaLink="false">http://www.developers-life.com/?p=1143</guid>
		<description><![CDATA[Для начала нужно немного ознакомиться на сайте mob1serv как это работает. Скачать либу с сайта или которую собрал я, немного модифицированную, добавил пару расширений. В мой версии также вложен пример с сайта mob1serv. Начнем&#8230; 1. Нам нужно проверить интернет соединение, лучше всего воспользоваться Reachability, уже готовым решением от разработчиков Apple. На этом моменте останавливаться не [...]]]></description>
			<content:encoded><![CDATA[<p>Для начала нужно немного ознакомиться на сайте <a href="http://www.mob1serv.com/high-scores/" target="blank">mob1serv</a> как это работает.</p>
<p>Скачать либу с <a href="http://mob1serv.com/downloads/library/HighscoresLibPackage.zip" target="blank">сайта</a> или которую <a href="http://depositfiles.com/files/bnmp5giee" target="blank">собрал я</a>, немного модифицированную, добавил пару расширений. В мой версии также вложен <a href="http://mob1serv.com/downloads/sample_projects/HighscoresTestExample.zip" target="blank">пример</a> с сайта mob1serv.</p>
<p>Начнем&#8230;</p>
<p>1. Нам нужно проверить интернет соединение, лучше всего воспользоваться <a href="http://developer.apple.com/library/ios/#samplecode/Reachability/Introduction/Intro.html" target="blank">Reachability</a>, уже готовым решением от разработчиков Apple. На этом моменте останавливаться не будем, в примере все показано.</p>
<p>2. Перед тем как мы будем работать непосредственно с API либы, продемострирую как ее подключить к проекту<br />
<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" width="425" height="344" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0"><param name="allowFullScreen" value="true" /><param name="allowscriptaccess" value="always" /><param name="src" value="http://www.youtube.com/v/Ion6xx4cJg8?hl=en&amp;fs=1" /><param name="allowfullscreen" value="true" /><embed type="application/x-shockwave-flash" width="425" height="344" src="http://www.youtube.com/v/Ion6xx4cJg8?hl=en&amp;fs=1" allowscriptaccess="always" allowfullscreen="true"></embed></object></p>
<p><span id="more-1143"></span><br />
3. Необходимо зайти на admin.mob1serv.com и создать учетную запись.<br />
- войти и создать новое приложение, нажав на &#8220;+ Add a new Application&#8221;;<br />
- выбрать HighScores -&gt; Edit game modes и обавить mode;<br />
<a href="http://gyazo.com/47b57c8d30195091bdba8a5749eb66cc.png"><img src="http://gyazo.com/47b57c8d30195091bdba8a5749eb66cc.png" alt="" width="294" height="118" /></a><br />
- перейти на вкладку Connection Info и узнать информацию для подключения.<br />
<a href="http://gyazo.com/9eafb8c9c76106b930ad0c292cbc815a.png"><img src="http://gyazo.com/9eafb8c9c76106b930ad0c292cbc815a.png" alt="" width="334" height="204" /></a></p>
<p>4. Вот теперь начнем писать код.</p>
<p>Подпишемся/отпишемся на нотификации</p>
<div class="codecolorer-container objc geshi" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:810px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br />3<br />4<br />5<br />6<br />7<br />8<br />9<br />10<br />11<br />12<br />13<br />14<br />15<br />16<br />17<br /></div></td><td><div class="objc codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #002200;">-</span> <span style="color: #002200;">&#40;</span><span style="color: #a61390;">void</span><span style="color: #002200;">&#41;</span> subscribe <span style="color: #002200;">&#123;</span><br />
&nbsp; &nbsp; &nbsp;<span style="color: #002200;">&#91;</span><span style="color: #002200;">&#91;</span><a href="http://developer.apple.com/documentation/Cocoa/Reference/Foundation/Classes/NSNotificationCenter_Class/"><span style="color: #400080;">NSNotificationCenter</span></a> defaultCenter<span style="color: #002200;">&#93;</span> addObserver<span style="color: #002200;">:</span>self selector<span style="color: #002200;">:</span><span style="color: #a61390;">@selector</span><span style="color: #002200;">&#40;</span>informationGettedNotificationReceived<span style="color: #002200;">:</span><span style="color: #002200;">&#41;</span> name<span style="color: #002200;">:</span>kHighScoresNotificationInformatioGetted object<span style="color: #002200;">:</span><span style="color: #a61390;">nil</span><span style="color: #002200;">&#93;</span>;<br />
&nbsp; &nbsp; &nbsp;<span style="color: #002200;">&#91;</span><span style="color: #002200;">&#91;</span><a href="http://developer.apple.com/documentation/Cocoa/Reference/Foundation/Classes/NSNotificationCenter_Class/"><span style="color: #400080;">NSNotificationCenter</span></a> defaultCenter<span style="color: #002200;">&#93;</span> addObserver<span style="color: #002200;">:</span>self selector<span style="color: #002200;">:</span><span style="color: #a61390;">@selector</span><span style="color: #002200;">&#40;</span>successNotificationReceived<span style="color: #002200;">:</span><span style="color: #002200;">&#41;</span> name<span style="color: #002200;">:</span>kMobservNotificationAccessTokenReceived object<span style="color: #002200;">:</span><span style="color: #a61390;">nil</span><span style="color: #002200;">&#93;</span>;<br />
&nbsp; &nbsp; &nbsp;<span style="color: #002200;">&#91;</span><span style="color: #002200;">&#91;</span><a href="http://developer.apple.com/documentation/Cocoa/Reference/Foundation/Classes/NSNotificationCenter_Class/"><span style="color: #400080;">NSNotificationCenter</span></a> defaultCenter<span style="color: #002200;">&#93;</span> addObserver<span style="color: #002200;">:</span>self selector<span style="color: #002200;">:</span><span style="color: #a61390;">@selector</span><span style="color: #002200;">&#40;</span>errorNotificationReceived<span style="color: #002200;">:</span><span style="color: #002200;">&#41;</span> name<span style="color: #002200;">:</span>kMobservNotificationAccessTokenReceiveFailed object<span style="color: #002200;">:</span><span style="color: #a61390;">nil</span><span style="color: #002200;">&#93;</span>;<br />
&nbsp; &nbsp; &nbsp;<span style="color: #002200;">&#91;</span><span style="color: #002200;">&#91;</span><a href="http://developer.apple.com/documentation/Cocoa/Reference/Foundation/Classes/NSNotificationCenter_Class/"><span style="color: #400080;">NSNotificationCenter</span></a> defaultCenter<span style="color: #002200;">&#93;</span> addObserver<span style="color: #002200;">:</span>self selector<span style="color: #002200;">:</span><span style="color: #a61390;">@selector</span><span style="color: #002200;">&#40;</span>scoreAddedNotificationReceived<span style="color: #002200;">:</span><span style="color: #002200;">&#41;</span> name<span style="color: #002200;">:</span>kHighScoresNotificationScoreAdded object<span style="color: #002200;">:</span><span style="color: #a61390;">nil</span><span style="color: #002200;">&#93;</span>;<br />
&nbsp; &nbsp; &nbsp;<span style="color: #002200;">&#91;</span><span style="color: #002200;">&#91;</span><a href="http://developer.apple.com/documentation/Cocoa/Reference/Foundation/Classes/NSNotificationCenter_Class/"><span style="color: #400080;">NSNotificationCenter</span></a> defaultCenter<span style="color: #002200;">&#93;</span> addObserver<span style="color: #002200;">:</span>self selector<span style="color: #002200;">:</span><span style="color: #a61390;">@selector</span><span style="color: #002200;">&#40;</span>scoreGettedNotificationReceived<span style="color: #002200;">:</span><span style="color: #002200;">&#41;</span> name<span style="color: #002200;">:</span>kHighScoresNotificationScoreGetted object<span style="color: #002200;">:</span><span style="color: #a61390;">nil</span><span style="color: #002200;">&#93;</span>;<br />
&nbsp; &nbsp; &nbsp;subscribed <span style="color: #002200;">=</span> <span style="color: #a61390;">YES</span>;<br />
<span style="color: #002200;">&#125;</span><br />
<br />
<span style="color: #002200;">-</span> <span style="color: #002200;">&#40;</span><span style="color: #a61390;">void</span><span style="color: #002200;">&#41;</span> unsubscribe <span style="color: #002200;">&#123;</span><br />
&nbsp; &nbsp; &nbsp;<span style="color: #002200;">&#91;</span><span style="color: #002200;">&#91;</span><a href="http://developer.apple.com/documentation/Cocoa/Reference/Foundation/Classes/NSNotificationCenter_Class/"><span style="color: #400080;">NSNotificationCenter</span></a> defaultCenter<span style="color: #002200;">&#93;</span> removeObserver<span style="color: #002200;">:</span>self name<span style="color: #002200;">:</span>kHighScoresNotificationInformatioGetted object<span style="color: #002200;">:</span><span style="color: #a61390;">nil</span><span style="color: #002200;">&#93;</span>;<br />
&nbsp; &nbsp; &nbsp;<span style="color: #002200;">&#91;</span><span style="color: #002200;">&#91;</span><a href="http://developer.apple.com/documentation/Cocoa/Reference/Foundation/Classes/NSNotificationCenter_Class/"><span style="color: #400080;">NSNotificationCenter</span></a> defaultCenter<span style="color: #002200;">&#93;</span> removeObserver<span style="color: #002200;">:</span>self name<span style="color: #002200;">:</span>kMobservNotificationAccessTokenReceived object<span style="color: #002200;">:</span><span style="color: #a61390;">nil</span><span style="color: #002200;">&#93;</span>;<br />
&nbsp; &nbsp; &nbsp;<span style="color: #002200;">&#91;</span><span style="color: #002200;">&#91;</span><a href="http://developer.apple.com/documentation/Cocoa/Reference/Foundation/Classes/NSNotificationCenter_Class/"><span style="color: #400080;">NSNotificationCenter</span></a> defaultCenter<span style="color: #002200;">&#93;</span> removeObserver<span style="color: #002200;">:</span>self name<span style="color: #002200;">:</span>kMobservNotificationAccessTokenReceiveFailed object<span style="color: #002200;">:</span><span style="color: #a61390;">nil</span><span style="color: #002200;">&#93;</span>;<br />
&nbsp; &nbsp; &nbsp;<span style="color: #002200;">&#91;</span><span style="color: #002200;">&#91;</span><a href="http://developer.apple.com/documentation/Cocoa/Reference/Foundation/Classes/NSNotificationCenter_Class/"><span style="color: #400080;">NSNotificationCenter</span></a> defaultCenter<span style="color: #002200;">&#93;</span> removeObserver<span style="color: #002200;">:</span>self name<span style="color: #002200;">:</span>kHighScoresNotificationScoreAdded object<span style="color: #002200;">:</span><span style="color: #a61390;">nil</span><span style="color: #002200;">&#93;</span>;<br />
&nbsp; &nbsp; &nbsp;<span style="color: #002200;">&#91;</span><span style="color: #002200;">&#91;</span><a href="http://developer.apple.com/documentation/Cocoa/Reference/Foundation/Classes/NSNotificationCenter_Class/"><span style="color: #400080;">NSNotificationCenter</span></a> defaultCenter<span style="color: #002200;">&#93;</span> removeObserver<span style="color: #002200;">:</span>self name<span style="color: #002200;">:</span>kHighScoresNotificationScoreGetted object<span style="color: #002200;">:</span><span style="color: #a61390;">nil</span><span style="color: #002200;">&#93;</span>;<br />
&nbsp; &nbsp; &nbsp;subscribed <span style="color: #002200;">=</span> <span style="color: #a61390;">NO</span>;<br />
<span style="color: #002200;">&#125;</span></div></td></tr></tbody></table></div>
<p>Подключаемся  к серверу</p>
<div class="codecolorer-container objc geshi" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:810px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br />3<br />4<br />5<br />6<br />7<br />8<br />9<br />10<br />11<br />12<br />13<br /></div></td><td><div class="objc codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #6e371a;">#define limitScores 25</span><br />
<br />
<span style="color: #6e371a;">#define mAppID 200</span><br />
<span style="color: #6e371a;">#define mGameID 400 // Ваш game id</span><br />
<span style="color: #6e371a;">#define mConsumerKey @&quot;sdfsadfjoisdf&quot;</span><br />
<span style="color: #6e371a;">#define mSecretKey @&quot;sdfsadfjoisdf&quot;</span><br />
<br />
<span style="color: #002200;">-</span> <span style="color: #002200;">&#40;</span><span style="color: #a61390;">void</span><span style="color: #002200;">&#41;</span> connect <span style="color: #002200;">&#123;</span><br />
&nbsp; &nbsp; &nbsp;HighScoresService<span style="color: #002200;">*</span> hScore <span style="color: #002200;">=</span> <span style="color: #002200;">&#91;</span>HighScoresService sharedInstance<span style="color: #002200;">&#93;</span>;<br />
&nbsp; &nbsp; &nbsp;hScore.appid <span style="color: #002200;">=</span> <span style="color: #002200;">&#91;</span><a href="http://developer.apple.com/documentation/Cocoa/Reference/Foundation/Classes/NSNumber_Class/"><span style="color: #400080;">NSNumber</span></a> numberWithInt<span style="color: #002200;">:</span>mAppID<span style="color: #002200;">&#93;</span>;<br />
&nbsp; &nbsp; &nbsp;<span style="color: #002200;">&#91;</span>hScore setConsumerKey<span style="color: #002200;">:</span>mConsumerKey andSecret<span style="color: #002200;">:</span>mSecretKey<span style="color: #002200;">&#93;</span>;<br />
&nbsp; &nbsp; &nbsp;<span style="color: #002200;">&#91;</span>hScore getAccessToken<span style="color: #002200;">&#93;</span>;<br />
<span style="color: #002200;">&#125;</span></div></td></tr></tbody></table></div>
<p>В случае успешного подключений приходит сообщение и сразу делаем запрос на обновление результатов</p>
<div class="codecolorer-container objc geshi" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:810px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br />3<br />4<br />5<br />6<br />7<br />8<br /></div></td><td><div class="objc codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #002200;">-</span> <span style="color: #002200;">&#40;</span><span style="color: #a61390;">void</span><span style="color: #002200;">&#41;</span>successNotificationReceived<span style="color: #002200;">:</span><span style="color: #002200;">&#40;</span><a href="http://developer.apple.com/documentation/Cocoa/Reference/Foundation/Classes/NSNotification_Class/"><span style="color: #400080;">NSNotification</span></a><span style="color: #002200;">*</span><span style="color: #002200;">&#41;</span>notification <span style="color: #002200;">&#123;</span><br />
&nbsp; &nbsp; &nbsp;<span style="color: #002200;">&#91;</span>self refreshResults<span style="color: #002200;">&#93;</span>;<br />
<span style="color: #002200;">&#125;</span><br />
<br />
<span style="color: #002200;">-</span> <span style="color: #002200;">&#40;</span><span style="color: #a61390;">void</span><span style="color: #002200;">&#41;</span>refreshResults <span style="color: #002200;">&#123;</span><br />
&nbsp; &nbsp; &nbsp;<span style="color: #002200;">&#91;</span>scores removeAllObjects<span style="color: #002200;">&#93;</span>; <span style="color: #11740a; font-style: italic;">// array</span><br />
&nbsp; &nbsp; &nbsp;<span style="color: #002200;">&#91;</span><span style="color: #002200;">&#40;</span>HighScoresService<span style="color: #002200;">*</span><span style="color: #002200;">&#41;</span><span style="color: #002200;">&#91;</span>HighScoresService sharedInstance<span style="color: #002200;">&#93;</span> getScoresForGame<span style="color: #002200;">:</span>mGameID scoreLimit<span style="color: #002200;">:</span>limitScores<span style="color: #002200;">&#93;</span>;<br />
<span style="color: #002200;">&#125;</span></div></td></tr></tbody></table></div>
<p>Получаем информацию про запрашиваемые скоры  и сами скоры</p>
<div class="codecolorer-container objc geshi" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:810px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br />3<br />4<br />5<br />6<br />7<br />8<br />9<br />10<br />11<br />12<br />13<br />14<br /></div></td><td><div class="objc codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #002200;">-</span> <span style="color: #002200;">&#40;</span><span style="color: #a61390;">void</span><span style="color: #002200;">&#41;</span>informationGettedNotificationReceived<span style="color: #002200;">:</span><span style="color: #002200;">&#40;</span><a href="http://developer.apple.com/documentation/Cocoa/Reference/Foundation/Classes/NSNotification_Class/"><span style="color: #400080;">NSNotification</span></a><span style="color: #002200;">*</span><span style="color: #002200;">&#41;</span>notification <span style="color: #002200;">&#123;</span><br />
&nbsp; &nbsp; &nbsp;<span style="color: #11740a; font-style: italic;">// так я сохраняю информацию о запросе</span><br />
&nbsp; &nbsp; &nbsp;self.dictInfo <span style="color: #002200;">=</span> <span style="color: #002200;">&#40;</span><a href="http://developer.apple.com/documentation/Cocoa/Reference/Foundation/Classes/NSDictionary_Class/"><span style="color: #400080;">NSDictionary</span></a><span style="color: #002200;">*</span><span style="color: #002200;">&#41;</span><span style="color: #002200;">&#91;</span>notification.userInfo objectForKey<span style="color: #002200;">:</span><span style="color: #bf1d1a;">@</span><span style="color: #bf1d1a;">&quot;info&quot;</span><span style="color: #002200;">&#93;</span>;<br />
&nbsp; &nbsp; &nbsp;<span style="color: #11740a; font-style: italic;">// получаю количество записей всего</span><br />
&nbsp; &nbsp; &nbsp;totalCount <span style="color: #002200;">=</span> <span style="color: #002200;">&#91;</span><span style="color: #002200;">&#91;</span>self.dictInfo objectForKey<span style="color: #002200;">:</span><span style="color: #bf1d1a;">@</span><span style="color: #bf1d1a;">&quot;total_count&quot;</span><span style="color: #002200;">&#93;</span> intValue<span style="color: #002200;">&#93;</span>;<br />
<span style="color: #002200;">&#125;</span><br />
<br />
<span style="color: #11740a; font-style: italic;">// получаем скоры</span><br />
<span style="color: #002200;">-</span> <span style="color: #002200;">&#40;</span><span style="color: #a61390;">void</span><span style="color: #002200;">&#41;</span>scoreGettedNotificationReceived<span style="color: #002200;">:</span><span style="color: #002200;">&#40;</span><a href="http://developer.apple.com/documentation/Cocoa/Reference/Foundation/Classes/NSNotification_Class/"><span style="color: #400080;">NSNotification</span></a><span style="color: #002200;">*</span><span style="color: #002200;">&#41;</span>notification <span style="color: #002200;">&#123;</span><br />
&nbsp; &nbsp; &nbsp;<span style="color: #11740a; font-style: italic;">// get scores and insert ot array</span><br />
&nbsp; &nbsp; &nbsp;<a href="http://developer.apple.com/documentation/Cocoa/Reference/Foundation/Classes/NSDictionary_Class/"><span style="color: #400080;">NSDictionary</span></a><span style="color: #002200;">*</span> dict <span style="color: #002200;">=</span> <span style="color: #002200;">&#40;</span><a href="http://developer.apple.com/documentation/Cocoa/Reference/Foundation/Classes/NSDictionary_Class/"><span style="color: #400080;">NSDictionary</span></a><span style="color: #002200;">*</span><span style="color: #002200;">&#41;</span><span style="color: #002200;">&#91;</span>notification.userInfo objectForKey<span style="color: #002200;">:</span><span style="color: #bf1d1a;">@</span><span style="color: #bf1d1a;">&quot;result&quot;</span><span style="color: #002200;">&#93;</span>;<br />
&nbsp; &nbsp; &nbsp;scores <span style="color: #002200;">=</span> <span style="color: #002200;">&#91;</span><span style="color: #002200;">&#91;</span><a href="http://developer.apple.com/documentation/Cocoa/Reference/Foundation/Classes/NSMutableArray_Class/"><span style="color: #400080;">NSMutableArray</span></a> alloc<span style="color: #002200;">&#93;</span> initWithArray<span style="color: #002200;">:</span><span style="color: #002200;">&#91;</span>dict objectForKey<span style="color: #002200;">:</span><span style="color: #bf1d1a;">@</span><span style="color: #bf1d1a;">&quot;scores&quot;</span><span style="color: #002200;">&#93;</span><span style="color: #002200;">&#93;</span>;<br />
&nbsp; &nbsp; &nbsp;...<br />
<span style="color: #002200;">&#125;</span></div></td></tr></tbody></table></div>
<p>Пример добавления записи в онлайн скоры</p>
<div class="codecolorer-container objc geshi" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:810px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br />3<br />4<br />5<br />6<br />7<br /></div></td><td><div class="objc codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">HighScore<span style="color: #002200;">*</span> score <span style="color: #002200;">=</span> <span style="color: #002200;">&#91;</span><span style="color: #002200;">&#91;</span><span style="color: #002200;">&#91;</span>HighScore alloc<span style="color: #002200;">&#93;</span> init<span style="color: #002200;">&#93;</span> autorelease<span style="color: #002200;">&#93;</span>;<br />
score.index <span style="color: #002200;">=</span> <span style="color: #002200;">&#91;</span><a href="http://developer.apple.com/documentation/Cocoa/Reference/Foundation/Classes/NSNumber_Class/"><span style="color: #400080;">NSNumber</span></a> numberWithInt<span style="color: #002200;">:</span><span style="color: #2400d9;">0</span><span style="color: #002200;">&#93;</span>;<br />
score.limit <span style="color: #002200;">=</span> <span style="color: #002200;">&#91;</span><a href="http://developer.apple.com/documentation/Cocoa/Reference/Foundation/Classes/NSNumber_Class/"><span style="color: #400080;">NSNumber</span></a> numberWithInt<span style="color: #002200;">:</span>limitScores<span style="color: #002200;">&#93;</span>;<br />
score.userName <span style="color: #002200;">=</span> name;<br />
score.value <span style="color: #002200;">=</span> <span style="color: #002200;">&#91;</span><a href="http://developer.apple.com/documentation/Cocoa/Reference/Foundation/Classes/NSNumber_Class/"><span style="color: #400080;">NSNumber</span></a> numberWithInt<span style="color: #002200;">:</span>score<span style="color: #002200;">&#93;</span>;<br />
score.subgameId <span style="color: #002200;">=</span> <span style="color: #002200;">&#91;</span><a href="http://developer.apple.com/documentation/Cocoa/Reference/Foundation/Classes/NSString_Class/"><span style="color: #400080;">NSString</span></a> stringWithFormat<span style="color: #002200;">:</span><span style="color: #bf1d1a;">@</span><span style="color: #bf1d1a;">&quot;%d&quot;</span>,mGameID<span style="color: #002200;">&#93;</span>;<br />
<span style="color: #002200;">&#91;</span><span style="color: #002200;">&#91;</span>HighScoresService sharedInstance<span style="color: #002200;">&#93;</span> addScore<span style="color: #002200;">:</span>score<span style="color: #002200;">&#93;</span>;</div></td></tr></tbody></table></div>
<p>В scoreAddedNotificationReceived:(NSNotification*)notification получим калбек с результатом добавления</p>
<p>Вот к примеру как можно получить следующие 25 результатов</p>
<div class="codecolorer-container objc geshi" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:810px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br />3<br />4<br />5<br />6<br />7<br />8<br /></div></td><td><div class="objc codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #002200;">-</span> <span style="color: #002200;">&#40;</span><span style="color: #a61390;">void</span><span style="color: #002200;">&#41;</span>loadMore25Scores <span style="color: #002200;">&#123;</span><br />
&nbsp; &nbsp; &nbsp;<span style="color: #a61390;">if</span> <span style="color: #002200;">&#40;</span>totalCount <span style="color: #002200;">!=</span> loadedScores<span style="color: #002200;">&#41;</span> <span style="color: #002200;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #002200;">&#91;</span><span style="color: #002200;">&#91;</span>HighScoresService sharedInstance<span style="color: #002200;">&#93;</span> getScoresForGame<span style="color: #002200;">:</span>idGame <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;scoreLimit<span style="color: #002200;">:</span><span style="color: #002200;">&#40;</span>totalCount<span style="color: #002200;">-</span>limitScores &gt;<span style="color: #002200;">=</span> limitScores<span style="color: #002200;">&#41;</span>? limitScores <span style="color: #002200;">:</span> totalCount<span style="color: #002200;">-</span>loadedScores <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; fromIndex<span style="color: #002200;">:</span>loadedScores <span style="color: #002200;">&#93;</span>; &nbsp;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; loadedScores <span style="color: #002200;">+=</span> <span style="color: #002200;">&#40;</span>totalCount<span style="color: #002200;">-</span>limitScores &gt;<span style="color: #002200;">=</span> limitScores<span style="color: #002200;">&#41;</span>? limitScores <span style="color: #002200;">:</span> totalCount<span style="color: #002200;">-</span>loadedScores;<br />
&nbsp; &nbsp; &nbsp;<span style="color: #002200;">&#125;</span><br />
<span style="color: #002200;">&#125;</span></div></td></tr></tbody></table></div>
]]></content:encoded>
			<wfw:commentRss>http://www.developers-life.com/integrate-high-scores-service-of-mob1serv.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>UML диаграммы в Xcode</title>
		<link>http://www.developers-life.com/create-uml-models-in-xcode.html</link>
		<comments>http://www.developers-life.com/create-uml-models-in-xcode.html#comments</comments>
		<pubDate>Sat, 12 Jun 2010 15:03:36 +0000</pubDate>
		<dc:creator>Vladimir Boychentsov</dc:creator>
				<category><![CDATA[Apple]]></category>
		<category><![CDATA[OOP]]></category>
		<category><![CDATA[others]]></category>
		<category><![CDATA[objective-c]]></category>
		<category><![CDATA[UML]]></category>
		<category><![CDATA[Xcode]]></category>
		<category><![CDATA[Кодинг]]></category>

		<guid isPermaLink="false">http://www.developers-life.com/?p=1031</guid>
		<description><![CDATA[На написание данного поста меня с подвигла недавняя задача! Мне нужно было для записки и слайдов дипломного проекта предоставить UML диаграммы. Сначала по гуглил и сразу попал на страницу одной софтины, которая называется MacTranslator, забегая на перед, т.к. многие могут просто не дочитать, НЕ РЕКОМЕНДУЮ ее покапать, хотя вряд ли ее кто и купит из [...]]]></description>
			<content:encoded><![CDATA[<p>На написание данного поста меня с подвигла недавняя задача! Мне нужно было для записки и слайдов дипломного проекта предоставить UML диаграммы. Сначала по гуглил и сразу попал на страницу одной софтины, которая называется MacTranslator, забегая на перед, т.к. многие могут просто не дочитать, НЕ РЕКОМЕНДУЮ ее покапать, хотя вряд ли ее кто и купит из читателей и простых серферов веба, т.к. софтина стоит 465$, если не ошибаюсь :)</p>
<p>Небольшое отступление:<em><br />
<span style="color: #808080;">С Xcode средой разработки я знаком уже почти 2 года, и с версиями ниже 3-ей не работал. Многое уже освоил, но занимаюсь изучением возможностей данной среды далее. Считаю, что много интересного я еще не знаю! </span></em></p>
<p>Далее я нашел много интересного программного обеспечения, но ни один из продуктов мне не пришелся по вкусу и функционалу, всего 2 продукта поддерживали Objective-C, что весьма печально. В итоге я начал рисовать вручную и когда зашел в Xcode меня осенило, что я зря провел время на поиски! На сегодняшний день Xcode может все сделать за вас! Как давно есть этот функционал я не задавался вопросом, но по моим предположениям и по скриншотам, могу предположить что довольна таки давно, примерно с 2006 года точно! Судя по <a href="http://developer.apple.com/macosx/xcode2.html" target="_blank">данному документу</a>!</p>
<p>Немного еще поискав по <a href="http://developer.apple.com/mac/search/search.php" target="_blank">девелоперской</a> части сайта , наткнулся на <a href="http://developer.apple.com/mac/library/documentation/DeveloperTools/Conceptual/XCodeDesignTools/Introduction/Introduction.html#//apple_ref/doc/uid/TP40006858-SW1" target="_blank">Introduction to Xcode Design Tools for Class Modeling</a></p>
<p>Кратко о том как это делается, на одном из семплов от Apple, к примеру &#8220;QuartzDemo&#8221;:</p>
<p>1. Добавляем новый фаил &#8220;Class Model&#8221;<br />
<a href="http://www.developers-life.com/wp-content/uploads/2010/06/Screen-shot-2010-06-12-at-5.42.52-PM.png" target="_blank"><img class="alignnone size-medium wp-image-1032" title="Добавление файла в Xcode для отображения UML из исходного кода Objective-C, UML from Objective-C source code" src="http://www.developers-life.com/wp-content/uploads/2010/06/Screen-shot-2010-06-12-at-5.42.52-PM-300x227.png" alt="Добавление файла в Xcode для отображения UML из исходного кода Objective-C, UML from Objective-C source code" width="300" height="227" /></a></p>
<p><span id="more-1031"></span>2. Добавляем в него файлы и нажимаем &#8220;Finish&#8221;<br />
<a href="http://www.developers-life.com/wp-content/uploads/2010/06/Screen-shot-2010-06-12-at-5.43.36-PM.png" target="_blank"><img class="alignnone size-medium wp-image-1033" title="Create Class Model" src="http://www.developers-life.com/wp-content/uploads/2010/06/Screen-shot-2010-06-12-at-5.43.36-PM-300x227.png" alt="Create Class Model" width="300" height="227" /></a></p>
<p>3. В итоге мы увидим UML диаграммы, но они будут немного не наглядно выстраены, это легко поправимо, результат:</p>
<p><a href="http://www.developers-life.com/wp-content/uploads/2010/06/Screen-shot-2010-06-12-at-5.47.26-PM.png" target="_blank"><img class="alignnone size-medium wp-image-1034" title="UML Xcode" src="http://www.developers-life.com/wp-content/uploads/2010/06/Screen-shot-2010-06-12-at-5.47.26-PM-300x192.png" alt="UML Xcode" width="300" height="192" /></a><br />
<a href="http://www.developers-life.com/wp-content/uploads/2010/06/Screen-shot-2010-06-12-at-5.47.41-PM.png" target="_blank"><img class="alignnone size-medium wp-image-1035" title="UML Xcode" src="http://www.developers-life.com/wp-content/uploads/2010/06/Screen-shot-2010-06-12-at-5.47.41-PM-300x192.png" alt="UML Xcode" width="300" height="192" /></a></p>
<p>В каждом блоке можно развернуть Properties и Operations! Из каждого элемента можно легко перейти к участку кода!</p>
<p>Рекомендую использовать для наглядности. Очень помогает когда возвращаешся к старому проекту. Плюсов очень много.</p>
<p>Хочу сказать, что все оказалось очень просто и довольна таки красиво, вот к примеру мои UML диаграммы на стадии разработки одного из моих проектов, текст специально мелкий, чтоб не возможно было прочитать :)</p>
<p><img class="alignnone size-medium wp-image-1036" src="http://www.developers-life.com/wp-content/uploads/2010/06/Screen-shot-2010-06-12-at-5.17.27-PM-300x179.png" alt="" width="300" height="179" /></p>
]]></content:encoded>
			<wfw:commentRss>http://www.developers-life.com/create-uml-models-in-xcode.html/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>UIImage and Memory</title>
		<link>http://www.developers-life.com/uiimage-and-memory.html</link>
		<comments>http://www.developers-life.com/uiimage-and-memory.html#comments</comments>
		<pubDate>Thu, 10 Jun 2010 11:43:22 +0000</pubDate>
		<dc:creator>Vladimir Boychentsov</dc:creator>
				<category><![CDATA[iPad]]></category>
		<category><![CDATA[iPhone]]></category>
		<category><![CDATA[OOP]]></category>
		<category><![CDATA[Memory]]></category>
		<category><![CDATA[objective-c]]></category>
		<category><![CDATA[UIImage]]></category>
		<category><![CDATA[UIKit]]></category>
		<category><![CDATA[Ukraine]]></category>
		<category><![CDATA[work]]></category>
		<category><![CDATA[Кодинг]]></category>

		<guid isPermaLink="false">http://www.developers-life.com/?p=1023</guid>
		<description><![CDATA[+[UIImage imageNamed:] • Reads the ﬁle, uncompresses it, caches result • Cached copy of data is kept even if the UIImage is deallocated • Low memory condition causes cache to be purged. • No direct control over when cache is purged. • Use for small frequently drawn images. +[UIImage imageWithContentsOfFile:] • Just reads enough of [...]]]></description>
			<content:encoded><![CDATA[<p>+[UIImage imageNamed:]<br />
• Reads the ﬁle, uncompresses it, caches result<br />
• Cached copy of data is kept even if the UIImage is deallocated<br />
• Low memory condition causes cache to be purged.<br />
• No direct control over when cache is purged.<br />
• Use for small frequently drawn images.</p>
<p>+[UIImage imageWithContentsOfFile:]<br />
• Just reads enough of ﬁle to determine if it can open the ﬁle.<br />
• Reads and uncompresses the ﬁle each time it draws. Uses uncompressed size worth of memory only temporarily.<br />
• Assigning a UIImage created this way to a UIImageView or as the contents of a CALayer also causes it to read and uncompress the ﬁle. The UIImageView or CALayer keep the expanded version.<br />
<span id="more-1023"></span><br />
Memory Usage (in MB) 8.6 MB image used with UIImageView</p>
<table border="0" style="filter:none;font-size:12pt; border: 1px solid;">
<tr>
<td></td>
<td >imageNamed</td>
<td >imageWithContentsofFile</td>
</tr>
<tr>
<td >Initial</td>
<td>2.46</td>
<td>2.46</td>
</tr>
<tr>
<td>Load UIImage</td>
<td>11.12</td>
<td>2.51</td>
</tr>
<tr>
<td>Assign to UIImageView</td>
<td>11.09</td>
<td>11.09</td>
</tr>
<tr>
<td>Remove from UIImageView</td>
<td>11.12</td>
<td>2.51</td>
</tr>
</table>
<p>Memory Usage (in MB) 8.6 MB image used with UIView subclass (stored in instance variable and drawn with drawinRect: )</p>
<table border="0" style="filter:none; border: 1px solid;">
<tbody>
<tr>
<td></td>
<td>imageNamed</td>
<td>imageWithContentsofFile</td>
</tr>
<tr>
<td>Initial</td>
<td>2.73</td>
<td>2.73</td>
</tr>
<tr>
<td>Load UIImage</td>
<td>11.38</td>
<td>2.78</td>
</tr>
<tr>
<td>Assign to UIImageView</td>
<td>11.81</td>
<td>3.20</td>
</tr>
<tr>
<td>Remove from UIImageView</td>
<td>11.84</td>
<td>3.04</td>
</tr>
</tbody>
</table>
<p>Спасибо за некоторые пояснения Андрею Копаневу :)</p>
<p><a href="https://docs.google.com/fileview?id=0B2KSahvz-4DXOTFhM2Y5MzQtODkyZC00N2ExLWE0MWQtNjI2N2NiYTBkNzZh&amp;hl=ru">И вот этому документу</a> &#8211; Robert Clair</p>
]]></content:encoded>
			<wfw:commentRss>http://www.developers-life.com/uiimage-and-memory.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>iPhone 3D Samples from &#8220;iPhone 3D Programming&#8221; book</title>
		<link>http://www.developers-life.com/iphone-3d-samples.html</link>
		<comments>http://www.developers-life.com/iphone-3d-samples.html#comments</comments>
		<pubDate>Wed, 09 Jun 2010 13:35:34 +0000</pubDate>
		<dc:creator>Vladimir Boychentsov</dc:creator>
				<category><![CDATA[Apple]]></category>
		<category><![CDATA[iPad]]></category>
		<category><![CDATA[iPhone]]></category>
		<category><![CDATA[OOP]]></category>
		<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[Book]]></category>
		<category><![CDATA[C]]></category>
		<category><![CDATA[ES 2.0]]></category>
		<category><![CDATA[OpenGL]]></category>
		<category><![CDATA[Кодинг]]></category>

		<guid isPermaLink="false">http://www.developers-life.com/?p=1010</guid>
		<description><![CDATA[iPhone 3D Samples from &#8220;iPhone 3D Programming Developing Graphical Applications with OpenGL ES&#8221; book. Thanks Frank and Doris Rideout and O&#8217;REILLY 31 iPhone 3D Samples OpenGL ES 1.1 and 2.0 All links direct to http://examples.oreilly.com/ All Samples HelloArrow HelloCone TouchCone ModelViewer.SimpleWireframe ModelViewer.VertexLighting ModelViewer.PixelLighting ModelViewer.ToonLighting ModelViewer.FancyWireframe ModelViewer.ObjViewer ModelViewer.Textured TextureFilters TextureFormats CameraTexture TextureAlpha Trefoil.Stencil Trefoil.FakeStencil Trefoil.Antialiasing Trefoil.Jitter [...]]]></description>
			<content:encoded><![CDATA[<p>iPhone 3D Samples from &#8220;iPhone 3D Programming Developing Graphical Applications with OpenGL ES&#8221; book.<br />
Thanks Frank and Doris Rideout and O&#8217;REILLY</p>
<p>31 iPhone 3D Samples OpenGL ES 1.1 and 2.0</p>
<p><noindex><br />
All links direct to http://examples.oreilly.com/</p>
<p><a href="http://depositfiles.com/files/8cy4ofx7u" target="blank">All Samples</a></p>
<h2>HelloArrow<a href="http://examples.oreilly.com/9780596804831/HelloArrow" target="blank"><br />
<img src="http://examples.oreilly.com/9780596804831/HelloArrow/Screenshot.png" alt="" /></a></h2>
<p><span id="more-1010"></span></p>
<h2>HelloCone<a href="http://examples.oreilly.com/9780596804831/HelloCone" target="blank"></p>
<p><img src="http://examples.oreilly.com/9780596804831/HelloCone/Screenshot.png" alt="" /></a></h2>
<h2 id="TouchCone">TouchCone<a href="http://examples.oreilly.com/9780596804831/TouchCone" target="blank"><br />
<img src="http://examples.oreilly.com/9780596804831/TouchCone/Screenshot.png" alt="" /></a></h2>
<h2 id="ModelViewer.SimpleWireframe">ModelViewer.SimpleWireframe<a href="http://examples.oreilly.com/9780596804831/ModelViewer.SimpleWireframe" target="blank"><br />
<img src="http://examples.oreilly.com/9780596804831/ModelViewer.SimpleWireframe/Screenshot.png" alt="" /></a></h2>
<h2 id="ModelViewer.VertexLighting">ModelViewer.VertexLighting<a href="http://examples.oreilly.com/9780596804831/ModelViewer.VertexLighting" target="blank"><br />
<img src="http://examples.oreilly.com/9780596804831/ModelViewer.VertexLighting/Screenshot.png" alt="" /></a></h2>
<h2 id="ModelViewer.PixelLighting">ModelViewer.PixelLighting<a href="http://examples.oreilly.com/9780596804831/ModelViewer.PixelLighting" target="blank"><br />
<img src="http://examples.oreilly.com/9780596804831/ModelViewer.PixelLighting/Screenshot.png" alt="" /></a></h2>
<h2 id="ModelViewer.ToonLighting">ModelViewer.ToonLighting<a href="http://examples.oreilly.com/9780596804831/ModelViewer.ToonLighting" target="blank"><br />
<img src="http://examples.oreilly.com/9780596804831/ModelViewer.ToonLighting/Screenshot.png" alt="" /></a></h2>
<h2 id="ModelViewer.FancyWireframe">ModelViewer.FancyWireframe<a href="http://examples.oreilly.com/9780596804831/ModelViewer.FancyWireframe" target="blank"><br />
<img src="http://examples.oreilly.com/9780596804831/ModelViewer.FancyWireframe/Screenshot.png" alt="" /></a></h2>
<h2>ModelViewer.ObjViewer<a href="http://examples.oreilly.com/9780596804831/ModelViewer.ObjViewer" target="blank"><br />
<img src="http://examples.oreilly.com/9780596804831/ModelViewer.ObjViewer/Screenshot.png" alt="" /></a></h2>
<h2 id="ModelViewer.Textured">ModelViewer.Textured<a href="http://examples.oreilly.com/9780596804831/ModelViewer.Textured" target="blank"><br />
<img src="http://examples.oreilly.com/9780596804831/ModelViewer.Textured/Screenshot.png" alt="" /></a></h2>
<h2 id="TextureFilters">TextureFilters<a href="http://examples.oreilly.com/9780596804831/TextureFilters" target="blank"><br />
<img src="http://examples.oreilly.com/9780596804831/TextureFilters/Screenshot.png" alt="" /></a></h2>
<h2 id="TextureFormats">TextureFormats<a href="http://examples.oreilly.com/9780596804831/TextureFormats" target="blank"><br />
<img src="http://examples.oreilly.com/9780596804831/TextureFormats/Screenshot.png" alt="" /></a></h2>
<h2 id="CameraTexture">CameraTexture<a href="http://examples.oreilly.com/9780596804831/CameraTexture" target="blank"><br />
<img src="http://examples.oreilly.com/9780596804831/CameraTexture/Screenshot.png" alt="" /></a></h2>
<h2 id="TextureAlpha">TextureAlpha<a href="http://examples.oreilly.com/9780596804831/TextureAlpha" target="blank"><br />
<img src="http://examples.oreilly.com/9780596804831/TextureAlpha/Screenshot.png" alt="" /></a></h2>
<h2 id="Trefoil.Stencil">Trefoil.Stencil<a href="http://examples.oreilly.com/9780596804831/Trefoil.Stencil" target="blank"><br />
<img src="http://examples.oreilly.com/9780596804831/Trefoil.Stencil/Screenshot.png" alt="" /></a></h2>
<h2 id="Trefoil.FakeStencil">Trefoil.FakeStencil<a href="http://examples.oreilly.com/9780596804831/Trefoil.FakeStencil" target="blank"><br />
<img src="http://examples.oreilly.com/9780596804831/Trefoil.FakeStencil/Screenshot.png" alt="" /></a></h2>
<h2 id="Trefoil.Antialiasing">Trefoil.Antialiasing<a href="http://examples.oreilly.com/9780596804831/Trefoil.Antialiasing" target="blank"><br />
<img src="http://examples.oreilly.com/9780596804831/Trefoil.Antialiasing/Screenshot.png" alt="" /></a></h2>
<h2 id="Trefoil.Jitter">Trefoil.Jitter<a href="http://examples.oreilly.com/9780596804831/Trefoil.Jitter" target="blank"><br />
<img src="http://examples.oreilly.com/9780596804831/Trefoil.Jitter/Screenshot.png" alt="" /></a></h2>
<h2 id="AaLines">AaLines<a href="http://examples.oreilly.com/9780596804831/AaLines" target="blank"><br />
<img src="http://examples.oreilly.com/9780596804831/AaLines/Screenshot.png" alt="" /></a></h2>
<h2 id="Holodeck.Clouds">Holodeck.Clouds<a href="http://examples.oreilly.com/9780596804831/Holodeck.Clouds" target="blank"><br />
<img style="width: 240px;" src="http://examples.oreilly.com/9780596804831/Holodeck.Clouds/Screenshot.png" alt="" /></a></h2>
<h2 id="Holodeck.Camera">Holodeck.Camera<a href="http://examples.oreilly.com/9780596804831/Holodeck.Camera" target="blank"><br />
<img style="width: 240px;" src="http://examples.oreilly.com/9780596804831/Holodeck.Camera/Screenshot.png" alt="" /></a></h2>
<h2 id="Klein.Fps">Klein.Fps<a href="http://examples.oreilly.com/9780596804831/Klein.Fps" target="blank"><br />
<img src="http://examples.oreilly.com/9780596804831/Klein.Fps/Screenshot.png" alt="" /></a></h2>
<h2 id="Haiku">Haiku<a href="http://examples.oreilly.com/9780596804831/Haiku" target="blank"><br />
<img style="width: 240px;" src="http://examples.oreilly.com/9780596804831/Haiku/Screenshot.png" alt="" /></a></h2>
<h2 id="DistanceField">DistanceField<a href="http://examples.oreilly.com/9780596804831/DistanceField" target="blank"><br />
<img src="http://examples.oreilly.com/9780596804831/DistanceField/Screenshot.png" alt="" /></a></h2>
<h2 id="SpriteSheet">SpriteSheet<a href="http://examples.oreilly.com/9780596804831/SpriteSheet" target="blank"><br />
<img src="http://examples.oreilly.com/9780596804831/SpriteSheet/Screenshot.png" alt="" /></a></h2>
<h2 id="SpringyStars">SpringyStars<a href="http://examples.oreilly.com/9780596804831/SpringyStars" target="blank"><br />
<img src="http://examples.oreilly.com/9780596804831/SpringyStars/Screenshot.png" alt="" /></a></h2>
<h2 id="Klein.Bumpy">Klein.Bumpy<a href="http://examples.oreilly.com/9780596804831/Klein.Bumpy" target="blank"><br />
<img src="http://examples.oreilly.com/9780596804831/Klein.Bumpy/Screenshot.png" alt="" /></a></h2>
<h2 id="Klein.Cubemap">Klein.Cubemap<a href="http://examples.oreilly.com/9780596804831/Klein.Cubemap" target="blank"><br />
<img src="http://examples.oreilly.com/9780596804831/Klein.Cubemap/Screenshot.png" alt="" /></a></h2>
<h2 id="CrudeBloom">CrudeBloom<a href="http://examples.oreilly.com/9780596804831/CrudeBloom" target="blank"><br />
<img src="http://examples.oreilly.com/9780596804831/CrudeBloom/Screenshot.png" alt="" /></a></h2>
<h2 id="GaussianBloom">GaussianBloom<a href="http://examples.oreilly.com/9780596804831/GaussianBloom" target="blank"><br />
<img src="http://examples.oreilly.com/9780596804831/GaussianBloom/Screenshot.png" alt="" /></a></h2>
<h2 id="VertexSkinning">VertexSkinning<a href="http://examples.oreilly.com/9780596804831/VertexSkinning" target="blank"><br />
<img src="http://examples.oreilly.com/9780596804831/VertexSkinning/Screenshot.png" alt="" /></a></h2>
<p></noindex></p>
]]></content:encoded>
			<wfw:commentRss>http://www.developers-life.com/iphone-3d-samples.html/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Good book!</title>
		<link>http://www.developers-life.com/good-book.html</link>
		<comments>http://www.developers-life.com/good-book.html#comments</comments>
		<pubDate>Tue, 08 Jun 2010 21:04:05 +0000</pubDate>
		<dc:creator>Vladimir Boychentsov</dc:creator>
				<category><![CDATA[Apple]]></category>
		<category><![CDATA[iPad]]></category>
		<category><![CDATA[iPhone]]></category>
		<category><![CDATA[Mac OS X]]></category>
		<category><![CDATA[OOP]]></category>
		<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[Book]]></category>
		<category><![CDATA[objective-c]]></category>
		<category><![CDATA[OpenGL]]></category>
		<category><![CDATA[Кодинг]]></category>

		<guid isPermaLink="false">http://www.developers-life.com/?p=999</guid>
		<description><![CDATA[Do you have a great idea for a graphics-intensive iPhone or iPad application, but don&#8217;t know how to bring it to life? This book offers the perfect solution: a crash course on the OpenGL graphics library with an overview of iPhone 3D development. Whether you&#8217;re an experienced OpenGL developer looking to build iPhone apps for [...]]]></description>
			<content:encoded><![CDATA[<p><img class="alignleft" src="http://covers.oreilly.com/images/9780596804831/cat.gif" alt="" width="180" height="236" />Do you have a great idea for a graphics-intensive iPhone or iPad application, but don&#8217;t know how to bring it to life? This book offers the perfect solution: a crash course on the OpenGL graphics library with an overview of iPhone 3D development. Whether you&#8217;re an experienced OpenGL developer looking to build iPhone apps for the first time, or an iPhone developer wanting to learn sophisticated graphics, iPhone 3D Programming addresses both in one concise, easy-to-use guide.</p>
<p>What does it take to build an iPhone app with stunning 3D graphics? This book will show you how to apply OpenGL graphics programming techniques to any device running the iPhone OS &#8212; including the iPad and iPod Touch &#8212; with no iPhone development or 3D graphics experience required. iPhone 3D Programming provides clear step-by-step instructions, as well as lots of practical advice, for using the iPhone SDK and OpenGL.<br />
<span id="more-999"></span><br />
You&#8217;ll build several graphics programs &#8212; progressing from simple to more complex examples &#8212; that focus on lighting, textures, blending, augmented reality, optimization for performance and speed, and much more. All you need to get started is a solid understanding of C++ and a great idea for an app.</p>
<p>    * Learn fundamental graphics concepts, including transformation matrices, quaternions, and more<br />
    * Get set up for iPhone development with the Xcode environment<br />
    * Become familiar with versions 1.1 and 2.0 of the OpenGL ES API, and learn to use vertex buffer objects, lighting, texturing, and shaders<br />
    * Use the iPhone&#8217;s touch screen, compass, and accelerometer to build interactivity into graphics applications<br />
    * Build iPhone graphics applications such as a 3D wireframe viewer, a simple augmented reality application, a spring system simulation, and more</p>
<p>This book received valuable community input through O&#8217;Reilly&#8217;s Open Feedback Publishing System (OFPS). Learn more at </p>
<p><noindex><a href="http://oreilly.com/catalog/9780596804831" target="blank">Buy Book</a></p>
<p><a href="http://iphone-3d-programming.labs.oreilly.com/" target="blank">Free for online read</a></p>
<p></noindex></p>
]]></content:encoded>
			<wfw:commentRss>http://www.developers-life.com/good-book.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>В свободное время</title>
		<link>http://www.developers-life.com/free-time-for-vkontakter.html</link>
		<comments>http://www.developers-life.com/free-time-for-vkontakter.html#comments</comments>
		<pubDate>Sun, 02 May 2010 14:22:12 +0000</pubDate>
		<dc:creator>Vladimir Boychentsov</dc:creator>
				<category><![CDATA[Apple]]></category>
		<category><![CDATA[Mac OS X]]></category>
		<category><![CDATA[OOP]]></category>
		<category><![CDATA[Cocoa]]></category>
		<category><![CDATA[Free Time]]></category>
		<category><![CDATA[iPhone]]></category>
		<category><![CDATA[objective-c]]></category>
		<category><![CDATA[Vkontakte]]></category>
		<category><![CDATA[Xcode]]></category>
		<category><![CDATA[Кодинг]]></category>

		<guid isPermaLink="false">http://www.developers-life.com/?p=956</guid>
		<description><![CDATA[В свободное время решил поработать немного над созданием простого клиента для социальной сети &#8220;Вконтакте&#8221;. Хочу поделиться маленьким результатом. Это пока скромная версия, которая может вывести список, отправить сообщение, изменить статус и еще несколько мелочей&#8230; Я не руководился тем нужно это или нет, просто было интересно поработать с новым API от &#8220;Вконтакте&#8221;. Спасибо за внимания, если [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://gyazo.com/d30b6d825cffe79eaa2a89508e37481c.png"><img class="alignleft" title="Vkontakter" src="http://gyazo.com/d30b6d825cffe79eaa2a89508e37481c.png" alt="Vkontakter" width="226" height="509" /></a></p>
<p>В свободное время решил поработать немного над созданием простого  клиента для социальной сети &#8220;Вконтакте&#8221;. Хочу поделиться маленьким результатом. Это пока скромная версия, которая  может вывести список, отправить сообщение, изменить статус и еще  несколько мелочей&#8230;</p>
<p>Я не руководился тем нужно это или нет, просто было  интересно поработать с новым API от &#8220;Вконтакте&#8221;.</p>
<p>Спасибо за внимания,  если получится что-то хорошее, то возможно появится и для общего  пользования.</p>
<p>P.S.: Хочу заметить, что этот проект больше для повышения опыта разработки и не поддается критике :)</p>
]]></content:encoded>
			<wfw:commentRss>http://www.developers-life.com/free-time-for-vkontakter.html/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Custom UINavigationBar with image and back button</title>
		<link>http://www.developers-life.com/custom-uinavigationbar-with-image-and-back-button.html</link>
		<comments>http://www.developers-life.com/custom-uinavigationbar-with-image-and-back-button.html#comments</comments>
		<pubDate>Tue, 09 Feb 2010 19:10:16 +0000</pubDate>
		<dc:creator>Vladimir Boychentsov</dc:creator>
				<category><![CDATA[Apple]]></category>
		<category><![CDATA[iPad]]></category>
		<category><![CDATA[iPhone]]></category>
		<category><![CDATA[Mac OS X]]></category>
		<category><![CDATA[OOP]]></category>
		<category><![CDATA[UIKit]]></category>
		<category><![CDATA[UINavigationBar]]></category>
		<category><![CDATA[Кодинг]]></category>

		<guid isPermaLink="false">http://www.developers-life.com/?p=877</guid>
		<description><![CDATA[Many people could not find this solution! It&#8217;s really very simple solution and it does not contain any private methods and functions. It&#8217;s based on the drawRect method and the simple manipulation with the title. If the title is specified, then the text of title displays, but if not, then displays the image. 1234567891011121314151617181920212223242526272829@implementation UINavigationBar [...]]]></description>
			<content:encoded><![CDATA[<p>  Many people could not find this solution! It&#8217;s really very simple solution  and it does not contain any private methods and functions. It&#8217;s based on the drawRect method and the simple manipulation with the title. If the title is specified, then the text of title displays, but if not, then displays the image.<br />
<span id="more-877"></span></p>
<div class="codecolorer-container objc geshi" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:810px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br />3<br />4<br />5<br />6<br />7<br />8<br />9<br />10<br />11<br />12<br />13<br />14<br />15<br />16<br />17<br />18<br />19<br />20<br />21<br />22<br />23<br />24<br />25<br />26<br />27<br />28<br />29<br /></div></td><td><div class="objc codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #a61390;">@implementation</span> UINavigationBar <span style="color: #002200;">&#40;</span>UINavigationBarCustomDraw<span style="color: #002200;">&#41;</span><br />
<br />
<span style="color: #002200;">-</span> <span style="color: #002200;">&#40;</span><span style="color: #a61390;">void</span><span style="color: #002200;">&#41;</span> drawRect<span style="color: #002200;">:</span><span style="color: #002200;">&#40;</span>CGRect<span style="color: #002200;">&#41;</span>rect <span style="color: #002200;">&#123;</span><br />
&nbsp; &nbsp; &nbsp;<br />
&nbsp; &nbsp; &nbsp;<span style="color: #002200;">&#91;</span>self setTintColor<span style="color: #002200;">:</span><span style="color: #002200;">&#91;</span>UIColor colorWithRed<span style="color: #002200;">:</span>0.5f<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; green<span style="color: #002200;">:</span> 0.5f<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; blue<span style="color: #002200;">:</span><span style="color: #2400d9;">0</span> <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; alpha<span style="color: #002200;">:</span><span style="color: #2400d9;">1</span><span style="color: #002200;">&#93;</span><span style="color: #002200;">&#93;</span>;<br />
&nbsp; &nbsp; &nbsp;<br />
&nbsp; &nbsp; &nbsp;<span style="color: #a61390;">if</span> <span style="color: #002200;">&#40;</span><span style="color: #002200;">&#91;</span>self.topItem.title length<span style="color: #002200;">&#93;</span> &gt; <span style="color: #2400d9;">0</span> <span style="color: #002200;">&amp;&amp;</span> <span style="color: #002200;">!</span><span style="color: #002200;">&#91;</span>self.topItem.title isEqualToString<span style="color: #002200;">:</span><span style="color: #bf1d1a;">@</span><span style="color: #bf1d1a;">&quot;Back to ...&quot;</span><span style="color: #002200;">&#93;</span><span style="color: #002200;">&#41;</span> <span style="color: #002200;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #002200;">&#91;</span><span style="color: #002200;">&#91;</span>UIImage imageNamed<span style="color: #002200;">:</span><span style="color: #bf1d1a;">@</span><span style="color: #bf1d1a;">&quot;Header_1px.png&quot;</span><span style="color: #002200;">&#93;</span> drawInRect<span style="color: #002200;">:</span>rect<span style="color: #002200;">&#93;</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; CGRect frame <span style="color: #002200;">=</span> CGRectMake<span style="color: #002200;">&#40;</span><span style="color: #2400d9;">0</span>, <span style="color: #2400d9;">0</span>, <span style="color: #2400d9;">320</span>, <span style="color: #2400d9;">44</span><span style="color: #002200;">&#41;</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; UILabel <span style="color: #002200;">*</span>label <span style="color: #002200;">=</span> <span style="color: #002200;">&#91;</span><span style="color: #002200;">&#91;</span><span style="color: #002200;">&#91;</span>UILabel alloc<span style="color: #002200;">&#93;</span> initWithFrame<span style="color: #002200;">:</span>frame<span style="color: #002200;">&#93;</span> autorelease<span style="color: #002200;">&#93;</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #002200;">&#91;</span>label setBackgroundColor<span style="color: #002200;">:</span><span style="color: #002200;">&#91;</span>UIColor clearColor<span style="color: #002200;">&#93;</span><span style="color: #002200;">&#93;</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; label.font <span style="color: #002200;">=</span> <span style="color: #002200;">&#91;</span>UIFont boldSystemFontOfSize<span style="color: #002200;">:</span> <span style="color: #2400d9;">20.0</span><span style="color: #002200;">&#93;</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; label.shadowColor <span style="color: #002200;">=</span> <span style="color: #002200;">&#91;</span>UIColor colorWithWhite<span style="color: #002200;">:</span><span style="color: #2400d9;">0.0</span> alpha<span style="color: #002200;">:</span><span style="color: #2400d9;">1</span><span style="color: #002200;">&#93;</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; label.textAlignment <span style="color: #002200;">=</span> UITextAlignmentCenter;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; label.textColor <span style="color: #002200;">=</span> <span style="color: #002200;">&#91;</span>UIColor whiteColor<span style="color: #002200;">&#93;</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; label.text <span style="color: #002200;">=</span> self.topItem.title;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; self.topItem.titleView <span style="color: #002200;">=</span> label;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp;<span style="color: #002200;">&#125;</span> <span style="color: #a61390;">else</span> <span style="color: #002200;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #002200;">&#91;</span><span style="color: #002200;">&#91;</span>UIImage imageNamed<span style="color: #002200;">:</span><span style="color: #bf1d1a;">@</span><span style="color: #bf1d1a;">&quot;Header.png&quot;</span><span style="color: #002200;">&#93;</span> drawInRect<span style="color: #002200;">:</span>rect<span style="color: #002200;">&#93;</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;self.topItem.titleView <span style="color: #002200;">=</span> <span style="color: #002200;">&#91;</span><span style="color: #002200;">&#91;</span><span style="color: #002200;">&#91;</span>UIView alloc<span style="color: #002200;">&#93;</span> init<span style="color: #002200;">&#93;</span> autorelease<span style="color: #002200;">&#93;</span>;<br />
&nbsp; &nbsp; &nbsp;<span style="color: #002200;">&#125;</span><br />
<span style="color: #002200;">&#125;</span><br />
<br />
<span style="color: #a61390;">@end</span></div></td></tr></tbody></table></div>
<p><object width="425" height="344"><param name="movie" value="http://www.youtube.com/v/HJKUIFfOThI&#038;hl=en_US&#038;fs=1&#038;"></param><param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param><embed src="http://www.youtube.com/v/HJKUIFfOThI&#038;hl=en_US&#038;fs=1&#038;" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="425" height="344"></embed></object></p>
<p><a href="http://www.developers-life.com/wp-content/plugins/download_counter/redirect.php?id=8" target="_blank"><img src="http://www.developers-life.com/wp-content/plugins/download_counter/redirect.php?pid=8" border="0" alt="" />source</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.developers-life.com/custom-uinavigationbar-with-image-and-back-button.html/feed</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>How to find bug in xCode project of iPhone application.</title>
		<link>http://www.developers-life.com/how-to-find-bug-in-xcode-project-of-iphone-application.html</link>
		<comments>http://www.developers-life.com/how-to-find-bug-in-xcode-project-of-iphone-application.html#comments</comments>
		<pubDate>Sun, 17 Jan 2010 23:21:05 +0000</pubDate>
		<dc:creator>Vladimir Boychentsov</dc:creator>
				<category><![CDATA[Apple]]></category>
		<category><![CDATA[iPhone]]></category>
		<category><![CDATA[OOP]]></category>
		<category><![CDATA[Debugger]]></category>
		<category><![CDATA[objective-c]]></category>
		<category><![CDATA[OS]]></category>
		<category><![CDATA[QA]]></category>
		<category><![CDATA[UIKit]]></category>
		<category><![CDATA[Кодинг]]></category>

		<guid isPermaLink="false">http://www.developers-life.com/?p=776</guid>
		<description><![CDATA[]]></description>
			<content:encoded><![CDATA[<p><object width="425" height="344"><param name="movie" value="http://www.youtube.com/v/U0eABmtVXWg&#038;hl=en_US&#038;fs=1&#038;"></param><param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param><embed src="http://www.youtube.com/v/U0eABmtVXWg&#038;hl=en_US&#038;fs=1&#038;" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="425" height="344"></embed></object></p>
]]></content:encoded>
			<wfw:commentRss>http://www.developers-life.com/how-to-find-bug-in-xcode-project-of-iphone-application.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>call controller methods from class</title>
		<link>http://www.developers-life.com/call-controller-methods-from-class.html</link>
		<comments>http://www.developers-life.com/call-controller-methods-from-class.html#comments</comments>
		<pubDate>Thu, 14 Jan 2010 04:24:09 +0000</pubDate>
		<dc:creator>Vladimir Boychentsov</dc:creator>
				<category><![CDATA[iPhone]]></category>
		<category><![CDATA[OOP]]></category>
		<category><![CDATA[objective-c]]></category>
		<category><![CDATA[Xcode]]></category>

		<guid isPermaLink="false">http://www.developers-life.com/?p=769</guid>
		<description><![CDATA[I created a class (Foo.m) which I would like to be able to call a method in the controller (MainViewController.m) which instantiated it. How do I do this? One way you can do this is to create a property in your Foo class that references its creator. You should not retain this reference to avoid [...]]]></description>
			<content:encoded><![CDATA[<blockquote><p>I created a class (Foo.m) which I would like to be able to call a method in the controller (MainViewController.m) which instantiated it. How do I do this?</p></blockquote>
<p>One way you can do this is to create a property in your Foo class that references its creator. You should not retain this reference to avoid circular references, but the code might look like the following</p>
<div class="codecolorer-container objc geshi" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:810px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br />3<br />4<br /></div></td><td><div class="objc codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #002200;">-</span> <span style="color: #002200;">&#40;</span><span style="color: #a61390;">void</span><span style="color: #002200;">&#41;</span> yourControllerClassMethod <span style="color: #002200;">&#123;</span><br />
&nbsp; &nbsp; Foo<span style="color: #002200;">*</span> f <span style="color: #002200;">=</span> <span style="color: #002200;">&#91;</span><span style="color: #002200;">&#91;</span>Foo alloc<span style="color: #002200;">&#93;</span> init<span style="color: #002200;">&#93;</span>;<br />
&nbsp; &nbsp; <span style="color: #002200;">&#91;</span>f setOwnder<span style="color: #002200;">:</span>self<span style="color: #002200;">&#93;</span>;<br />
<span style="color: #002200;">&#125;</span></div></td></tr></tbody></table></div>
<p>In this case, your Foo class has a property called owner which is set when the Controller class makes a new Foo instance. Now from your Foo class you can call controller methods like this:</p>
<div class="codecolorer-container objc geshi" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:810px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br /></div></td><td><div class="objc codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #002200;">&#91;</span><span style="color: #002200;">&#91;</span>self owner<span style="color: #002200;">&#93;</span> callSomeControllerMethod<span style="color: #002200;">&#93;</span>;</div></td></tr></tbody></table></div>
]]></content:encoded>
			<wfw:commentRss>http://www.developers-life.com/call-controller-methods-from-class.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

