<?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>tmro &#187; objective c</title>
	<atom:link href="http://www.tmro.net/category/software/languages/objective-c/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.tmro.net</link>
	<description>Mobilise your business</description>
	<lastBuildDate>Sun, 21 Aug 2011 01:38:09 +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>Updating the UISearchBar programmatically</title>
		<link>http://www.tmro.net/2009/10/updating-the-uisearchbar-programmatically/</link>
		<comments>http://www.tmro.net/2009/10/updating-the-uisearchbar-programmatically/#comments</comments>
		<pubDate>Sat, 17 Oct 2009 03:28:27 +0000</pubDate>
		<dc:creator>Nick</dc:creator>
				<category><![CDATA[iPhone]]></category>
		<category><![CDATA[objective c]]></category>
		<category><![CDATA[tutorial]]></category>
		<category><![CDATA[how to]]></category>

		<guid isPermaLink="false">http://www.tmro.net/?p=208</guid>
		<description><![CDATA[Today I had to update WelliBUS&#8217;s search bar programmatically because I needed to use the street picked up via GPS as my street name. Until this point implementing the search bar seemed easy: adopt a couple of protocols: UISearchDisplayDelegate and &#8230; <a href="http://www.tmro.net/2009/10/updating-the-uisearchbar-programmatically/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Today I had to update WelliBUS&#8217;s search bar programmatically because I needed to use the street picked up via GPS as my street name.</p>
<p>Until this point implementing the search bar seemed easy:</p>
<ul>
<li>adopt a couple of protocols: UISearchDisplayDelegate and UISearchBarDelegate</li>
<li>implement a few callback methods (from the delegates listed above)</li>
</ul>

<div class="wp_syntax"><div class="code"><pre class="obj-c" style="font-family:monospace;">- (BOOL)searchDisplayController:(UISearchDisplayController *)controller shouldReloadTableForSearchString:(NSString *)searchString;
- (BOOL)searchDisplayController:(UISearchDisplayController *)controller shouldReloadTableForSearchScope:(NSInteger)searchOption;
- (void)searchDisplayControllerDidBeginSearch:(UISearchDisplayController *)controller;
- (void)searchDisplayControllerDidEndSearch:(UISearchDisplayController *)controller;</pre></div></div>

<ul>
<li>and implement my own filtering function</li>
</ul>

<div class="wp_syntax"><div class="code"><pre class="obj-c" style="font-family:monospace;">- (void)filterContentForSearchText:(NSString*)searchText scope:(NSString*)scope;</pre></div></div>

<p>The problem I had on my hands was how to programmatically update the text in the UISearchBar and force the UISearchDisplayDelegate to call the appropriate callback methods.</p>
<p>Turns out it was simpler than expected (despite not being able to find a solution by googling). All that was needed was:</p>

<div class="wp_syntax"><div class="code"><pre class="obj-c" style="font-family:monospace;">[self.searchDisplayController.searchBar becomeFirstResponder];
self.searchDisplayController.searchBar.text = returnString;</pre></div></div>

<p>Cheers&#8230;</p>
]]></content:encoded>
			<wfw:commentRss>http://www.tmro.net/2009/10/updating-the-uisearchbar-programmatically/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Urban Airship &#8211; Push Notifications</title>
		<link>http://www.tmro.net/2009/10/urban-airship-push-notifications/</link>
		<comments>http://www.tmro.net/2009/10/urban-airship-push-notifications/#comments</comments>
		<pubDate>Sun, 04 Oct 2009 22:50:31 +0000</pubDate>
		<dc:creator>Nick</dc:creator>
				<category><![CDATA[iPhone]]></category>
		<category><![CDATA[objective c]]></category>
		<category><![CDATA[REST]]></category>
		<category><![CDATA[apple]]></category>
		<category><![CDATA[how to]]></category>
		<category><![CDATA[json]]></category>

		<guid isPermaLink="false">http://www.tmro.net/?p=198</guid>
		<description><![CDATA[Today I have finally added Push Notifications to Parcel Trackr. I decided not to waste time and I went for Urban Airship. I registered, uploaded my push certificate, downloaded the sample and integrated the two systems. Not everything went smoothly &#8230; <a href="http://www.tmro.net/2009/10/urban-airship-push-notifications/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Helvetica;"><span style="letter-spacing: 0.0px;">Today I have finally added Push Notifications to Parcel Trackr.</span></p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Helvetica; min-height: 14.0px;"><span style="letter-spacing: 0.0px;"> </span></p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Helvetica;"><span style="letter-spacing: 0.0px;">I decided not to waste time and I went for Urban Airship. I registered, uploaded my push certificate, downloaded the sample and integrated the two systems.</span></p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Helvetica; min-height: 14.0px;"><span style="letter-spacing: 0.0px;"> </span></p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Helvetica;"><span style="letter-spacing: 0.0px;">Not everything went smoothly though because when I first ran the application I got a</span></p>
<p style="margin: 0.0px 0.0px 0.0px 28.0px; text-indent: -28.0px; font: 11.0px Menlo;"><span style="letter-spacing: 0.0px;"><strong>Failed to register with error: Error Domain=NSCocoaErrorDomain Code=3000 UserInfo=0&#215;120610 &#8220;no valid &#8216;aps-environment&#8217; entitlement string found for application&#8221;</strong></span></p>
<p style="margin: 0.0px 0.0px 0.0px 28.0px; text-indent: -28.0px; font: 11.0px Menlo; min-height: 13.0px;"><span style="letter-spacing: 0.0px;"><strong> </strong></span></p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Helvetica;"><span style="letter-spacing: 0.0px;">I thought my provisioning profile did not include the right entitlement&#8230; so I re-downloaded it and tried again. Turns out I was using the wrong provisioning profile.</span></p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Helvetica; min-height: 14.0px;"><span style="letter-spacing: 0.0px;"> </span></p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Helvetica;"><span style="letter-spacing: 0.0px;">So if you want to avoid my mistake just make sure that after you’ve configured push services in the iPhone Dev Center you download the updated provisioning profile and then you install it via XCode.</span></p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Helvetica; min-height: 14.0px;"><span style="letter-spacing: 0.0px;"> </span></p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Helvetica;"><span style="letter-spacing: 0.0px;">Other things worth checking include: the product name in your build configuration matches the app id and of course, the ultimate solution, clean all targets before building!</span></p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Helvetica; min-height: 14.0px;"><span style="letter-spacing: 0.0px;"> </span></p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Helvetica;"><span style="letter-spacing: 0.0px;">Cheers&#8230;</span></p>
]]></content:encoded>
			<wfw:commentRss>http://www.tmro.net/2009/10/urban-airship-push-notifications/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>iPhone how to: center and horizontal align the contents of a UITextField</title>
		<link>http://www.tmro.net/2009/08/iphone-how-to-center-and-horizontal-align-the-contents-of-a-uitextfield/</link>
		<comments>http://www.tmro.net/2009/08/iphone-how-to-center-and-horizontal-align-the-contents-of-a-uitextfield/#comments</comments>
		<pubDate>Sat, 08 Aug 2009 01:19:56 +0000</pubDate>
		<dc:creator>Nick</dc:creator>
				<category><![CDATA[iPhone]]></category>
		<category><![CDATA[objective c]]></category>
		<category><![CDATA[how to]]></category>

		<guid isPermaLink="false">http://www.tmro.net/?p=147</guid>
		<description><![CDATA[It&#8217;s as simple as: 1 2 theTextField.contentVerticalAlignment = UIControlContentVerticalAlignmentCenter; theTextField.textAlignment = UITextAlignmentCenter; Basically this will ensure that no matter how tall your text field is the actual text will be centered both vertically and horizontally. Cheers&#8230;]]></description>
			<content:encoded><![CDATA[<p>It&#8217;s as simple as:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
</pre></td><td class="code"><pre class="objective-c" style="font-family:monospace;">theTextField.contentVerticalAlignment = UIControlContentVerticalAlignmentCenter;
theTextField.textAlignment = UITextAlignmentCenter;</pre></td></tr></table></div>

<p>Basically this will ensure that no matter how tall your text field is the actual text will be centered both vertically and horizontally.</p>
<p>Cheers&#8230;</p>
]]></content:encoded>
			<wfw:commentRss>http://www.tmro.net/2009/08/iphone-how-to-center-and-horizontal-align-the-contents-of-a-uitextfield/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

