<?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>Online Timesheet Software - TiMeister - Weblog &#187; iPhone SDK</title>
	<atom:link href="http://blog.timeister.com/category/iphone-sdk/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.timeister.com</link>
	<description>Free Online Timesheet Software - Calendar, StopWatch, Reports, Exports</description>
	<lastBuildDate>Wed, 09 Dec 2009 23:02:27 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Objective C: Zoom and Pintch UIImageView</title>
		<link>http://blog.timeister.com/2009/09/02/objective-c-zoom-image/</link>
		<comments>http://blog.timeister.com/2009/09/02/objective-c-zoom-image/#comments</comments>
		<pubDate>Wed, 02 Sep 2009 20:26:18 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[iPhone SDK]]></category>
		<category><![CDATA[image]]></category>
		<category><![CDATA[iphone]]></category>
		<category><![CDATA[pintch]]></category>
		<category><![CDATA[uiimageview]]></category>
		<category><![CDATA[zoom]]></category>

		<guid isPermaLink="false">http://blog.timeister.com/?p=465</guid>
		<description><![CDATA[

To get started, we have to
 1. Create a new project by selecting &#8220;Windows-based Application&#8221;
   2. Create a new UIView using IB and name it ImgView.
   3. Create a new file in XCode by selecting File -> New File -> UIViewController sub class and name it &#8220;ImgViewController&#8221;.
   4. In [...]]]></description>
			<content:encoded><![CDATA[<p><script type="text/javascript"><!--
google_ad_client = "pub-8937083430127082";
google_ad_slot = "8143431074";
google_ad_width = 300;
google_ad_height = 250;
//--></script>
<script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js"></script>
</p>
<p><strong>To get started, we have to</strong></p>
<blockquote><p> 1. Create a new project by selecting &#8220;Windows-based Application&#8221;<br />
   2. Create a new UIView using IB and name it ImgView.<br />
   3. Create a new file in XCode by selecting File -> New File -> UIViewController sub class and name it &#8220;ImgViewController&#8221;.<br />
   4. In IB, select File&#8217;s owner object of the &#8220;ImgView&#8221; nib file and select Tools -> Identity Inspector. Under Class Identity select &#8220;ImgViewContoller&#8221; as the class.<br />
   5. Select Tools &#8211; > Connections Inspector and create a connection from the view property to the view object in IB.<br />
   6. Place a UIImageView on the view we just created.<br />
   7. Add a image to the resource folder, to be used by the UIImageView.<br />
   8. Select the Image and select Tools -> Attributes Inspector in IB. From the Image drop down select your image.<br />
   9. Set the Mode to Center.<br />
  10. Un-check &#8220;User Interaction Enabled&#8221; and &#8220;Multiple Touch&#8221;.<br />
  11. Select the view and select &#8220;Multiple Touch&#8221; in the Attributes Inspector. Note that &#8220;User Interaction Enabled&#8221; should already be checked, if not check it.
</p></blockquote>
<p><strong>Using the last two settings all the touches events will be sent to ImgViewController. Since we need to control the image, we need a variable of type UIImageView. This is how the header file of &#8220;MultiTouchTutorialAppDelegate&#8221; will look like.<br />
</strong></p>

<div class="wp_syntax"><div class="code"><pre class="objc" style="font-family:monospace;"><span style="color: #6e371a;">#import &lt;UIKit/UIKit.h&gt;&gt;</span>
&nbsp;
<span style="color: #a61390;">@class</span> ImgViewController;
&nbsp;
<span style="color: #a61390;">@interface</span> MultiTouchTutorialAppDelegate <span style="color: #002200;">:</span> <span style="color: #400080;">NSObject</span> <span style="color: #002200;">&#123;</span>
UIWindow <span style="color: #002200;">*</span>window;
ImgViewController <span style="color: #002200;">*</span>ivController;
<span style="color: #002200;">&#125;</span>
&nbsp;
<span style="color: #a61390;">@property</span> <span style="color: #002200;">&#40;</span>nonatomic, retain<span style="color: #002200;">&#41;</span> IBOutlet UIWindow <span style="color: #002200;">*</span>window;
&nbsp;
<span style="color: #a61390;">@end</span></pre></div></div>

<p><strong>Using IB, select File&#8217;s owner object and open Tools -> Connections Inspector. Create a connection from the imgView to the UIImageView placed on the view. Now we will be able to control the UIImageView from code.<br />
<br />
Now we need to add the view &#8220;ImgView&#8221; as a subview in applicationDidFinishLaunching method. This is how the source code will look like<br />
</strong></p>
<p></p>

<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: #a61390;">void</span><span style="color: #002200;">&#41;</span>applicationDidFinishLaunching<span style="color: #002200;">:</span><span style="color: #002200;">&#40;</span>UIApplication <span style="color: #002200;">*</span><span style="color: #002200;">&#41;</span>application <span style="color: #002200;">&#123;</span>
&nbsp;
ivController <span style="color: #002200;">=</span> <span style="color: #002200;">&#91;</span><span style="color: #002200;">&#91;</span>ImgViewController alloc<span style="color: #002200;">&#93;</span> initWithNibName<span style="color: #002200;">:</span><span style="color: #bf1d1a;">@</span><span style="color: #bf1d1a;">&quot;ImgView&quot;</span> bundle<span style="color: #002200;">:</span><span style="color: #002200;">&#91;</span><span style="color: #400080;">NSBundle</span> mainBundle<span style="color: #002200;">&#93;</span><span style="color: #002200;">&#93;</span>;
&nbsp;
<span style="color: #002200;">&#91;</span>window addSubview<span style="color: #002200;">:</span><span style="color: #002200;">&#91;</span>ivController view<span style="color: #002200;">&#93;</span><span style="color: #002200;">&#93;</span>;
&nbsp;
<span style="color: #11740a; font-style: italic;">// Override point for customization after application launch</span>
<span style="color: #002200;">&#91;</span>window makeKeyAndVisible<span style="color: #002200;">&#93;</span>;
<span style="color: #002200;">&#125;</span></pre></div></div>

<p><strong>Click on Ctrl+return to run the application in simulator. You should see the image loaded in the simulator.<br />
<br />
Right now the application does not respond to any events, but all we have to do is implement some methods. Let&#8217;s implement the touchesEnded method which will be called when touches are ended.<br />
</strong><br />
</p>

<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: #a61390;">void</span><span style="color: #002200;">&#41;</span>touchesEnded<span style="color: #002200;">:</span><span style="color: #002200;">&#40;</span><span style="color: #400080;">NSSet</span> <span style="color: #002200;">*</span><span style="color: #002200;">&#41;</span>touches withEvent<span style="color: #002200;">:</span><span style="color: #002200;">&#40;</span>UIEvent <span style="color: #002200;">*</span><span style="color: #002200;">&#41;</span>event <span style="color: #002200;">&#123;</span>
<span style="color: #002200;">&#125;</span></pre></div></div>

<p><strong>In this method we will respond to a single tap and double tap. On single tap we will zoom out the image and on double tap we will set the mode to &#8220;Center&#8221;, which is doing the same as in step 9.<br />
This is how the code looks like<br />
</strong><br />
</p>

<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: #a61390;">void</span><span style="color: #002200;">&#41;</span>touchesEnded<span style="color: #002200;">:</span><span style="color: #002200;">&#40;</span><span style="color: #400080;">NSSet</span> <span style="color: #002200;">*</span><span style="color: #002200;">&#41;</span>touches withEvent<span style="color: #002200;">:</span><span style="color: #002200;">&#40;</span>UIEvent <span style="color: #002200;">*</span><span style="color: #002200;">&#41;</span>event <span style="color: #002200;">&#123;</span>
&nbsp;
<span style="color: #11740a; font-style: italic;">//Get all the touches.</span>
<span style="color: #400080;">NSSet</span> <span style="color: #002200;">*</span>allTouches <span style="color: #002200;">=</span> <span style="color: #002200;">&#91;</span>event allTouches<span style="color: #002200;">&#93;</span>;
&nbsp;
<span style="color: #11740a; font-style: italic;">//Number of touches on the screen</span>
<span style="color: #a61390;">switch</span> <span style="color: #002200;">&#40;</span><span style="color: #002200;">&#91;</span>allTouches count<span style="color: #002200;">&#93;</span><span style="color: #002200;">&#41;</span>
<span style="color: #002200;">&#123;</span>
<span style="color: #a61390;">case</span> <span style="color: #2400d9;">1</span><span style="color: #002200;">:</span>
<span style="color: #002200;">&#123;</span>
<span style="color: #11740a; font-style: italic;">//Get the first touch.</span>
UITouch <span style="color: #002200;">*</span>touch <span style="color: #002200;">=</span> <span style="color: #002200;">&#91;</span><span style="color: #002200;">&#91;</span>allTouches allObjects<span style="color: #002200;">&#93;</span> objectAtIndex<span style="color: #002200;">:</span><span style="color: #2400d9;">0</span><span style="color: #002200;">&#93;</span>;
&nbsp;
<span style="color: #a61390;">switch</span><span style="color: #002200;">&#40;</span><span style="color: #002200;">&#91;</span>touch tapCount<span style="color: #002200;">&#93;</span><span style="color: #002200;">&#41;</span>
<span style="color: #002200;">&#123;</span>
<span style="color: #a61390;">case</span> <span style="color: #2400d9;">1</span><span style="color: #002200;">:</span><span style="color: #11740a; font-style: italic;">//Single tap</span>
imgView.contentMode <span style="color: #002200;">=</span> UIViewContentModeScaleAspectFit;
<span style="color: #a61390;">break</span>;
<span style="color: #a61390;">case</span> <span style="color: #2400d9;">2</span><span style="color: #002200;">:</span><span style="color: #11740a; font-style: italic;">//Double tap.</span>
imgView.contentMode <span style="color: #002200;">=</span> UIViewContentModeCenter;
<span style="color: #a61390;">break</span>;
<span style="color: #002200;">&#125;</span>
<span style="color: #002200;">&#125;</span>
<span style="color: #a61390;">break</span>;
<span style="color: #002200;">&#125;</span>
&nbsp;
<span style="color: #002200;">&#125;</span></pre></div></div>

<p>We get all the touches from the event into allTouches variable. We thenfind out how many fingers were touching the screen, since in our case we only want to zoom in and out, it seems normal to assume that the user will only be using one finger. We then find out how many tocuhs are touching the screen by calling the count method of allTouches variable. </p>
<p>If there is only one finger touching the screen, we get the Touch object at index zero and find out the tap count of that object. If the tap count is one we will zoom out the image and if it is two we are going to zoom in. We zoom out the image by setting the contentMode to UIViewContentModeScaleAspectFit and zoom in the image by setting it to UIViewContentModeCenter.</p>
<p><script type="text/javascript"><!--
google_ad_client = "pub-8937083430127082";
google_ad_slot = "8143431074";
google_ad_width = 300;
google_ad_height = 250;
//--></script>
<script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js"></script>
</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.timeister.com/2009/09/02/objective-c-zoom-image/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Objective C: Cache Image on iPhone</title>
		<link>http://blog.timeister.com/2009/09/02/objective-c-cache-image/</link>
		<comments>http://blog.timeister.com/2009/09/02/objective-c-cache-image/#comments</comments>
		<pubDate>Wed, 02 Sep 2009 20:09:22 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[iPhone SDK]]></category>
		<category><![CDATA[cache]]></category>
		<category><![CDATA[image]]></category>
		<category><![CDATA[iphone]]></category>
		<category><![CDATA[objective c]]></category>

		<guid isPermaLink="false">http://blog.timeister.com/?p=458</guid>
		<description><![CDATA[

    If you&#8217;re pulling in web data such as images that doesn&#8217;t change but needs to be viewed multiple times, you&#8217;ll want to cache it. Caching images dramatically improves the performance of scrolling tables and other views.
    Note: this only works for JPG and PNG images. If you have [...]]]></description>
			<content:encoded><![CDATA[<p><script type="text/javascript"><!--
google_ad_client = "pub-8937083430127082";
google_ad_slot = "8143431074";
google_ad_width = 300;
google_ad_height = 250;
//--></script>
<script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js"></script>
</p>
<p>    If you&#8217;re pulling in web data such as images that doesn&#8217;t change but needs to be viewed multiple times, you&#8217;ll want to cache it. Caching images dramatically improves the performance of scrolling tables and other views.</p>
<p>    Note: this only works for JPG and PNG images. If you have suggestions or find bugs, let me know.</p>
<p>    Utilities.h:<br />
    Code:</p>

<div class="wp_syntax"><div class="code"><pre class="objc" style="font-family:monospace;">    <span style="color: #6e371a;">#import Foundation/Foundation.h</span>
&nbsp;
    <span style="color: #a61390;">@interface</span> Utilities <span style="color: #002200;">:</span> <span style="color: #400080;">NSObject</span> <span style="color: #002200;">&#123;</span>
&nbsp;
    <span style="color: #002200;">&#125;</span>
&nbsp;
    <span style="color: #11740a; font-style: italic;">// Methods</span>
    <span style="color: #002200;">-</span> <span style="color: #002200;">&#40;</span><span style="color: #a61390;">void</span><span style="color: #002200;">&#41;</span> cacheImage<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> ImageURLString;
    <span style="color: #002200;">-</span> <span style="color: #002200;">&#40;</span>UIImage <span style="color: #002200;">*</span><span style="color: #002200;">&#41;</span> getCachedImage<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> ImageURLString;
    <span style="color: #002200;">-</span> <span style="color: #002200;">&#40;</span>UIImage <span style="color: #002200;">*</span><span style="color: #002200;">&#41;</span> roundCorners<span style="color: #002200;">:</span> <span style="color: #002200;">&#40;</span>UIImage<span style="color: #002200;">*</span><span style="color: #002200;">&#41;</span> img;
&nbsp;
    <span style="color: #a61390;">@end</span></pre></div></div>

<p>    Utilities.m<br />
    Code:</p>

<div class="wp_syntax"><div class="code"><pre class="objc" style="font-family:monospace;">    <span style="color: #6e371a;">#import &quot;Utilities.h&quot;</span>
    <span style="color: #6e371a;">#define TMP NSTemporaryDirectory()</span>
&nbsp;
    <span style="color: #a61390;">@implementation</span> Utilities</pre></div></div>

<p>    Function to actually cache the image &#8211; checks to see if one with the same name already exists<br />
    Code:</p>

<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: #a61390;">void</span><span style="color: #002200;">&#41;</span> cacheImage<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> ImageURLString
    <span style="color: #002200;">&#123;</span>
    <span style="color: #400080;">NSURL</span> <span style="color: #002200;">*</span>ImageURL <span style="color: #002200;">=</span> <span style="color: #002200;">&#91;</span><span style="color: #400080;">NSURL</span> URLWithString<span style="color: #002200;">:</span> ImageURLString<span style="color: #002200;">&#93;</span>;
&nbsp;
    <span style="color: #11740a; font-style: italic;">// Generate a unique path to a resource representing the image you want</span>
    <span style="color: #400080;">NSString</span> <span style="color: #002200;">*</span>filename <span style="color: #002200;">=</span> <span style="color: #002200;">&#91;</span><span style="color: #002200;">&#91;</span>something unique, perhaps the image name<span style="color: #002200;">&#93;</span><span style="color: #002200;">&#93;</span>;
    <span style="color: #400080;">NSString</span> <span style="color: #002200;">*</span>uniquePath <span style="color: #002200;">=</span> <span style="color: #002200;">&#91;</span>TMP stringByAppendingPathComponent<span style="color: #002200;">:</span> filename<span style="color: #002200;">&#93;</span>;
&nbsp;
    <span style="color: #11740a; font-style: italic;">// Check for file existence</span>
    <span style="color: #a61390;">if</span><span style="color: #002200;">&#40;</span><span style="color: #002200;">!</span><span style="color: #002200;">&#91;</span><span style="color: #002200;">&#91;</span><span style="color: #400080;">NSFileManager</span> defaultManager<span style="color: #002200;">&#93;</span> fileExistsAtPath<span style="color: #002200;">:</span> uniquePath<span style="color: #002200;">&#93;</span><span style="color: #002200;">&#41;</span>
    <span style="color: #002200;">&#123;</span>
    <span style="color: #11740a; font-style: italic;">// The file doesn't exist, we should get a copy of it</span>
&nbsp;
    <span style="color: #11740a; font-style: italic;">// Fetch image</span>
    <span style="color: #400080;">NSData</span> <span style="color: #002200;">*</span>data <span style="color: #002200;">=</span> <span style="color: #002200;">&#91;</span><span style="color: #002200;">&#91;</span><span style="color: #400080;">NSData</span> alloc<span style="color: #002200;">&#93;</span> initWithContentsOfURL<span style="color: #002200;">:</span> ImageURL<span style="color: #002200;">&#93;</span>;
    UIImage <span style="color: #002200;">*</span>image <span style="color: #002200;">=</span> <span style="color: #002200;">&#91;</span><span style="color: #002200;">&#91;</span>UIImage alloc<span style="color: #002200;">&#93;</span> initWithData<span style="color: #002200;">:</span> data<span style="color: #002200;">&#93;</span>;
&nbsp;
    <span style="color: #11740a; font-style: italic;">// Do we want to round the corners?</span>
    image <span style="color: #002200;">=</span> <span style="color: #002200;">&#91;</span>self roundCorners<span style="color: #002200;">:</span> image<span style="color: #002200;">&#93;</span>;
&nbsp;
    <span style="color: #11740a; font-style: italic;">// Is it PNG or JPG/JPEG?</span>
    <span style="color: #11740a; font-style: italic;">// Running the image representation function writes the data from the image to a file</span>
    <span style="color: #a61390;">if</span><span style="color: #002200;">&#40;</span><span style="color: #002200;">&#91;</span>ImageURLString rangeOfString<span style="color: #002200;">:</span> <span style="color: #bf1d1a;">@</span><span style="color: #bf1d1a;">&quot;.png&quot;</span> options<span style="color: #002200;">:</span> NSCaseInsensitiveSearch<span style="color: #002200;">&#93;</span>.location <span style="color: #002200;">!=</span> NSNotFound<span style="color: #002200;">&#41;</span>
    <span style="color: #002200;">&#123;</span>
    <span style="color: #002200;">&#91;</span>UIImagePNGRepresentation<span style="color: #002200;">&#40;</span>image<span style="color: #002200;">&#41;</span> writeToFile<span style="color: #002200;">:</span> uniquePath atomically<span style="color: #002200;">:</span> <span style="color: #a61390;">YES</span><span style="color: #002200;">&#93;</span>;
    <span style="color: #002200;">&#125;</span>
    <span style="color: #a61390;">else</span> <span style="color: #a61390;">if</span><span style="color: #002200;">&#40;</span>
    <span style="color: #002200;">&#91;</span>ImageURLString rangeOfString<span style="color: #002200;">:</span> <span style="color: #bf1d1a;">@</span><span style="color: #bf1d1a;">&quot;.jpg&quot;</span> options<span style="color: #002200;">:</span> NSCaseInsensitiveSearch<span style="color: #002200;">&#93;</span>.location <span style="color: #002200;">!=</span> NSNotFound ||
    <span style="color: #002200;">&#91;</span>ImageURLString rangeOfString<span style="color: #002200;">:</span> <span style="color: #bf1d1a;">@</span><span style="color: #bf1d1a;">&quot;.jpeg&quot;</span> options<span style="color: #002200;">:</span> NSCaseInsensitiveSearch<span style="color: #002200;">&#93;</span>.location <span style="color: #002200;">!=</span> NSNotFound
    <span style="color: #002200;">&#41;</span>
    <span style="color: #002200;">&#123;</span>
    <span style="color: #002200;">&#91;</span>UIImageJPEGRepresentation<span style="color: #002200;">&#40;</span>image, <span style="color: #2400d9;">100</span><span style="color: #002200;">&#41;</span> writeToFile<span style="color: #002200;">:</span> uniquePath atomically<span style="color: #002200;">:</span> <span style="color: #a61390;">YES</span><span style="color: #002200;">&#93;</span>;
    <span style="color: #002200;">&#125;</span>
    <span style="color: #002200;">&#125;</span>
    <span style="color: #002200;">&#125;</span></pre></div></div>

<p>    Retrieve a cached file:<br />
    Code:</p>

<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>UIImage <span style="color: #002200;">*</span><span style="color: #002200;">&#41;</span> getCachedImage<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> ImageURLString
    <span style="color: #002200;">&#123;</span>
    <span style="color: #400080;">NSString</span> <span style="color: #002200;">*</span>filename <span style="color: #002200;">=</span> <span style="color: #002200;">&#91;</span><span style="color: #002200;">&#91;</span>something unique, perhaps the image name<span style="color: #002200;">&#93;</span><span style="color: #002200;">&#93;</span>;
    <span style="color: #400080;">NSString</span> <span style="color: #002200;">*</span>uniquePath <span style="color: #002200;">=</span> <span style="color: #002200;">&#91;</span>TMP stringByAppendingPathComponent<span style="color: #002200;">:</span> filename<span style="color: #002200;">&#93;</span>;
&nbsp;
    UIImage <span style="color: #002200;">*</span>image;
&nbsp;
    <span style="color: #11740a; font-style: italic;">// Check for a cached version</span>
    <span style="color: #a61390;">if</span><span style="color: #002200;">&#40;</span><span style="color: #002200;">&#91;</span><span style="color: #002200;">&#91;</span><span style="color: #400080;">NSFileManager</span> defaultManager<span style="color: #002200;">&#93;</span> fileExistsAtPath<span style="color: #002200;">:</span> uniquePath<span style="color: #002200;">&#93;</span><span style="color: #002200;">&#41;</span>
    <span style="color: #002200;">&#123;</span>
    image <span style="color: #002200;">=</span> <span style="color: #002200;">&#91;</span>UIImage imageWithContentsOfFile<span style="color: #002200;">:</span> uniquePath<span style="color: #002200;">&#93;</span>; <span style="color: #11740a; font-style: italic;">// this is the cached image</span>
    <span style="color: #002200;">&#125;</span>
    <span style="color: #a61390;">else</span>
    <span style="color: #002200;">&#123;</span>
    <span style="color: #11740a; font-style: italic;">// get a new one</span>
    <span style="color: #002200;">&#91;</span>self cacheImage<span style="color: #002200;">:</span> ImageURLString<span style="color: #002200;">&#93;</span>;
    image <span style="color: #002200;">=</span> <span style="color: #002200;">&#91;</span>UIImage imageWithContentsOfFile<span style="color: #002200;">:</span> uniquePath<span style="color: #002200;">&#93;</span>;
    <span style="color: #002200;">&#125;</span>
&nbsp;
    <span style="color: #a61390;">return</span> image;
    <span style="color: #002200;">&#125;</span></pre></div></div>

<p>    These two functions are just to add rounded corners to an image<br />
    Code:</p>

<div class="wp_syntax"><div class="code"><pre class="objc" style="font-family:monospace;"> <span style="color: #a61390;">static</span> <span style="color: #a61390;">void</span> addRoundedRectToPath<span style="color: #002200;">&#40;</span>CGContextRef context, CGRect rect, <span style="color: #a61390;">float</span> ovalWidth, <span style="color: #a61390;">float</span> ovalHeight<span style="color: #002200;">&#41;</span>
    <span style="color: #002200;">&#123;</span>
    <span style="color: #a61390;">float</span> fw, fh;
    <span style="color: #a61390;">if</span> <span style="color: #002200;">&#40;</span>ovalWidth <span style="color: #002200;">==</span> <span style="color: #2400d9;">0</span> || ovalHeight <span style="color: #002200;">==</span> <span style="color: #2400d9;">0</span><span style="color: #002200;">&#41;</span>
    <span style="color: #002200;">&#123;</span>
    CGContextAddRect<span style="color: #002200;">&#40;</span>context, rect<span style="color: #002200;">&#41;</span>;
    <span style="color: #a61390;">return</span>;
    <span style="color: #002200;">&#125;</span>
    CGContextSaveGState<span style="color: #002200;">&#40;</span>context<span style="color: #002200;">&#41;</span>;
    CGContextTranslateCTM <span style="color: #002200;">&#40;</span>context, CGRectGetMinX<span style="color: #002200;">&#40;</span>rect<span style="color: #002200;">&#41;</span>, CGRectGetMinY<span style="color: #002200;">&#40;</span>rect<span style="color: #002200;">&#41;</span><span style="color: #002200;">&#41;</span>;
    CGContextScaleCTM <span style="color: #002200;">&#40;</span>context, ovalWidth, ovalHeight<span style="color: #002200;">&#41;</span>;
    fw <span style="color: #002200;">=</span> CGRectGetWidth <span style="color: #002200;">&#40;</span>rect<span style="color: #002200;">&#41;</span> <span style="color: #002200;">/</span> ovalWidth;
    fh <span style="color: #002200;">=</span> CGRectGetHeight <span style="color: #002200;">&#40;</span>rect<span style="color: #002200;">&#41;</span> <span style="color: #002200;">/</span> ovalHeight;
    CGContextMoveToPoint<span style="color: #002200;">&#40;</span>context, fw, fh<span style="color: #002200;">/</span><span style="color: #2400d9;">2</span><span style="color: #002200;">&#41;</span>;
    CGContextAddArcToPoint<span style="color: #002200;">&#40;</span>context, fw, fh, fw<span style="color: #002200;">/</span><span style="color: #2400d9;">2</span>, fh, <span style="color: #2400d9;">1</span><span style="color: #002200;">&#41;</span>;
    CGContextAddArcToPoint<span style="color: #002200;">&#40;</span>context, <span style="color: #2400d9;">0</span>, fh, <span style="color: #2400d9;">0</span>, fh<span style="color: #002200;">/</span><span style="color: #2400d9;">2</span>, <span style="color: #2400d9;">1</span><span style="color: #002200;">&#41;</span>;
    CGContextAddArcToPoint<span style="color: #002200;">&#40;</span>context, <span style="color: #2400d9;">0</span>, <span style="color: #2400d9;">0</span>, fw<span style="color: #002200;">/</span><span style="color: #2400d9;">2</span>, <span style="color: #2400d9;">0</span>, <span style="color: #2400d9;">1</span><span style="color: #002200;">&#41;</span>;
    CGContextAddArcToPoint<span style="color: #002200;">&#40;</span>context, fw, <span style="color: #2400d9;">0</span>, fw, fh<span style="color: #002200;">/</span><span style="color: #2400d9;">2</span>, <span style="color: #2400d9;">1</span><span style="color: #002200;">&#41;</span>;
    CGContextClosePath<span style="color: #002200;">&#40;</span>context<span style="color: #002200;">&#41;</span>;
    CGContextRestoreGState<span style="color: #002200;">&#40;</span>context<span style="color: #002200;">&#41;</span>;
    <span style="color: #002200;">&#125;</span>
&nbsp;
    <span style="color: #002200;">-</span> <span style="color: #002200;">&#40;</span>UIImage <span style="color: #002200;">*</span><span style="color: #002200;">&#41;</span> roundCorners<span style="color: #002200;">:</span> <span style="color: #002200;">&#40;</span>UIImage<span style="color: #002200;">*</span><span style="color: #002200;">&#41;</span> img
    <span style="color: #002200;">&#123;</span>
    <span style="color: #a61390;">int</span> w <span style="color: #002200;">=</span> img.size.width;
    <span style="color: #a61390;">int</span> h <span style="color: #002200;">=</span> img.size.height;
&nbsp;
    CGColorSpaceRef colorSpace <span style="color: #002200;">=</span> CGColorSpaceCreateDeviceRGB<span style="color: #002200;">&#40;</span><span style="color: #002200;">&#41;</span>;
    CGContextRef context <span style="color: #002200;">=</span> CGBitmapContextCreate<span style="color: #002200;">&#40;</span><span style="color: #a61390;">NULL</span>, w, h, <span style="color: #2400d9;">8</span>, <span style="color: #2400d9;">4</span> <span style="color: #002200;">*</span> w, colorSpace, kCGImageAlphaPremultipliedFirst<span style="color: #002200;">&#41;</span>;
&nbsp;
    CGContextBeginPath<span style="color: #002200;">&#40;</span>context<span style="color: #002200;">&#41;</span>;
    CGRect rect <span style="color: #002200;">=</span> CGRectMake<span style="color: #002200;">&#40;</span><span style="color: #2400d9;">0</span>, <span style="color: #2400d9;">0</span>, img.size.width, img.size.height<span style="color: #002200;">&#41;</span>;
    addRoundedRectToPath<span style="color: #002200;">&#40;</span>context, rect, <span style="color: #2400d9;">5</span>, <span style="color: #2400d9;">5</span><span style="color: #002200;">&#41;</span>;
    CGContextClosePath<span style="color: #002200;">&#40;</span>context<span style="color: #002200;">&#41;</span>;
    CGContextClip<span style="color: #002200;">&#40;</span>context<span style="color: #002200;">&#41;</span>;
&nbsp;
    CGContextDrawImage<span style="color: #002200;">&#40;</span>context, CGRectMake<span style="color: #002200;">&#40;</span><span style="color: #2400d9;">0</span>, <span style="color: #2400d9;">0</span>, w, h<span style="color: #002200;">&#41;</span>, img.CGImage<span style="color: #002200;">&#41;</span>;
&nbsp;
    CGImageRef imageMasked <span style="color: #002200;">=</span> CGBitmapContextCreateImage<span style="color: #002200;">&#40;</span>context<span style="color: #002200;">&#41;</span>;
    CGContextRelease<span style="color: #002200;">&#40;</span>context<span style="color: #002200;">&#41;</span>;
    CGColorSpaceRelease<span style="color: #002200;">&#40;</span>colorSpace<span style="color: #002200;">&#41;</span>;
    <span style="color: #002200;">&#91;</span>img release<span style="color: #002200;">&#93;</span>;
&nbsp;
    <span style="color: #a61390;">return</span> <span style="color: #002200;">&#91;</span>UIImage imageWithCGImage<span style="color: #002200;">:</span>imageMasked<span style="color: #002200;">&#93;</span>;
    <span style="color: #002200;">&#125;</span>
&nbsp;
    <span style="color: #a61390;">@end</span></pre></div></div>

<p><script type="text/javascript"><!--
google_ad_client = "pub-8937083430127082";
google_ad_slot = "8143431074";
google_ad_width = 300;
google_ad_height = 250;
//--></script>
<script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js"></script>
</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.timeister.com/2009/09/02/objective-c-cache-image/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Objective C &#8211; HTTP POSTor GET Data</title>
		<link>http://blog.timeister.com/2009/08/14/objective-c-http-post-get-data/</link>
		<comments>http://blog.timeister.com/2009/08/14/objective-c-http-post-get-data/#comments</comments>
		<pubDate>Fri, 14 Aug 2009 08:19:18 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[iPhone SDK]]></category>
		<category><![CDATA[http get]]></category>
		<category><![CDATA[http post]]></category>
		<category><![CDATA[iphone]]></category>
		<category><![CDATA[sdk]]></category>

		<guid isPermaLink="false">http://blog.timeister.com/2009/08/14/objective-c-http-postor-get-data/</guid>
		<description><![CDATA[ASIHTTPRequest is an easy to use wrapper around the CFNetwork API that makes some of the more tedious aspects of communicating with web servers easier. It is written in Objective-C and works in both Mac OS X and iPhone applications.
It is suitable performing basic HTTP requests and interacting with REST-based services (GET / POST / [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://blog.timeister.com/wp-content/uploads/iphone-programming.png"><img class="alignright" title="iPhone sdk programming" src="http://blog.timeister.com/wp-content/uploads/iphone-programming.png" alt="" width="221" height="245" /></a>ASIHTTPRequest is an easy to use wrapper around the CFNetwork API that makes some of the more tedious aspects of communicating with web servers easier. It is written in Objective-C and works in both Mac OS X and iPhone applications.</p>
<p>It is suitable performing basic HTTP requests and interacting with REST-based services (GET / POST / PUT / DELETE). The included ASIFormDataRequest subclass makes it easy to submit POST data and files using <a href="http://en.wikipedia.org/wiki/MIME#Form_Data">multipart/form-data</a>.</p>
<p>Here is an sample code on how easy is to make a http-post from objective c.</p>
<p>(<code>Source: </code><a title="http://allseeing-i.com/ASIHTTPRequest/How-to-use" onclick="javascript:pageTracker._trackPageview('/outbound/article/http://allseeing-i.com/ASIHTTPRequest/How-to-use');" href="http://allseeing-i.com/ASIHTTPRequest/How-to-use">http://allseeing-i.com/ASIHTTPRequest/How-to-use</a>)</p>
<blockquote><p><a href="http://github.com/pokeb/asi-http-request/tree/master/Classes/ASIFormDataRequest.h"><span style="color: #3f7588;">ASIFormDataRequest</span></a> <span style="color: #002200;">*</span>request <span style="color: #002200;">=</span> <span style="color: #002200;">[</span><span style="color: #002200;">[</span><span style="color: #002200;">[</span><a href="http://github.com/pokeb/asi-http-request/tree/master/Classes/ASIFormDataRequest.h"><span style="color: #3f7588;">ASIFormDataRequest</span></a> alloc<span style="color: #002200;">]</span> initWithURL<span style="color: #002200;">:</span>url<span style="color: #002200;">]</span> autorelease<span style="color: #002200;">]</span>;</p>
<p><span style="color: #002200;">[</span>request setPostValue<span style="color: #002200;">:</span><span style="color: #bf1d1a;">@</span><span style="color: #bf1d1a;">"Ben"</span> forKey<span style="color: #002200;">:</span><span style="color: #bf1d1a;">@</span><span style="color: #bf1d1a;">"first_name"</span><span style="color: #002200;">]</span>;</p>
<p><span style="color: #002200;">[</span>request setPostValue<span style="color: #002200;">:</span><span style="color: #bf1d1a;">@</span><span style="color: #bf1d1a;">"Copsey"</span> forKey<span style="color: #002200;">:</span><span style="color: #bf1d1a;">@</span><span style="color: #bf1d1a;">"last_name"</span><span style="color: #002200;">]</span>;</p>
<p><span style="color: #002200;">[</span>request setFile<span style="color: #002200;">:</span><span style="color: #bf1d1a;">@</span><span style="color: #bf1d1a;">"/Users/ben/Desktop/ben.jpg"</span> forKey<span style="color: #002200;">:</span><span style="color: #bf1d1a;">@</span><span style="color: #bf1d1a;">"photo"</span><span style="color: #002200;">]</span>;</p></blockquote>
<p><strong>How to install and use ASIHTTPRequest in an iPhone project ?</strong></p>
<p><strong>1) Add the files</strong></p>
<p>Copy the files you need to your project folder, and add them to your Xcode project. An overview of the ASIHTTPRequest source files appears <a href="http://allseeing-i.com/ASIHTTPRequest">here</a>.</p>
<p><strong>2) Link against CFNetwork, SystemConfiguration and zlib</strong></p>
<p>Choose Project -&gt; Edit Active Target from the menu.</p>
<p>Click the plus button in the bottom left of the window.</p>
<p>Choose &#8220;CFNetwork.framework&#8221; from the list, and click Add.</p>
<p>Repeat the same operation for &#8220;SystemConfiguration.framework&#8221; and &#8220;libz.1.2.3.dylib&#8221;</p>
<p><script type="text/javascript"><!--
google_ad_client = "pub-8937083430127082";
google_ad_slot = "8143431074";
google_ad_width = 300;
google_ad_height = 250;
//--></script>
<script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js"></script>
</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.timeister.com/2009/08/14/objective-c-http-post-get-data/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Objective C: Read iPhone Preferences From Application</title>
		<link>http://blog.timeister.com/2009/07/19/read-iphone-preferences/</link>
		<comments>http://blog.timeister.com/2009/07/19/read-iphone-preferences/#comments</comments>
		<pubDate>Sun, 19 Jul 2009 10:19:26 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[iPhone SDK]]></category>
		<category><![CDATA[iphone]]></category>
		<category><![CDATA[objective c]]></category>
		<category><![CDATA[read preferences]]></category>

		<guid isPermaLink="false">http://blog.timeister.com/?p=420</guid>
		<description><![CDATA[You can read preferences from your iPhone Application using the NSUserDefaults class from iPhone SDK.
Here is how you can read the delay value before the phone is starting to dial a number

NSUserDefaults *userDefaults = &#91;NSUserDefaults standardUserDefaults&#93;;
delayBeforeDialing = &#91;userDefaults floatForKey:@&#34;delayBeforeDialing&#34;&#93;;

The key, “delayBeforeDialing” in this example, needs to match the Key value in Root.plist.
There are different accessor [...]]]></description>
			<content:encoded><![CDATA[<p><strong>You can read preferences from your iPhone Application using the NSUserDefaults class from iPhone SDK.</strong></p>
<p>Here is how you can read the delay value before the phone is starting to dial a number</p>

<div class="wp_syntax"><div class="code"><pre class="c" style="font-family:monospace;">NSUserDefaults <span style="color: #339933;">*</span>userDefaults <span style="color: #339933;">=</span> <span style="color: #009900;">&#91;</span>NSUserDefaults standardUserDefaults<span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span>
delayBeforeDialing <span style="color: #339933;">=</span> <span style="color: #009900;">&#91;</span>userDefaults floatForKey<span style="color: #339933;">:</span>@<span style="color: #ff0000;">&quot;delayBeforeDialing&quot;</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span></pre></div></div>

<p>The key, “delayBeforeDialing” in this example, needs to match the Key value in Root.plist.</p>
<p><strong>There are different accessor methods depending on the type of variable you want to retrieve.</strong></p>
<p style="padding-left: 30px;"><span style="color: #0000ff;">* arrayForKey<br />
* boolForKey<br />
* dataForKey<br />
* dictionaryForKey<br />
* floatForKey<br />
* integerForKey<br />
* objectForKey<br />
* stringArrayForKey<br />
* stringForKey</span></p>
<p>You don’t have to use a UI for your preferences. If you just want to conveniently store values associated with your application, that you can read back later, you can use the setter methods of NSUserDefaults.</p>
<p><script type="text/javascript"><!--
google_ad_client = "pub-8937083430127082";
google_ad_slot = "8143431074";
google_ad_width = 300;
google_ad_height = 250;
//--></script>
<script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js"></script>
</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.timeister.com/2009/07/19/read-iphone-preferences/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Objective C: Show online image on iPhone</title>
		<link>http://blog.timeister.com/2009/07/18/objective-c-online-image-iphone/</link>
		<comments>http://blog.timeister.com/2009/07/18/objective-c-online-image-iphone/#comments</comments>
		<pubDate>Sat, 18 Jul 2009 14:28:51 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[iPhone SDK]]></category>
		<category><![CDATA[load image]]></category>
		<category><![CDATA[objective c]]></category>

		<guid isPermaLink="false">http://blog.timeister.com/?p=399</guid>
		<description><![CDATA[By default the UIImageView control from the iPhone sdk does not allow us to load images from a specific url. In this case we do a little tryck and use a UIWebView.




- &#40;void&#41;loadImage:&#40;NSString*&#41;url frame:&#40;CGRect&#41;frame &#123;
NSString* textHTML = @&#34;
&#60;!--
body {
background-color: transparent;
color: white;
}
--&#62;
&#60;img src=&#34;\&#34; alt=&#34;&#34; width=&#34;%0.0f&#34; height=&#34;%0.0f&#34; /&#62;
&#34;;
&#160;
NSString* html = &#91;NSString stringWithFormat:textHTML, url, frame.size.width, frame.size.height&#93;;
&#160;
if&#40;webView == nil&#41; [...]]]></description>
			<content:encoded><![CDATA[<p>By default the UIImageView control from the iPhone sdk does not allow us to load images from a specific url. In this case we do a little tryck and use a UIWebView.</p>
<p><script type="text/javascript"><!--
google_ad_client = "pub-8937083430127082";
google_ad_slot = "8143431074";
google_ad_width = 300;
google_ad_height = 250;
//--></script>
<script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js"></script>
</p>

<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: #a61390;">void</span><span style="color: #002200;">&#41;</span>loadImage<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>url frame<span style="color: #002200;">:</span><span style="color: #002200;">&#40;</span>CGRect<span style="color: #002200;">&#41;</span>frame <span style="color: #002200;">&#123;</span>
<span style="color: #400080;">NSString</span><span style="color: #002200;">*</span> textHTML <span style="color: #002200;">=</span> <span style="color: #bf1d1a;">@</span><span style="color: #bf1d1a;">&quot;
&lt;!--
body {
background-color: transparent;
color: white;
}
--&gt;
&lt;img src=&quot;</span>\<span style="color: #bf1d1a;">&quot; alt=&quot;</span><span style="color: #bf1d1a;">&quot; width=&quot;</span><span style="color: #002200;">%</span>0.0f<span style="color: #bf1d1a;">&quot; height=&quot;</span><span style="color: #002200;">%</span>0.0f<span style="color: #bf1d1a;">&quot; /&gt;
&quot;</span>;
&nbsp;
<span style="color: #400080;">NSString</span><span style="color: #002200;">*</span> html <span style="color: #002200;">=</span> <span style="color: #002200;">&#91;</span><span style="color: #400080;">NSString</span> stringWithFormat<span style="color: #002200;">:</span>textHTML, url, frame.size.width, frame.size.height<span style="color: #002200;">&#93;</span>;
&nbsp;
<span style="color: #a61390;">if</span><span style="color: #002200;">&#40;</span>webView <span style="color: #002200;">==</span> <span style="color: #a61390;">nil</span><span style="color: #002200;">&#41;</span> <span style="color: #002200;">&#123;</span>
webView <span style="color: #002200;">=</span> <span style="color: #002200;">&#91;</span><span style="color: #002200;">&#91;</span>UIWebView alloc<span style="color: #002200;">&#93;</span> initWithFrame<span style="color: #002200;">:</span>frame<span style="color: #002200;">&#93;</span>;
<span style="color: #002200;">&#91;</span>self.view addSubview<span style="color: #002200;">:</span>webView<span style="color: #002200;">&#93;</span>;
<span style="color: #002200;">&#125;</span>
&nbsp;
<span style="color: #002200;">&#91;</span>webView loadHTMLString<span style="color: #002200;">:</span>html baseURL<span style="color: #002200;">:</span><span style="color: #a61390;">nil</span><span style="color: #002200;">&#93;</span>;
<span style="color: #002200;">&#125;</span></pre></div></div>

<p><script type="text/javascript"><!--
google_ad_client = "pub-8937083430127082";
google_ad_slot = "8143431074";
google_ad_width = 300;
google_ad_height = 250;
//--></script>
<script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js"></script>
</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.timeister.com/2009/07/18/objective-c-online-image-iphone/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Objective C Get iPhone Device GUID</title>
		<link>http://blog.timeister.com/2009/06/25/objective-c-get-iphone-device-guid/</link>
		<comments>http://blog.timeister.com/2009/06/25/objective-c-get-iphone-device-guid/#comments</comments>
		<pubDate>Thu, 25 Jun 2009 13:37:59 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[iPhone SDK]]></category>
		<category><![CDATA[apple]]></category>
		<category><![CDATA[device id]]></category>
		<category><![CDATA[guid]]></category>
		<category><![CDATA[iphone]]></category>

		<guid isPermaLink="false">http://blog.timeister.com/?p=312</guid>
		<description><![CDATA[Following Xcode reveals you the device id

UIDevice *device = [UIDevice currentDevice];
NSString *uniqueIdentifier = [device uniqueIdentifier];
/*[device release];*/
NSLog(@&#8221;Device GUID: %@&#8221;, uniqueIdentifier);





]]></description>
			<content:encoded><![CDATA[<p>Following Xcode reveals you the device id</p>
<div style="background-color:#f0f0f0;">
UIDevice *device = [UIDevice currentDevice];<br />
NSString *uniqueIdentifier = [device uniqueIdentifier];<br />
/*[device release];*/<br />
NSLog(@&#8221;Device GUID: %@&#8221;, uniqueIdentifier);
</div>
<div style="padding-bottom:20px"></div>
<p><script type="text/javascript"><!--
google_ad_client = "pub-8937083430127082";
google_ad_slot = "8143431074";
google_ad_width = 300;
google_ad_height = 250;
//--></script>
<script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js"></script>
</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.timeister.com/2009/06/25/objective-c-get-iphone-device-guid/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Objective C Get iPhone number</title>
		<link>http://blog.timeister.com/2009/06/25/objective-c-get-iphone-number/</link>
		<comments>http://blog.timeister.com/2009/06/25/objective-c-get-iphone-number/#comments</comments>
		<pubDate>Thu, 25 Jun 2009 13:36:32 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[iPhone SDK]]></category>
		<category><![CDATA[apple]]></category>
		<category><![CDATA[iphone]]></category>
		<category><![CDATA[number]]></category>
		<category><![CDATA[xcode]]></category>

		<guid isPermaLink="false">http://blog.timeister.com/?p=309</guid>
		<description><![CDATA[

How to get the iphone number from sim using xcode or objective c?
NSString *num = [[NSUserDefaults standardUserDefaults] stringForKey:@&#8221;SBFormattedPhoneNumber&#8221;];
NSLog(@&#8221;Phone Number: %@&#8221;, num);




]]></description>
			<content:encoded><![CDATA[<p><script type="text/javascript"><!--
google_ad_client = "pub-8937083430127082";
google_ad_slot = "8143431074";
google_ad_width = 300;
google_ad_height = 250;
//--></script>
<script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js"></script>
</p>
<p>How to get the iphone number from sim using xcode or objective c?</p>
<div style="background-color:#f0f0f0">NSString *num = [[NSUserDefaults standardUserDefaults] stringForKey:@&#8221;SBFormattedPhoneNumber&#8221;];<br />
NSLog(@&#8221;Phone Number: %@&#8221;, num);</div>
<div style="padding-top:20px"></div>
<p><script type="text/javascript"><!--
google_ad_client = "pub-8937083430127082";
google_ad_slot = "8143431074";
google_ad_width = 300;
google_ad_height = 250;
//--></script>
<script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js"></script>
</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.timeister.com/2009/06/25/objective-c-get-iphone-number/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>
