<?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>DevedUp, iOS Development</title>
	<atom:link href="http://www.devedup.com/index.php" rel="self" type="application/rss+xml" />
	<link>http://www.devedup.com</link>
	<description>iOS Development by David Casserly</description>
	<lastBuildDate>Fri, 17 May 2013 20:58:05 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.4</generator>
		<item>
		<title>iOS: xcodebuild code sign errors</title>
		<link>http://www.devedup.com/index.php/2011/09/08/ios-xcodebuild-code-sign-errors/</link>
		<comments>http://www.devedup.com/index.php/2011/09/08/ios-xcodebuild-code-sign-errors/#comments</comments>
		<pubDate>Thu, 08 Sep 2011 11:58:18 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[bamboo]]></category>
		<category><![CDATA[iOS]]></category>
		<category><![CDATA[iPad]]></category>
		<category><![CDATA[iPhone]]></category>
		<category><![CDATA[xcodebuild]]></category>
		<category><![CDATA[CodeSign]]></category>
		<category><![CDATA[CSSM_ERRCODE_INTERNAL_ERROR]]></category>
		<category><![CDATA[ios]]></category>

		<guid isPermaLink="false">http://blog.devedup.com/?p=284</guid>
		<description><![CDATA[CodeSign error: Code Signing Identity &#8216;iPhone Distribution: XXXXX&#8217; does not match any code-signing certificate in your keychain. I&#8217;ve been getting this intermittent issue from our Bamboo build server, which builds our iOS project using xcodebuild. It seems to resolve itself after a restart of the mac, however.. a few builds later and it fails again. [...]]]></description>
			<content:encoded><![CDATA[<blockquote><p><span style="color: #ff0000;">CodeSign error: Code Signing Identity &#8216;iPhone Distribution: XXXXX&#8217; does not match any code-signing certificate in your keychain.</span></p></blockquote>
<p>I&#8217;ve been getting this intermittent issue from our Bamboo build server, which builds our iOS project using xcodebuild. It seems to resolve itself after a restart of the mac, however.. a few builds later and it fails again. We&#8217;re using XCode 4.1 on OS X Lion 10.7.1.</p>
<p>I inserted this into the build script</p>
<blockquote><p>security list-keychains</p></blockquote>
<p>..and I can see that Bamboo has access to the login and the System keychains</p>
<blockquote>
<table id="buildLog">
<tbody>
<tr>
<td>Listing the current keychains</td>
</tr>
<tr>
<td>08-Sep-2011 12:43:26</td>
<td>    &#8220;/Users/mac0004/Library/Keychains/login.keychain&#8221;</td>
</tr>
<tr>
<td>08-Sep-2011 12:43:26</td>
<td>    &#8220;/Library/Keychains/System.keychain&#8221;</td>
</tr>
</tbody>
</table>
</blockquote>
<p>&#8230;.however, after a few builds (and something else that I don&#8217;t know what happens), this command reports</p>
<blockquote>
<table id="buildLog">
<tbody>
<tr>
<td>Listing the current keychains</td>
</tr>
<tr>
<td>08-Sep-2011 13:23:16</td>
<td>    &#8220;/Library/Keychains/System.keychain&#8221;</td>
</tr>
<tr>
<td>08-Sep-2011 13:23:16</td>
<td>    &#8220;/Library/Keychains/System.keychain&#8221;</td>
</tr>
</tbody>
</table>
</blockquote>
<p>It&#8217;s strange how it reports the System.keychain twice, and that it can no longer find the login keychain.</p>
<p>Anyway, the solution for me was to copy/move my iOS certificates to the System.keychain.</p>
<p>I also had another error: &#8216;CSSM_ERRCODE_INTERNAL_ERROR&#8217;, which I resolved by installing the intermediate certificate from Apple again. You can get this from the provisioning portal, certificates section. Or from this link: <a title="Apple WWDRCA Intermediate Certificate" href="https://developer.apple.com/certificationauthority/AppleWWDRCA.cer">Apple WWDRCA Intermediate Certificate</a></p>
<p>If you have similar problems and this doesn&#8217;t resolve it, post a comment.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.devedup.com/index.php/2011/09/08/ios-xcodebuild-code-sign-errors/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>iPad App: Flickr Gallery</title>
		<link>http://www.devedup.com/index.php/2011/06/18/ipad-app-flickr-gallery/</link>
		<comments>http://www.devedup.com/index.php/2011/06/18/ipad-app-flickr-gallery/#comments</comments>
		<pubDate>Sat, 18 Jun 2011 17:30:44 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[App Store]]></category>
		<category><![CDATA[iPad]]></category>
		<category><![CDATA[iPhone]]></category>
		<category><![CDATA[app store]]></category>
		<category><![CDATA[apple]]></category>
		<category><![CDATA[flickr]]></category>
		<category><![CDATA[flickr gallery]]></category>
		<category><![CDATA[ipad]]></category>
		<category><![CDATA[ipad app]]></category>

		<guid isPermaLink="false">http://blog.devedup.com/?p=262</guid>
		<description><![CDATA[Flickr Gallery turns your iPad into a digital photo frame using photos from one of the biggest photo hosting sites on the net. Flickr hosts more than 5 billion images and you can access these from Flickr Gallery. NO FLICKR ACCOUNT NECESSARY You don&#8217;t need an account with Flickr, as Flickr Gallery will display todays [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://itunes.apple.com/gb/app/flickr-gallery/id446348840?mt=8"><img class="alignleft" src="http://blog.devedup.com/wp-content/uploads/2011/06/glossyITunesFlickrGallery.png" alt="" width="90" height="90" /></a></p>
<p><a href="http://itunes.apple.com/gb/app/flickr-gallery/id446348840?mt=8"><img class="size-medium wp-image-263 aligncenter" title="Flickr Gallery" src="http://blog.devedup.com/wp-content/uploads/2011/06/logo-300x96.png" alt="Flickr Gallery" width="300" height="96" /></a></p>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">Flickr Gallery turns your iPad into a digital photo frame using photos from one of the</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">biggest photo hosting sites on the net.</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">Flickr hosts more than 5 billion images and you can access these from Flickr Gallery.</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">NO FLICKR ACCOUNT NECESSARY</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">You don&#8217;t need an account with Flickr, as Flickr Gallery will display todays most interesting</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">photos. You can sign into your account and display photos from your own photostream or your</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">favourite photos.</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">GALLERY SETTINGS</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">* choose from a variety of photo transitions,</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">* the duration between photos,</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">* whether you want to see the photo title</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">* if you want to prevent the iPad from sleeping</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">* photos are high quality but you can choose medium quality to minimise data usage</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">PHOTO DETAILS</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">Touch the photo to bring up information about it and save it to your favourites or view it on</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">flickr&#8217;s website.</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">MORE&#8230;</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">Flickr Gallery has only just started development in June 2011. This is this intial release to</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">get it into your hands sooner. We are currently developing more features, such as a photo browser</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">and a flickr exploration browser. We also want to hear from the users &#8211; so let us know what you</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">want to see and we will strive to add it into an upcoming release.</div>
<p><strong><span class="Apple-style-span" style="font-family: 'Lucida Grande', Geneva, Verdana, Arial; font-size: 12px; line-height: normal; background-color: #ffffff;">Flickr Gallery turns your iPad into a Digital Photo Frame using photos from one of the biggest photo hosting sites on the web. Flickr hosts more than 5 billion images and you can access these easily from Flickr Gallery. You DONT need a flickr account &#8211; as it will default to interesting public photos. If you do have an account, you can login and display photos from your own photostream. </span></strong></p>
<p>&nbsp;</p>
<p><strong><span class="Apple-style-span" style="font-family: 'Lucida Grande', Geneva, Verdana, Arial; font-size: 12px; line-height: normal; background-color: #ffffff;">Visit our new dedicated site here: <a title="Flickr Gallery" href="http://flickrgallery.devedup.com">Flickr Gallery</a></span></strong></p>
<p>&nbsp;</p>
<p><a href="http://itunes.apple.com/gb/app/flickr-gallery/id446348840?mt=8"><img class="alignnone size-full wp-image-265" title="App_Store_Badge_EN_0609" src="http://blog.devedup.com/wp-content/uploads/2011/06/App_Store_Badge_EN_0609.png" alt="App_Store_Badge_EN_0609" width="240" height="83" /></a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.devedup.com/index.php/2011/06/18/ipad-app-flickr-gallery/feed/</wfw:commentRss>
		<slash:comments>11</slash:comments>
		</item>
		<item>
		<title>iPhone: UITextView with rounded edges (to look like a UITextField)</title>
		<link>http://www.devedup.com/index.php/2010/06/06/iphone-uitextview-with-rounded-edges-to-look-like-a-uitextfield/</link>
		<comments>http://www.devedup.com/index.php/2010/06/06/iphone-uitextview-with-rounded-edges-to-look-like-a-uitextfield/#comments</comments>
		<pubDate>Sun, 06 Jun 2010 19:31:39 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Interface Builder]]></category>
		<category><![CDATA[iPhone]]></category>
		<category><![CDATA[objective-c]]></category>
		<category><![CDATA[rounded uitextview]]></category>
		<category><![CDATA[uitextfield]]></category>
		<category><![CDATA[uitextview]]></category>
		<category><![CDATA[uitextview border]]></category>

		<guid isPermaLink="false">http://blog.devedup.com/?p=226</guid>
		<description><![CDATA[UITextView has square edges, and looks ugly compared to a UITextField! Unfortunately, there isn&#8217;t an option to give the UITextView a nice border. There are various ways to do this, such as creating your own background image for the UITextView, but I have found a relatively easy way to do it &#8211; and one that [...]]]></description>
			<content:encoded><![CDATA[<p>UITextView has square edges, and looks ugly compared to a UITextField!</p>
<p><img src="http://blog.devedup.com/wp-content/uploads/2010/06/Screen-shot-2010-06-06-at-20.22.29-161x300.png" alt="Screen shot 2010-06-06 at 20.22.29" title="Screen shot 2010-06-06 at 20.22.29" width="161" height="300" class="aligncenter size-medium wp-image-231" /></p>
<p>Unfortunately, there isn&#8217;t an option to give the UITextView a nice border. There are various ways to do this, such as creating your own background image for the UITextView, but I have found a relatively easy way to do it &#8211; and one that anyone without photoshop skills can achieve. </p>
<p>I achieve it by placing a UITextField behind the UITextView. However, in InterfaceBuilder you can&#8217;t change the height of a UITextField, so you have to edit the .xib file in Text Edit to change its height.</p>
<p>Here are the steps you need to do:<br />
<b></p>
<ol>
<li>Add a UITextField to your View and put a UITextView on top of it. </li>
<li>Decide on how high you want your UITextView and resize it.</li>
<li>Give the UITextField a tag of 999 (or whatever you want) (hit CMD-1 to bring up the attributes inspector to do this).</li>
<li>Save the .xib file and then right click the file > Open With > Other > TextEdit</li>
<li>Search for your tag, 999, and in the same <object> section of the xml you will see something like: <string key="NSFrame">{{25, 199}, {275, 31}}</string> (see below)</li>
<li>You need to change 31 to the same height as your UITextView and then save the .xib file in TextEdit</li>
<li>When you return to IB it will tell you the document has been modified, click Revert</li>
<li>You should now see a tall UITextField behind your UITextView. Make sure your UITextView has a transparent background!</li>
</ol>
<p></b></p>
<pre class="brush: xml; title: ; notranslate">
&lt;object class=&quot;IBUITextField&quot; id=&quot;154341485&quot;&gt;
	&lt;reference key=&quot;NSNextResponder&quot; ref=&quot;774585933&quot;/&gt;
	&lt;int key=&quot;NSvFlags&quot;&gt;292&lt;/int&gt;
	&lt;string key=&quot;NSFrame&quot;&gt;{{25, 199}, {275, 31}}&lt;/string&gt; THIS IS THE LINE THAT YOU NEED TO EDIT.... CHANGE 31 TO THE HEIGHT OF YOUR UITEXTVIEW
	&lt;reference key=&quot;NSSuperview&quot; ref=&quot;774585933&quot;/&gt;
	&lt;reference key=&quot;IBUIBackgroundColor&quot; ref=&quot;157267157&quot;/&gt;
	&lt;bool key=&quot;IBUIOpaque&quot;&gt;NO&lt;/bool&gt;
	&lt;bool key=&quot;IBUIClearsContextBeforeDrawing&quot;&gt;NO&lt;/bool&gt;
	&lt;int key=&quot;IBUITag&quot;&gt;999&lt;/int&gt;THIS IS THE TAG YOU CHOSE TO HELP YOU FIND THIS SECTION IN THE XIB FILE
</pre>
<p>Here is my project if you need help seeing how I did it.</p>
<p><a href="http://blog.devedup.com/wp-content/uploads/2010/06/RoundedUITextView.zip"><img src="http://blog.devedup.com/wp-content/uploads/2010/03/xcodeProject.png" alt="xcodeProject" title="xcodeProject" width="70" height="59" class="aligncenter size-full wp-image-218" /></a></p>
<p>Thanks</p>
]]></content:encoded>
			<wfw:commentRss>http://www.devedup.com/index.php/2010/06/06/iphone-uitextview-with-rounded-edges-to-look-like-a-uitextfield/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>iPhone: Maintain visibility of form inputs &#8211; auto-scrolling views</title>
		<link>http://www.devedup.com/index.php/2010/03/25/iphone-maintain-visibility-of-form-inputs-auto-scrolling-views/</link>
		<comments>http://www.devedup.com/index.php/2010/03/25/iphone-maintain-visibility-of-form-inputs-auto-scrolling-views/#comments</comments>
		<pubDate>Thu, 25 Mar 2010 20:57:17 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[iPhone]]></category>
		<category><![CDATA[objective-c]]></category>
		<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[form visibility]]></category>
		<category><![CDATA[inputs hidden]]></category>
		<category><![CDATA[keyboard hiding view]]></category>
		<category><![CDATA[scrolling view]]></category>

		<guid isPermaLink="false">http://blog.devedup.com/?p=198</guid>
		<description><![CDATA[When you develop forms or any screens with input fields, occasionally the inputs will be obscured by the keyboard when it appears. This is bad usability for the user who now has to input data without being able to see what they have typed! One solution is to slide the whole view so that the [...]]]></description>
			<content:encoded><![CDATA[<p>When you develop forms or any screens with input fields, occasionally the inputs will be obscured by the keyboard when it appears. This is bad usability for the user who now has to input data without being able to see what they have typed! One solution is to slide the whole view so that the field being edited is always visible.</p>
<p><img src="http://blog.devedup.com/wp-content/uploads/2010/03/Screen-shot-2010-03-25-at-20.21.31-163x300.png" alt="Screen shot 2010-03-25 at 20.21.31" title="Screen shot 2010-03-25 at 20.21.31" width="163" height="300" class="aligncenter size-medium wp-image-201" /><img src="http://blog.devedup.com/wp-content/uploads/2010/03/Screen-shot-2010-03-25-at-20.21.41-158x300.png" alt="Screen shot 2010-03-25 at 20.21.41" title="Screen shot 2010-03-25 at 20.21.41" width="158" height="300" class="aligncenter size-medium wp-image-202" /><img src="http://blog.devedup.com/wp-content/uploads/2010/03/Screen-shot-2010-03-25-at-20.32.47-157x300.png" alt="Screen shot 2010-03-25 at 20.32.47" title="Screen shot 2010-03-25 at 20.32.47" width="157" height="300" class="aligncenter size-medium wp-image-203" /></p>
<p>This solution I provide adds a few methods to UIView (yes i know, adding categories to cocoa classes is naughty) &#8211; which will determine how much to slide the view based on the inputs position on the whole screen, and then slide the view at the same speed as the keyboard slide entry. It then will slide back to where it was when you are finished editing.</p>
<p>It is pretty simple to do this &#8211; here is how I calculate where to scroll the view:</p>
<pre class="brush: objc; title: ; notranslate">
- (void) maintainVisibityOfControl:(UIControl *)control offset:(float)offset {
	static const float deviceHeight = 480;
	static const float keyboardHeight = 216;
	static const float gap = 5; //gap between the top of keyboard and the control
	
	//Find the controls absolute position in the 320*480 window - it could be nested in other views
	CGPoint absolute = [control.superview convertPoint:control.frame.origin toView:nil];

	//If it would be hidden behind the keyboard....
	if (absolute.y &gt; (keyboardHeight + gap)) {
		//Shift the view
		float shiftBy = (deviceHeight - absolute.y) - (deviceHeight - keyboardHeight - gap - offset);
		[UIView beginAnimations:nil context:nil];
		[UIView setAnimationDuration:0.3f]; //this is speed of keyboard
		CGAffineTransform slideTransform = CGAffineTransformMakeTranslation(0.0, shiftBy);
		self.transform = slideTransform;			
		[UIView commitAnimations];
	}	
}
</pre>
<p>..and then I reset the view afterwards using:</p>
<pre class="brush: objc; title: ; notranslate">
- (void) resetViewToIdentityTransform {		
	[UIView beginAnimations:nil context:nil];
	[UIView setAnimationDuration:0.3f]; //this is speed of keyboard
	CGAffineTransform slideTransform = CGAffineTransformIdentity;
	self.transform = slideTransform;			
	[UIView commitAnimations];
}
</pre>
<p>You only need to make minimal changes to your own code, and call these methods from your UITextFieldDelegate methods (or other control delegates):</p>
<pre class="brush: objc; title: ; notranslate">
- (void) textFieldDidBeginEditing:(UITextField *)textField { 
	[self.view maintainVisibityOfControl:textField offset:0.0f];
}

- (void)textFieldDidEndEditing:(UITextField *)textField {
	if (textField == currentControl) {
		//If the textfield is still the same one, we can reset the view animated
		[self.view resetViewToIdentityTransform];			
	}else {
		//However, if the currentControl has changed - that indicates the user has
		//gone into another control - so don't reset view, otherwise animations jump around
	}
}
</pre>
<p>Here is a copy of the XCode project:<br />
<a href="http://blog.devedup.com/wp-content/uploads/2010/03/FormScroll.zip"><img src="http://blog.devedup.com/wp-content/uploads/2010/03/xcodeProject.png" alt="xcodeProject" title="xcodeProject" width="70" height="59" class="aligncenter size-full wp-image-218" /></a></p>
<p>Thanks</p>
]]></content:encoded>
			<wfw:commentRss>http://www.devedup.com/index.php/2010/03/25/iphone-maintain-visibility-of-form-inputs-auto-scrolling-views/feed/</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
		<item>
		<title>iPhone: Number Pad with a decimal point (OS 3.0, OS 4.0) using public API</title>
		<link>http://www.devedup.com/index.php/2010/03/13/iphone-number-pad-with-a-decimal-point/</link>
		<comments>http://www.devedup.com/index.php/2010/03/13/iphone-number-pad-with-a-decimal-point/#comments</comments>
		<pubDate>Sat, 13 Mar 2010 18:05:28 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[iPhone]]></category>
		<category><![CDATA[objective-c]]></category>
		<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[iphone keyboard]]></category>
		<category><![CDATA[legal]]></category>
		<category><![CDATA[number pad]]></category>
		<category><![CDATA[number pad decimal point]]></category>
		<category><![CDATA[OS 4.0]]></category>

		<guid isPermaLink="false">http://blog.devedup.com/?p=187</guid>
		<description><![CDATA[UPDATE: iOS 4.1 Now has this behaviour built into the SDK. You can set your keyboard type to be UIKeyboardTypeDecimalPad ! Finally ! Of the various keyboards you can choose when developing iPhone apps, the number pad doesn&#8217;t come with a decimal point. There is a blank button in the bottom left corner that doesn&#8217;t [...]]]></description>
			<content:encoded><![CDATA[<p><strong><span style="color: #ff0000;">UPDATE: </span>iOS 4.1 Now has this behaviour built into the SDK. You can set your keyboard type to be UIKeyboardTypeDecimalPad ! Finally !</strong></p>
<p>Of the various keyboards you can choose when developing iPhone apps, the number pad doesn&#8217;t come with a decimal point. There is a blank button in the bottom left corner that doesn&#8217;t do anything, so I&#8217;m going to show you how to put a decimal point button there to look like this:<br />
<img class="aligncenter size-medium wp-image-185" title="Screen shot 2010-03-13 at 17.40.13" src="http://blog.devedup.com/wp-content/uploads/2010/03/Screen-shot-2010-03-13-at-17.40.13-161x300.png" alt="Screen shot 2010-03-13 at 17.40.13" width="161" height="300" /> <img class="aligncenter size-medium wp-image-186" title="Screen shot 2010-03-13 at 17.40.19" src="http://blog.devedup.com/wp-content/uploads/2010/03/Screen-shot-2010-03-13-at-17.40.19-161x300.png" alt="Screen shot 2010-03-13 at 17.40.19" width="161" height="300" /></p>
<p>There are a few other tutorial around that show you how to do this, but i believe mine is better&#8230;.because the code is simpler to use, its more flexible, and the UI colors and button states are perfectly matched to the rest of the keyboard (unlike some of the other tutorials) The code you use to implement this will look like this:</p>
<pre class="brush: objc; title: ; notranslate">
@interface DecimalPointNumberPadViewController : UIViewController &lt;UITextFieldDelegate&gt; {
	NumberKeypadDecimalPoint *numberKeyPad;
}
@end

@implementation DecimalPointNumberPadViewController
- (void) textFieldDidBeginEditing:(UITextField *)textField {
	numberKeyPad = [[NumberKeypadDecimalPoint keypadForTextField:textField] retain];
}
- (void)textFieldDidEndEditing:(UITextField *)textField {
	[numberKeyPad release];
}
@end
</pre>
<ul>
<li> it works on any number of UITextFields that are displayed on your view controller.</li>
<li>It will only add one decimal point per text field.</li>
</ul>
<p>To achieve this, here are the basic steps of what i do:</p>
<ol>
<li>Create a custom UIButton with clear background and dark grey text.</li>
<li>For the highlighted state i change the background image of the button and the text color to be white</li>
<li>I find the UIKeyboard in the application window and add the custom button at the required location</li>
<li>I add a delegate to the button to listen for click events and pass the event to a handler which adds a decimal point to the current UITextField</li>
</ol>
<p><strong>Update 5th June 2010: OS4 compatible and using only public API</strong></p>
<p>As using private API&#8217;s is against the SDK agreement, I&#8217;ve updated the code to remove references to any private API. It is also now compatible with OS 4.0.</p>
<p><strong>Update 20th July 2010: This code was part of the app I&#8217;m working on and was accepted by apple. </strong></p>
<p>A copy of my XCode project is here:</p>
<p><a href="http://blog.devedup.com/wp-content/uploads/2010/06/DecimalPointNumberPad-v4.zip"><img class="aligncenter size-full wp-image-218" title="xcodeProject" src="http://blog.devedup.com/wp-content/uploads/2010/03/xcodeProject.png" alt="xcodeProject" width="70" height="59" />DecimalPointNumberPad-v4</a></p>
<p>Thanks</p>
]]></content:encoded>
			<wfw:commentRss>http://www.devedup.com/index.php/2010/03/13/iphone-number-pad-with-a-decimal-point/feed/</wfw:commentRss>
		<slash:comments>101</slash:comments>
		</item>
		<item>
		<title>iPhone: Animate an object along a path</title>
		<link>http://www.devedup.com/index.php/2010/03/03/iphone-animate-an-object-along-a-path/</link>
		<comments>http://www.devedup.com/index.php/2010/03/03/iphone-animate-an-object-along-a-path/#comments</comments>
		<pubDate>Wed, 03 Mar 2010 21:39:33 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[iPhone]]></category>
		<category><![CDATA[objective-c]]></category>
		<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA["animate along a path"]]></category>
		<category><![CDATA["animation path"]]></category>
		<category><![CDATA[animation]]></category>
		<category><![CDATA[CAKeyframeAnimation]]></category>
		<category><![CDATA[UIGraphicsBeginImageContext]]></category>

		<guid isPermaLink="false">http://blog.devedup.com/?p=166</guid>
		<description><![CDATA[Here i will show you how to animate an object along a path on a UIView. I will create the path and draw it onto the UIView so that you can see it, and then use the same path for the animation. I&#8217;m doing all of this within a UIView that i have added to [...]]]></description>
			<content:encoded><![CDATA[<p>Here i will show you how to animate an object along a path on a UIView. I will create the path and draw it onto the UIView so that you can see it, and then use the same path for the animation.</p>
<p>I&#8217;m doing all of this within a UIView that i have added to my screen&#8230; </p>
<p><img src="http://blog.devedup.com/wp-content/uploads/2010/03/Screen-shot-2010-03-03-at-21.40.45-161x300.png" alt="Animate along a path" title="Animate along a path" width="161" height="300" class="aligncenter size-medium wp-image-171" /></p>
<p>Firstly, we will draw a curved line on the screen&#8230;.</p>
<pre class="brush: objc; title: ; notranslate">
//This draws a quadratic bezier curved line right across the screen
- ( void ) drawACurvedLine {
	//Create a bitmap graphics context, you will later get a UIImage from this
	UIGraphicsBeginImageContext(CGSizeMake(320,460));
	CGContextRef ctx = UIGraphicsGetCurrentContext();
	
	//Set variables in the context for drawing
	CGContextSetLineWidth(ctx, 1.5);
	CGContextSetStrokeColorWithColor(ctx, [UIColor whiteColor].CGColor);
	
	//Set the start point of your drawing
	CGContextMoveToPoint(ctx, 10, 10);
	//The end point of the line is 310,450 .... i'm also setting a reference point of 10,450
	//A quadratic bezier curve is drawn using these coordinates - experiment and see the results.
	CGContextAddQuadCurveToPoint(ctx, 10, 450, 310, 450);
	//Add another curve, the opposite of the above - finishing back where we started
	CGContextAddQuadCurveToPoint(ctx, 310, 10, 10, 10);
	
	//Draw the line 
	CGContextDrawPath(ctx, kCGPathStroke);
	
	//Get a UIImage from the current bitmap context we created at the start and then end the image context
	UIImage *curve = UIGraphicsGetImageFromCurrentImageContext();
	UIGraphicsEndImageContext();
	
	//With the image, we need a UIImageView
	UIImageView *curveView = [[UIImageView alloc] initWithImage:curve];
	//Set the frame of the view - which is used to position it when we add it to our current UIView
	curveView.frame = CGRectMake(1, 1, 320, 460);
	curveView.backgroundColor = [UIColor clearColor];
	[self addSubview:curveView];
}
</pre>
<p>Now we will create a keyframe animation, and a path that is the same as the line we just drew. We will also draw a circle, and animate it along that path:</p>
<pre class="brush: objc; title: ; notranslate">
- (void) animateCicleAlongPath {
	//Prepare the animation - we use keyframe animation for animations of this complexity
	CAKeyframeAnimation *pathAnimation = [CAKeyframeAnimation animationWithKeyPath:@&quot;position&quot;];
	//Set some variables on the animation
	pathAnimation.calculationMode = kCAAnimationPaced;
	//We want the animation to persist - not so important in this case - but kept for clarity
	//If we animated something from left to right - and we wanted it to stay in the new position, 
	//then we would need these parameters
	pathAnimation.fillMode = kCAFillModeForwards;
	pathAnimation.removedOnCompletion = NO;
	pathAnimation.duration = 5.0;
	//Lets loop continuously for the demonstration
	pathAnimation.repeatCount = 1000;
	
	//Setup the path for the animation - this is very similar as the code the draw the line
	//instead of drawing to the graphics context, instead we draw lines on a CGPathRef
	CGPoint endPoint = CGPointMake(310, 450);
	CGMutablePathRef curvedPath = CGPathCreateMutable();
	CGPathMoveToPoint(curvedPath, NULL, 10, 10);
	CGPathAddQuadCurveToPoint(curvedPath, NULL, 10, 450, 310, 450);
	CGPathAddQuadCurveToPoint(curvedPath, NULL, 310, 10, 10, 10);
	
	//Now we have the path, we tell the animation we want to use this path - then we release the path
	pathAnimation.path = curvedPath;
	CGPathRelease(curvedPath);
	
	//We will now draw a circle at the start of the path which we will animate to follow the path
	//We use the same technique as before to draw to a bitmap context and then eventually create
	//a UIImageView which we add to our view
	UIGraphicsBeginImageContext(CGSizeMake(20,20));
	CGContextRef ctx = UIGraphicsGetCurrentContext();	
	//Set context variables
	CGContextSetLineWidth(ctx, 1.5);
	CGContextSetFillColorWithColor(ctx, [UIColor greenColor].CGColor);
	CGContextSetStrokeColorWithColor(ctx, [UIColor whiteColor].CGColor);
	//Draw a circle - and paint it with a different outline (white) and fill color (green)
	CGContextAddEllipseInRect(ctx, CGRectMake(1, 1, 18, 18));
	CGContextDrawPath(ctx, kCGPathFillStroke);
	UIImage *circle = UIGraphicsGetImageFromCurrentImageContext();
	UIGraphicsEndImageContext();
	
	UIImageView *circleView = [[UIImageView alloc] initWithImage:circle];
	circleView.frame = CGRectMake(1, 1, 20, 20);
	[self addSubview:circleView];

	//Add the animation to the circleView - once you add the animation to the layer, the animation starts
	[circleView.layer addAnimation:pathAnimation forKey:@&quot;moveTheSquare&quot;];	
}
</pre>
<p>To get all this running, you can use this init method:</p>
<pre class="brush: objc; title: ; notranslate">
- (id)initWithFrame:(CGRect)frame {
	if (self = [super initWithFrame:frame]) {
		[self drawACurvedLine];
		[self animateCicleAlongPath];		
    }
    return self;
}
</pre>
<p>and use something like this in your ViewController&#8230;.</p>
<pre class="brush: objc; title: ; notranslate">
- (void)viewDidLoad {
	UIView *customView = [[Canvas alloc] initWithFrame:CGRectMake(0, 0, 320, 460)];
	customView.backgroundColor = [UIColor blackColor];
	[self.view addSubview:customView];
	[customView release];
    [super viewDidLoad];
}
</pre>
<p>Also&#8230;don&#8217;t forget to add your Quartz import:</p>
<pre class="brush: objc; title: ; notranslate">
#import &lt;QuartzCore/QuartzCore.h&gt;
</pre>
<p>I&#8217;m sure there are lots of better ways of doing this, such as using CALayers and adding CGImage to the layers. But that&#8217;s something I haven&#8217;t tried yet. The example above should be enough to get you started with animation along a path.</p>
<p>Here is a copy of the XCode project:<br />
<a href="http://blog.devedup.com/wp-content/uploads/2010/06/AnimateAlongAPath.zip"><img src="http://blog.devedup.com/wp-content/uploads/2010/03/xcodeProject.png" alt="xcodeProject" title="xcodeProject" width="70" height="59" class="aligncenter size-full wp-image-218" /></a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.devedup.com/index.php/2010/03/03/iphone-animate-an-object-along-a-path/feed/</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
		<item>
		<title>iPhone: This class is not key value coding-compliant for the key &#8230;..</title>
		<link>http://www.devedup.com/index.php/2009/11/16/this-class-is-not-key-value-coding-compliant-for-the-key/</link>
		<comments>http://www.devedup.com/index.php/2009/11/16/this-class-is-not-key-value-coding-compliant-for-the-key/#comments</comments>
		<pubDate>Mon, 16 Nov 2009 21:34:59 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[iPhone]]></category>
		<category><![CDATA[objective-c]]></category>
		<category><![CDATA[iphone development]]></category>
		<category><![CDATA[key value coding-compliant]]></category>

		<guid isPermaLink="false">http://blog.devedup.com/?p=153</guid>
		<description><![CDATA[Doing some iPhone development and this error really caught me out for a while: It&#8217;s seemed fairly cryptic at the time. I had created a Tab Bar Controller and for each tab button, i hadn&#8217;t set its class identity &#8211; so each tab was still declared as a UIViewController instead of the actual Controller class [...]]]></description>
			<content:encoded><![CDATA[<p>Doing some iPhone development and this error really caught me out for a while:</p>
<pre class="brush: objc; title: ; notranslate">2009-11-16 21:02:48.387 Pickers[3779:207] *** Terminating app due to uncaught 
exception 'NSUnknownKeyException', reason: '[&lt;UIViewController 0x381d740&gt; 
setValue:forUndefinedKey:]: this class is not key value coding-compliant for the key datePicker.'
2009-11-16 21:02:48.388 Pickers[3779:207] Stack: (</pre>
<p>It&#8217;s seemed fairly cryptic at the time. I had created a Tab Bar Controller and for each tab button, i hadn&#8217;t set its class identity &#8211; so each tab was still declared as a UIViewController instead of the actual Controller class that i had created. </p>
<p>The error comes from the NSKeyValueCoding category which allows you to access properties via setValue: forKey:</p>
<pre class="brush: objc; title: ; notranslate">
Person *aPerson = [[Person alloc] initWithAge: 53];
aPerson.name = @&quot;Steve&quot;; 
// NOTE: dot notation, uses synthesized setter, equivalent to [aPerson setName: @&quot;Steve&quot;];
NSLog(@&quot;Access by message (%@), dot notation(%@), 
    property name(%@) and direct instance variable access (%@)&quot;,
      [aPerson name], aPerson.name, [aPerson valueForKey:@&quot;name&quot;], aPerson-&gt;name);
</pre>
<p>So i guess it is just complaining that it can&#8217;t find the generated setter method named setDatePicker &#8211; because datePicker instance is  not  on the generic class.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.devedup.com/index.php/2009/11/16/this-class-is-not-key-value-coding-compliant-for-the-key/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
	</channel>
</rss>
