<?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>iOS Developer Tips Blog &#187; General</title>
	<atom:link href="http://iPhoneDeveloperTips.com/category/general/feed" rel="self" type="application/rss+xml" />
	<link>http://iPhoneDeveloperTips.com</link>
	<description>iOS Developer Tips, Tricks and Tutorials.</description>
	<lastBuildDate>Wed, 08 Feb 2012 13:40:45 +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>Resources for Internationalization and Localization</title>
		<link>http://iPhoneDeveloperTips.com/general/resources-for-internationalization-and-localization.html</link>
		<comments>http://iPhoneDeveloperTips.com/general/resources-for-internationalization-and-localization.html#comments</comments>
		<pubDate>Mon, 01 Aug 2011 08:01:41 +0000</pubDate>
		<dc:creator>John Muchow</dc:creator>
				<category><![CDATA[General]]></category>

		<guid isPermaLink="false">http://iPhoneDeveloperTips.com/?p=9156</guid>
		<description><![CDATA[Apple has an abundance of information available if you are interested to learn more about Internationalization and Localization of your applications. Follow the links below to get started: Internationalization Programming Topics Locales Programming Guide Data Formatting Guide Sample Code: International Mountains Additional Internationalization Tools and Resources]]></description>
			<content:encoded><![CDATA[<p><a href="http://iPhoneDeveloperTips.com/wp-content/uploads/2011/07/intl.jpeg"><img src="http://iPhoneDeveloperTips.com/wp-content/uploads/2011/07/intl-150x150.jpg" alt="" title="intl" width="150" height="150" class="alignright size-thumbnail wp-image-9181" /></a>Apple has an abundance of information available if you are interested to learn more about Internationalization and Localization of your applications. Follow the links below to get started:</p>
<p><a href="http://developer.apple.com/library/ios/#documentation/MacOSX/Conceptual/BPInternational/BPInternational.html" target="_blank">Internationalization Programming Topics</a></p>
<p><a href="http://developer.apple.com/library/ios/#documentation/CoreFoundation/Conceptual/CFLocales/CFLocales.html" target="_blank">Locales Programming Guide</a></p>
<p><a href="http://developer.apple.com/library/ios/#documentation/Cocoa/Conceptual/DataFormatting/DataFormatting.html" target="_blank">Data Formatting Guide</a></p>
<p><a href="http://developer.apple.com/library/ios/#samplecode/InternationalMountains/Introduction/Intro.html" target="_blank">Sample Code: International Mountains</a></p>
<p><a href="http://developer.apple.com/internationalization/downloads/" target="_blank">Additional Internationalization Tools and Resources</a></p>
<div id="fb-root"></div><script src="http://connect.facebook.net/en_US/all.js#xfbml=1"></script><!-- Do not remove -->]]></content:encoded>
			<wfw:commentRss>http://iPhoneDeveloperTips.com/general/resources-for-internationalization-and-localization.html/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Create a Universally Unique Identifier (UUID)</title>
		<link>http://iPhoneDeveloperTips.com/general/create-a-universally-unique-identifier-uuid.html</link>
		<comments>http://iPhoneDeveloperTips.com/general/create-a-universally-unique-identifier-uuid.html#comments</comments>
		<pubDate>Mon, 29 Nov 2010 02:31:48 +0000</pubDate>
		<dc:creator>John Muchow</dc:creator>
				<category><![CDATA[General]]></category>

		<guid isPermaLink="false">http://iPhoneDeveloperTips.com/?p=7069</guid>
		<description><![CDATA[UUID&#8217;s are 128-bit values which are guaranteed to be unique &#8211; typically the value is based on a machines ethernet address combined with the current time since October 15, 1582. UUID&#8217;s are string values separated by hyphens, for example, here is how a UUID may look: 13222F23-C76A-7781-0C12-0293E3B34398. The method below creates a UUID and returns [...]]]></description>
			<content:encoded><![CDATA[<p>UUID&#8217;s are 128-bit values which are guaranteed to be unique &#8211; typically the value is based on a machines ethernet address combined with the current time since October 15, 1582.</p>
<p>UUID&#8217;s are string values separated by hyphens, for example, here is how a UUID may look: 13222F23-C76A-7781-0C12-0293E3B34398. </p>
<p>The method below creates a UUID and returns a string representation of the same:<br />
<span id="more-7069"></span><br />
&nbsp;</p>
<h5>Create UUID</h5>

<div class="wp_syntax"><div class="code"><pre class="objc" style="font-family:monospace;"><span style="color: #002200;">-</span> <span style="color: #002200;">&#40;</span><span style="color: #400080;">NSString</span> <span style="color: #002200;">*</span><span style="color: #002200;">&#41;</span>createUUID
<span style="color: #002200;">&#123;</span>
  <span style="color: #11740a; font-style: italic;">// Create universally unique identifier (object)</span>
  CFUUIDRef uuidObject <span style="color: #002200;">=</span> CFUUIDCreate<span style="color: #002200;">&#40;</span>kCFAllocatorDefault<span style="color: #002200;">&#41;</span>;
&nbsp;
  <span style="color: #11740a; font-style: italic;">// Get the string representation of CFUUID object.</span>
  <span style="color: #400080;">NSString</span> <span style="color: #002200;">*</span>uuidStr <span style="color: #002200;">=</span> <span style="color: #002200;">&#91;</span><span style="color: #002200;">&#40;</span><span style="color: #400080;">NSString</span> <span style="color: #002200;">*</span><span style="color: #002200;">&#41;</span>CFUUIDCreateString<span style="color: #002200;">&#40;</span>kCFAllocatorDefault, uuidObject<span style="color: #002200;">&#41;</span> autorelease<span style="color: #002200;">&#93;</span>;
&nbsp;
  <span style="color: #11740a; font-style: italic;">// If needed, here is how to get a representation in bytes, returned as a structure</span>
  <span style="color: #11740a; font-style: italic;">// typedef struct {</span>
  <span style="color: #11740a; font-style: italic;">//   UInt8 byte0;</span>
  <span style="color: #11740a; font-style: italic;">//   UInt8 byte1;</span>
  <span style="color: #11740a; font-style: italic;">//   ...</span>
  <span style="color: #11740a; font-style: italic;">//   UInt8 byte15;</span>
  <span style="color: #11740a; font-style: italic;">// } CFUUIDBytes;</span>
  CFUUIDBytes bytes <span style="color: #002200;">=</span> CFUUIDGetUUIDBytes<span style="color: #002200;">&#40;</span>uuidObject<span style="color: #002200;">&#41;</span>;
&nbsp;
  CFRelease<span style="color: #002200;">&#40;</span>uuidObject<span style="color: #002200;">&#41;</span>;
&nbsp;
  <span style="color: #a61390;">return</span> uuidStr;
<span style="color: #002200;">&#125;</span></pre></div></div>

<div id="fb-root"></div><script src="http://connect.facebook.net/en_US/all.js#xfbml=1"></script><!-- Do not remove -->]]></content:encoded>
			<wfw:commentRss>http://iPhoneDeveloperTips.com/general/create-a-universally-unique-identifier-uuid.html/feed</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>Voices That Matter iPhone Developers Conference &#8211; Register Now and Save $150</title>
		<link>http://iPhoneDeveloperTips.com/general/voices-that-matter-iphone-developers-conference-register-now-and-save-150.html</link>
		<comments>http://iPhoneDeveloperTips.com/general/voices-that-matter-iphone-developers-conference-register-now-and-save-150.html#comments</comments>
		<pubDate>Tue, 21 Sep 2010 02:15:46 +0000</pubDate>
		<dc:creator>John Muchow</dc:creator>
				<category><![CDATA[General]]></category>

		<guid isPermaLink="false">http://iPhoneDeveloperTips.com/?p=6977</guid>
		<description><![CDATA[Great news, our friends organizing the Voices That Matter: iPhone Developers Conference on October 24-25 in Philadelphia, have graciously provided iPhone Developer Tips readers a $150 savings on event registration, valid now until the start of the conference. This 2-day event offers dozens of interactive conference sessions across five conference tracks. Lots of new speakers [...]]]></description>
			<content:encoded><![CDATA[<p>Great news, our friends organizing the <a  target="_blank"  href="http://iphonedevelopertips.com/?wp_ct=31">Voices That Matter: iPhone Developers Conference</a> on October 24-25 in Philadelphia, have graciously provided iPhone Developer Tips readers a $150 savings on event registration, valid now until the start of the conference.</p>
<p>This 2-day event offers dozens of interactive conference sessions across five conference tracks. Lots of new speakers have been added to the agenda since I <a  target="_blank"  href="http://iphonedevelopertips.com/announcements/voices-that-matter-iphone-developers-conference-philadelphia-pa-october-16th-and-17th-2010.html">last updated you on this event</a> including Mike Daley, Jessica Kahn, Jeff LaMarche, and Graham Lee. These speakers will be joining Mike Lee, Aaron Hillegass, Erica Sadun, Stephen Kochan, Rod Strougo, Christian Hofstader and many others for this much anticipated event. Take a look at the complete speaker list and agenda <a href="http://www.voicesthatmatter.com/iphonefall2010">here</a>.</p>
<p>To save $150 off your conference registration, provide priority code PHEM929 when you register online, call 617-848-7026 or send an email to Barbara.Gavin@pearson.com mentioning the iPhone Developer Tips discount priority code.</p>
<div id="fb-root"></div><script src="http://connect.facebook.net/en_US/all.js#xfbml=1"></script><!-- Do not remove -->]]></content:encoded>
			<wfw:commentRss>http://iPhoneDeveloperTips.com/general/voices-that-matter-iphone-developers-conference-register-now-and-save-150.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Show Your Support for iPhoneDeveloperTips.com</title>
		<link>http://iPhoneDeveloperTips.com/general/show-your-support-for-iphonedevelopertips-com.html</link>
		<comments>http://iPhoneDeveloperTips.com/general/show-your-support-for-iphonedevelopertips-com.html#comments</comments>
		<pubDate>Thu, 17 Dec 2009 21:31:59 +0000</pubDate>
		<dc:creator>John Muchow</dc:creator>
				<category><![CDATA[General]]></category>

		<guid isPermaLink="false">http://iPhoneDeveloperTips.com/?p=4928</guid>
		<description><![CDATA[Since launching iPhone Developer Tips back in August of 2008, there have been almost 200 tips, tricks and tutorials posted, an average of just over 12 posts per month. The number of page views on a monthly basis is pushing 70,000. All things considered, not too bad&#8230; My primary motivation with this blog is to [...]]]></description>
			<content:encoded><![CDATA[<p>Since launching iPhone Developer Tips back in August of 2008, there have been almost 200 tips, tricks and tutorials posted, an average of just over 12 posts per month. The  number of page views on a monthly basis is pushing 70,000. All things considered, not too bad&#8230;</p>
<p>My primary motivation with this blog is to give back to the same community of developers who have provided help and insight to me over my 20 years in software development. Beyond the obvious time commitment and labor of love to keep writing content, there are costs to keep this machine running &#8211; if you would like to show your support for iPhone Developer Tips, please consider clicking through the Amazon link below as you go about your holiday shopping, or if you prefer, a Paypal donation is welcome:</p>
<p><iframe src="http://rcm.amazon.com/e/cm?t=iphonedevelopertips-20&#038;o=1&#038;p=42&#038;l=ur1&#038;category=holiday&#038;banner=1G5BQ75SPE4E92WAJA82&#038;f=ifr" width="234" height="60" scrolling="no" border="0" marginwidth="0" style="border:none;" frameborder="0"></iframe></p>
<p>[paypal-donation]</p>
<p><img border="0" height=5 src="/images/blank.gif" ></p>
<p>Thank you very much and Happy Holidays!</p>
<p>John</p>
<div id="fb-root"></div><script src="http://connect.facebook.net/en_US/all.js#xfbml=1"></script><!-- Do not remove -->]]></content:encoded>
			<wfw:commentRss>http://iPhoneDeveloperTips.com/general/show-your-support-for-iphonedevelopertips-com.html/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>UIActionSheet to Display Text Only Messages</title>
		<link>http://iPhoneDeveloperTips.com/general/uiactionsheet-to-display-text-only-messages.html</link>
		<comments>http://iPhoneDeveloperTips.com/general/uiactionsheet-to-display-text-only-messages.html#comments</comments>
		<pubDate>Wed, 21 Oct 2009 11:58:30 +0000</pubDate>
		<dc:creator>John Muchow</dc:creator>
				<category><![CDATA[General]]></category>

		<guid isPermaLink="false">http://iPhoneDeveloperTips.com/?p=4321</guid>
		<description><![CDATA[UIActionSheet offers a really handy basic menu system, where each button presents an option for the user to choose from. For example, the figure below shows how I am using UIActionSheet to show three menu options for a shopping list view I am working on. I&#8217;ve found another good use for UIActionSheet, to show text [...]]]></description>
			<content:encoded><![CDATA[<p><strong>UIActionSheet</strong> offers a really handy basic menu system, where each button presents an option for the user to choose from. For example, the figure below shows how I am using <strong>UIActionSheet</strong> to show three menu options for a shopping list view I am working on.</p>
<p><img width="200" src="http://iPhoneDeveloperTips.com/wp-content/uploads/2009/10/menu1.png" /><br />
<span id="more-4321"></span></p>
<p>I&#8217;ve found another good use for <strong>UIActionSheet</strong>, to show text messages with minimal coding and overhead. You might use this idea to show content sensitive help text, or maybe display a message that is shown only once upon the first run of an application.</p>
<p>You can get an idea of the look that I&#8217;m after from the figure below. In this example I&#8217;m showing nothing more than three paragraphs of text and a button to dismiss the view.</p>
<p><img width="200" src="http://iPhoneDeveloperTips.com/wp-content/uploads/2009/10/menu2.png" /></p>
<p>It&#8217;s almost embarrassing to show the code as there&#8217;s really nothing to it:</p>

<div class="wp_syntax"><div class="code"><pre class="objc" style="font-family:monospace;">    UIActionSheet <span style="color: #002200;">*</span>msg <span style="color: #002200;">=</span> <span style="color: #002200;">&#91;</span><span style="color: #002200;">&#91;</span><span style="color: #002200;">&#91;</span>UIActionSheet alloc<span style="color: #002200;">&#93;</span> 
        initWithTitle<span style="color: #002200;">:</span><span style="color: #bf1d1a;">@</span><span style="color: #bf1d1a;">&quot;Lorem ipsum dolor...text goes here&quot;</span> 
        delegate<span style="color: #002200;">:</span><span style="color: #a61390;">nil</span> 
        cancelButtonTitle<span style="color: #002200;">:</span><span style="color: #a61390;">nil</span>  destructiveButtonTitle<span style="color: #002200;">:</span><span style="color: #a61390;">nil</span> 
        otherButtonTitles<span style="color: #002200;">:</span><span style="color: #bf1d1a;">@</span><span style="color: #bf1d1a;">&quot;Okay&quot;</span>, <span style="color: #a61390;">nil</span><span style="color: #002200;">&#93;</span> 
        autorelease<span style="color: #002200;">&#93;</span>;
    <span style="color: #002200;">&#91;</span>msg showInView<span style="color: #002200;">:</span>window<span style="color: #002200;">&#93;</span>;</pre></div></div>

<p>We have no need for a delegate in this case, and by setting all but the &#8220;Okay&#8221; button to nil, we have just one button.</p>
<p>The beauty of using a <strong>UIActionSheet</strong> for this type of information is that presentation is handled for you (sliding into place), all other UI elements are obscured (a modal presentation) and it&#8217;s ridiculously simple to implement.</p>
<div id="fb-root"></div><script src="http://connect.facebook.net/en_US/all.js#xfbml=1"></script><!-- Do not remove -->]]></content:encoded>
			<wfw:commentRss>http://iPhoneDeveloperTips.com/general/uiactionsheet-to-display-text-only-messages.html/feed</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>Create an iPhone Icon with No Border</title>
		<link>http://iPhoneDeveloperTips.com/general/create-an-iphone-icon-with-no-border.html</link>
		<comments>http://iPhoneDeveloperTips.com/general/create-an-iphone-icon-with-no-border.html#comments</comments>
		<pubDate>Tue, 22 Sep 2009 02:13:31 +0000</pubDate>
		<dc:creator>John Muchow</dc:creator>
				<category><![CDATA[General]]></category>

		<guid isPermaLink="false">http://iPhoneDeveloperTips.com/?p=3952</guid>
		<description><![CDATA[In this tip on how to remove the shine/gloss effect on an iPhone icon, I showed the steps to go from an icon that looks like this: to an icon that looks like this: I got a question earlier today from a reader asking: &#8220;how can I create an icon with no shine effect and [...]]]></description>
			<content:encoded><![CDATA[<p>In this tip on <a href="http://iphonedevelopertips.com/general/remove-shine-gloss-effect-on-iphone-icon.html">how to remove the shine/gloss effect on an iPhone icon</a>, I showed the steps to go from an icon that looks like this:</p>
<p><img src="http://iphonedevelopertips.com/wp-content/uploads/2009/07/icon1.png" alt="" /></p>
<p>to an icon that looks like this:</p>
<p><img src="http://iphonedevelopertips.com/wp-content/uploads/2009/07/icon2.png" alt="" /></p>
<p>I got a question earlier today from a reader asking: &#8220;<span style="color: #333399;"><em>how can I create an icon with no shine effect <span style="color: #333399;"><span style="text-decoration: underline;">and</span></span> no border around it ?</em></span> &#8220;, such as this:<br />
<span id="more-3952"></span></p>
<p><img src="http://iPhoneDeveloperTips.com/wp-content/uploads/2009/09/icon-noborder.png" alt="" /></p>
<p>Here&#8217;s all you need to do:</p>
<blockquote>
<ol>
<li>Create an image with no border (57 x 57 pixels)</li>
<li>Save the image as a transparent PNG file with the name Icon.png</li>
<li>Import the file into your Xcode project Resources folder</li>
<li>Set the <strong>UIPrerenderedIcon</strong> to <strong>YES</strong> as shown here:<a href="http://iphonedevelopertips.com/general/remove-shine-gloss-effect-on-iphone-icon.html"> removing icon shine/gloss effect</a></li>
</ol>
</blockquote>
<div id="fb-root"></div><script src="http://connect.facebook.net/en_US/all.js#xfbml=1"></script><!-- Do not remove -->]]></content:encoded>
			<wfw:commentRss>http://iPhoneDeveloperTips.com/general/create-an-iphone-icon-with-no-border.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Remove Shine / Gloss Effect on iPhone Icon</title>
		<link>http://iPhoneDeveloperTips.com/general/remove-shine-gloss-effect-on-iphone-icon.html</link>
		<comments>http://iPhoneDeveloperTips.com/general/remove-shine-gloss-effect-on-iphone-icon.html#comments</comments>
		<pubDate>Tue, 28 Jul 2009 03:45:08 +0000</pubDate>
		<dc:creator>John Muchow</dc:creator>
				<category><![CDATA[General]]></category>

		<guid isPermaLink="false">http://iPhoneDeveloperTips.com/?p=2829</guid>
		<description><![CDATA[By default, when building an application with Xcode, your icon will have a round beveling of the corners and a shine added over the top of the icon. The icon below shows how this looks: You can override this default by following line to you to the Info.plist file. For example, if you prefer to [...]]]></description>
			<content:encoded><![CDATA[<p>By default, when building an application with Xcode, your icon will have a round beveling of the corners and a shine added over the top of the icon. The icon below shows how this looks:</p>
<p><img src="http://iPhoneDeveloperTips.com/wp-content/uploads/2009/07/icon1.png" /></p>
<p>You can override this default by following line to you to the Info.plist file. For example, if you prefer to edit Info.plist as a source file, add the following line:<br />
<span id="more-2829"></span></p>

<div class="wp_syntax"><div class="code"><pre class="objc" style="font-family:monospace;">&lt;key&gt;UIPrerenderedIcon&lt;<span style="color: #002200;">/</span>key&gt;
&lt;true<span style="color: #002200;">/</span>&gt;</pre></div></div>

<p>If you are editing Info.plist as an XML file (in Xcode) you can add an entry that looks as follows:</p>
<p><img src="http://iPhoneDeveloperTips.com/wp-content/uploads/2009/07/icon3.png" /> </p>
<p>Depending on your configuration and version of Xcode, the option in the Info.plist file may looks as follows:</p>
<p><img src="http://iPhoneDeveloperTips.com/wp-content/uploads/2009/09/prerendered-icon.png" /></p>
<p>With the pre-rendered icon set to true, the icon shown above will now look like this:</p>
<p><img src="http://iPhoneDeveloperTips.com/wp-content/uploads/2009/07/icon2.png" /></p>
<p>This preference setting only applies to removing of the shine / glossy effect, the corners of your icon will still be rounded for you.</p>
<div id="fb-root"></div><script src="http://connect.facebook.net/en_US/all.js#xfbml=1"></script><!-- Do not remove -->]]></content:encoded>
			<wfw:commentRss>http://iPhoneDeveloperTips.com/general/remove-shine-gloss-effect-on-iphone-icon.html/feed</wfw:commentRss>
		<slash:comments>16</slash:comments>
		</item>
		<item>
		<title>Safari 4 Beta</title>
		<link>http://iPhoneDeveloperTips.com/general/safari-4-beta.html</link>
		<comments>http://iPhoneDeveloperTips.com/general/safari-4-beta.html#comments</comments>
		<pubDate>Mon, 02 Mar 2009 03:03:43 +0000</pubDate>
		<dc:creator>John Muchow</dc:creator>
				<category><![CDATA[General]]></category>
		<category><![CDATA[Safari]]></category>

		<guid isPermaLink="false">http://iPhoneDeveloperTips.com/?p=1610</guid>
		<description><![CDATA[A little off topic, but a good tip none the less. Apple recently released Safari 4 beta and if you haven&#8217;t given it a try, I highly recommend you do. The primary reason for passing on this tip is that my web browsing experience with Firefox over the past few months has been extremely frustrating [...]]]></description>
			<content:encoded><![CDATA[<p>A little off topic, but a good tip none the less. Apple recently released <a target="_blank" href="http://www.apple.com/safari/download/">Safari 4 beta</a> and if you haven&#8217;t given it a try, I highly recommend you do.<br />
<span id="more-1610"></span></p>
<p>The primary reason for passing on this tip is that my web browsing experience with Firefox over the past few months has been extremely frustrating (read slow!). From the moment I started the Safari 4 beta it was clear the performance was superior to Firefox. I realize there may be more to this than simply a faster browser, as my system could use a good house cleaning. However, I continue to go between both browsers and Safari is no doubt my new browser of choice for the bulk of my time on the net.</p>
<p>There is one default setting that I immediately had to change in Safari, and that&#8217;s the location of the tabs. If you haven&#8217;t tried the new browser, the figure below shows how the tab bar is now on top. </p>
<p><img src="http://iPhoneDeveloperTips.com/wp-content/uploads/2009/03/safari1.png" /></p>
<p>I just couldn&#8217;t get used to this. Here&#8217;s how to change the tabbar to the &#8220;normal&#8221; location &#8211; from a terminal enter the following:</p>
<pre>
defaults write com.apple.Safari DebugSafari4TabBarIsOnTop -bool NO
</pre>
<p>You can find a list of additional configuration changes available in Safari 4 <a  target="_blank" href="http://swedishcampground.com/safari-4-hidden-preferences">here</a>. Beyond the tips, the <a  target="_blank" href="http://swedishcampground.com/about">About page</a> is worth a visit, an interesting bit of trivia to be had&#8230;</p>
<div id="fb-root"></div><script src="http://connect.facebook.net/en_US/all.js#xfbml=1"></script><!-- Do not remove -->]]></content:encoded>
			<wfw:commentRss>http://iPhoneDeveloperTips.com/general/safari-4-beta.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Using NSScanner to convert Hex to RGB Color</title>
		<link>http://iPhoneDeveloperTips.com/general/using-nsscanner-to-convert-hex-to-rgb-color.html</link>
		<comments>http://iPhoneDeveloperTips.com/general/using-nsscanner-to-convert-hex-to-rgb-color.html#comments</comments>
		<pubDate>Sat, 28 Feb 2009 18:31:59 +0000</pubDate>
		<dc:creator>Rodney Aiglstorfer</dc:creator>
				<category><![CDATA[General]]></category>

		<guid isPermaLink="false">http://iPhoneDeveloperTips.com/?p=1604</guid>
		<description><![CDATA[I&#8217;ve found that defining a custom UIColor using RGB values is a little counter intuitive compared to the more common hexadecimal notation used in CSS. This is particularly true if you want to define a color value in a file and don&#8217;t want to have to split it into three separate values. For the most [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve found that defining a custom UIColor using RGB values is a little counter intuitive compared to the more common hexadecimal notation used in CSS.  This is particularly true if you want to define a color value in a file and don&#8217;t want to have to split it into three separate values.</p>
<p>For the most part, NSScanner has everything we need to parse data types (int, float, string etc) from a string.<br />
<span id="more-1604"></span><br />
The following is a simple method that will convert a hexadecimal color (e.g. #FFCC88) into an equivalent UIColor object.</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
</pre></td><td class="code"><pre class="objc" style="font-family:monospace;"><span style="color: #002200;">-</span> <span style="color: #002200;">&#40;</span>UIColor <span style="color: #002200;">*</span><span style="color: #002200;">&#41;</span> colorForHex<span style="color: #002200;">:</span><span style="color: #002200;">&#40;</span><span style="color: #400080;">NSString</span> <span style="color: #002200;">*</span><span style="color: #002200;">&#41;</span>hexColor <span style="color: #002200;">&#123;</span>
	hexColor <span style="color: #002200;">=</span> <span style="color: #002200;">&#91;</span><span style="color: #002200;">&#91;</span>hexColor stringByTrimmingCharactersInSet<span style="color: #002200;">:</span>
				 <span style="color: #002200;">&#91;</span><span style="color: #400080;">NSCharacterSet</span> whitespaceAndNewlineCharacterSet<span style="color: #002200;">&#93;</span>
				<span style="color: #002200;">&#93;</span> uppercaseString<span style="color: #002200;">&#93;</span>;  
&nbsp;
    <span style="color: #11740a; font-style: italic;">// String should be 6 or 7 characters if it includes '#'  </span>
    <span style="color: #a61390;">if</span> <span style="color: #002200;">&#40;</span><span style="color: #002200;">&#91;</span>hexColor length<span style="color: #002200;">&#93;</span> <span style="color: #002200;">&amp;</span>lt; <span style="color: #2400d9;">6</span><span style="color: #002200;">&#41;</span> 
		<span style="color: #a61390;">return</span> <span style="color: #002200;">&#91;</span>UIColor blackColor<span style="color: #002200;">&#93;</span>;  
&nbsp;
    <span style="color: #11740a; font-style: italic;">// strip # if it appears  </span>
    <span style="color: #a61390;">if</span> <span style="color: #002200;">&#40;</span><span style="color: #002200;">&#91;</span>hexColor hasPrefix<span style="color: #002200;">:</span><span style="color: #bf1d1a;">@</span><span style="color: #bf1d1a;">&quot;#&quot;</span><span style="color: #002200;">&#93;</span><span style="color: #002200;">&#41;</span> 
		hexColor <span style="color: #002200;">=</span> <span style="color: #002200;">&#91;</span>cString substringFromIndex<span style="color: #002200;">:</span><span style="color: #2400d9;">1</span><span style="color: #002200;">&#93;</span>;  
&nbsp;
    <span style="color: #11740a; font-style: italic;">// if the value isn't 6 characters at this point return </span>
    <span style="color: #11740a; font-style: italic;">// the color black	</span>
    <span style="color: #a61390;">if</span> <span style="color: #002200;">&#40;</span><span style="color: #002200;">&#91;</span>hexColor length<span style="color: #002200;">&#93;</span> <span style="color: #002200;">!=</span> <span style="color: #2400d9;">6</span><span style="color: #002200;">&#41;</span> 
		<span style="color: #a61390;">return</span> <span style="color: #002200;">&#91;</span>UIColor blackColor<span style="color: #002200;">&#93;</span>;  
&nbsp;
    <span style="color: #11740a; font-style: italic;">// Separate into r, g, b substrings  </span>
    <span style="color: #a61390;">NSRange</span> range;  
    range.location <span style="color: #002200;">=</span> <span style="color: #2400d9;">0</span>;  
    range.length <span style="color: #002200;">=</span> <span style="color: #2400d9;">2</span>; 
&nbsp;
    <span style="color: #400080;">NSString</span> <span style="color: #002200;">*</span>rString <span style="color: #002200;">=</span> <span style="color: #002200;">&#91;</span>hexColor substringWithRange<span style="color: #002200;">:</span>range<span style="color: #002200;">&#93;</span>;  
&nbsp;
    range.location <span style="color: #002200;">=</span> <span style="color: #2400d9;">2</span>;  
    <span style="color: #400080;">NSString</span> <span style="color: #002200;">*</span>gString <span style="color: #002200;">=</span> <span style="color: #002200;">&#91;</span>hexColor substringWithRange<span style="color: #002200;">:</span>range<span style="color: #002200;">&#93;</span>;  
&nbsp;
    range.location <span style="color: #002200;">=</span> <span style="color: #2400d9;">4</span>;  
    <span style="color: #400080;">NSString</span> <span style="color: #002200;">*</span>bString <span style="color: #002200;">=</span> <span style="color: #002200;">&#91;</span>hexColor substringWithRange<span style="color: #002200;">:</span>range<span style="color: #002200;">&#93;</span>;  
&nbsp;
    <span style="color: #11740a; font-style: italic;">// Scan values  </span>
    <span style="color: #a61390;">unsigned</span> <span style="color: #a61390;">int</span> r, g, b;  
    <span style="color: #002200;">&#91;</span><span style="color: #002200;">&#91;</span><span style="color: #400080;">NSScanner</span> scannerWithString<span style="color: #002200;">:</span>rString<span style="color: #002200;">&#93;</span> scanHexInt<span style="color: #002200;">:&amp;</span>amp;r<span style="color: #002200;">&#93;</span>;  
    <span style="color: #002200;">&#91;</span><span style="color: #002200;">&#91;</span><span style="color: #400080;">NSScanner</span> scannerWithString<span style="color: #002200;">:</span>gString<span style="color: #002200;">&#93;</span> scanHexInt<span style="color: #002200;">:&amp;</span>amp;g<span style="color: #002200;">&#93;</span>;  
    <span style="color: #002200;">&#91;</span><span style="color: #002200;">&#91;</span><span style="color: #400080;">NSScanner</span> scannerWithString<span style="color: #002200;">:</span>bString<span style="color: #002200;">&#93;</span> scanHexInt<span style="color: #002200;">:&amp;</span>amp;b<span style="color: #002200;">&#93;</span>;  
&nbsp;
    <span style="color: #a61390;">return</span> <span style="color: #002200;">&#91;</span>UIColor colorWithRed<span style="color: #002200;">:</span><span style="color: #002200;">&#40;</span><span style="color: #002200;">&#40;</span><span style="color: #a61390;">float</span><span style="color: #002200;">&#41;</span> r <span style="color: #002200;">/</span> 255.0f<span style="color: #002200;">&#41;</span>  
                           green<span style="color: #002200;">:</span><span style="color: #002200;">&#40;</span><span style="color: #002200;">&#40;</span><span style="color: #a61390;">float</span><span style="color: #002200;">&#41;</span> g <span style="color: #002200;">/</span> 255.0f<span style="color: #002200;">&#41;</span>  
                            blue<span style="color: #002200;">:</span><span style="color: #002200;">&#40;</span><span style="color: #002200;">&#40;</span><span style="color: #a61390;">float</span><span style="color: #002200;">&#41;</span> b <span style="color: #002200;">/</span> 255.0f<span style="color: #002200;">&#41;</span>  
                           alpha<span style="color: #002200;">:</span>1.0f<span style="color: #002200;">&#93;</span>;  
&nbsp;
<span style="color: #002200;">&#125;</span></pre></td></tr></table></div>

<p>Notice that we had to first separate our the hex values for the red, green, and blue components first as substrings and then apply the NSScanner to those substrings.</p>
<div id="fb-root"></div><script src="http://connect.facebook.net/en_US/all.js#xfbml=1"></script><!-- Do not remove -->]]></content:encoded>
			<wfw:commentRss>http://iPhoneDeveloperTips.com/general/using-nsscanner-to-convert-hex-to-rgb-color.html/feed</wfw:commentRss>
		<slash:comments>11</slash:comments>
		</item>
		<item>
		<title>Capture iPhone Simulator Screenshots &#8211; Open Source Screen Capture Tool</title>
		<link>http://iPhoneDeveloperTips.com/general/open-source-screen-capture-tool.html</link>
		<comments>http://iPhoneDeveloperTips.com/general/open-source-screen-capture-tool.html#comments</comments>
		<pubDate>Mon, 23 Feb 2009 14:47:11 +0000</pubDate>
		<dc:creator>John Muchow</dc:creator>
				<category><![CDATA[General]]></category>
		<category><![CDATA[Tools]]></category>

		<guid isPermaLink="false">http://iPhoneDeveloperTips.com/?p=1563</guid>
		<description><![CDATA[I&#8217;ve been on the hunt for an open source screen cature tool for the Mac. I finally found what I was looking for, a tool that in which you can specify the exact size of the capture window. Let me explain&#8230; In the process of creating screenshots to accompany applications submitted to the App Store, [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve been on the hunt for an open source screen cature tool for the Mac. I finally found what I was looking for, a tool that in which you can specify the exact size of the capture window. Let me explain&#8230;</p>
<p>In the process of creating screenshots to accompany applications submitted to the App Store, you can include up to 5 images. Although the images can be anything you like, typically the images consist of screenshots of an application running in the iPhone simulator. When working with the simulator there are two sizes used most frequently, 320w x 460h (Apple recommends not to show the status bar across the top) and 480w x 320h (landscape mode).<br />
<span id="more-1563"></span></p>
<p>Until I found <a target="_blank" href="http://www.chimoosoft.com/products/captureme/">Capture Me</a>, I would use the built-in screen capture, command-shift-4, to capture screenshots. Problem is, there was no means to specify the exact image size to capture, so this approach requires either a very steady hand and a good eye, or capturing an area obviously larger than needed and cropping in Preview or another tool.</p>
<p>To use Capture Me, you specify the size of the area to capture and then drag a semi-transparent window over the capture area. Clicking inside the capture area creates a screenshot. You can save screenshots to the desktop (filename will be automatically generated) or have the screenshot copied to the clipboard, or both! </p>
<p>Capture Me also offers a screen recording feature, however, I haven&#8217;t given this a go as of yet.</p>
<p><strong>Additional Features:</strong><br />
Here are a few things that I think would make for some nice additions to Capture Me:</p>
<p>#1 &#8211; Specify the location to save the file</p>
<p>#2 &#8211; Specify the filename for the screenshot. For example, when capturing/uploading screenshots to the App Store I use the filenames &#8220;screenshot1.jpg&#8221; &#8220;screenshot2.jpg&#8221; etc. If I could tell Capture Me to use this same format, it would save me the trouble of renaming the files.</p>
<p>#3 &#8211; The third feature is a little harder to describe, so let me explain how I use the tool which should help clarify what I am after. As I mentioned above, I use Capture Me to create screenshots of the iPhone simulator, what this entails is dragging Capture Me over the simulator and clicking inside the Capture Me window. In order to create the next screenshot, I need to click/drag the Capture Me window and move it to the side, click on the iPhone simulator to setup the next screenshot, then drag the Capture Me window back over the simulator for the next capture. </p>
<p>If I could tell the Capture Me window to move to the left/right the same width of the area I am capturing (+/- a few pixles) I could quickly capture a series of screenshots with ease. Even better if one keyboard shortcut would tell Capture Me to slide to the left/right, and one shortcut to tell Capture Me to slide it back to it&#8217;s original location.</p>
<p>I hope to get some time over the coming weeks and/or months to poke around the Capture Me code and see how far I can get to add the features above. If you beat me to the punch, drop me a note, and count me in as a beta tester.</p>
<p>Many thanks to <a target="_blank" href="http://www.chimoosoft.com/">Chimoosoft</a> for creating, and open sourcing, <a  target="_blank" href="http://www.chimoosoft.com/products/captureme/">Capture Me</a>.</p>
<div id="fb-root"></div><script src="http://connect.facebook.net/en_US/all.js#xfbml=1"></script><!-- Do not remove -->]]></content:encoded>
			<wfw:commentRss>http://iPhoneDeveloperTips.com/general/open-source-screen-capture-tool.html/feed</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
	</channel>
</rss>

