<?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>Mobile Perspectives &#187; Interface Builder</title>
	<atom:link href="http://www.BluMtnWerx.com/blog/tag/interface-builder/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.BluMtnWerx.com/blog</link>
	<description>Computing at the Edge!</description>
	<lastBuildDate>Fri, 19 Aug 2011 00:29:49 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.1.4</generator>
		<item>
		<title>Musings on the Sometimes Maligned Interface Builder</title>
		<link>http://www.BluMtnWerx.com/blog/2009/03/musings-on-the-sometimes-maligned-interface-builder/</link>
		<comments>http://www.BluMtnWerx.com/blog/2009/03/musings-on-the-sometimes-maligned-interface-builder/#comments</comments>
		<pubDate>Tue, 31 Mar 2009 20:18:45 +0000</pubDate>
		<dc:creator>deans</dc:creator>
				<category><![CDATA[Resources]]></category>
		<category><![CDATA[IB]]></category>
		<category><![CDATA[Interface Builder]]></category>
		<category><![CDATA[iPhone Dev Tools]]></category>
		<category><![CDATA[iPhone SDK]]></category>

		<guid isPermaLink="false">http://www.BluMtnWerx.com/blog/?p=55</guid>
		<description><![CDATA[I've seen both positive and negative comments regarding IB.&#160;  Put me squarely in the fan camp.&#160;  While the application has some odd issues, the benefits of being able to do your interface design on screen, using drag &#038; drop, more than compensate for the challenges.&#160;  In fact, there are pretty straightforward ways to overcome many of the limitations.&#160;  We'll talk about one "trick" in this post.]]></description>
			<content:encoded><![CDATA[<p>We all know Interface Builder (IB) as the visual design tool that some of use to lay out UIs for iPhones / iPod Touches.   When I was trying to figure out how to use it, I encountered a great deal of commentary both positive, and negative.   While there will always be those who prefer to do everything programmatically, I&#8217;m one of the lazy ones who appreciates tools that let me accomplish my tasks without writing heaps of potentially buggy code.</p>
<p>IB lets me position my controls interactively, and it provides somewhat straightforward hooks for connecting my program to the new controls.   One of the big complaints that I noticed, and one that frustrated me a bit, at least at first, was that IB doesn&#8217;t provide full access to all of the settings on the controls that it specifies.   The specific example for me was setting the font for the <span style="font-family: Courier;">Title</span> text for the regular &quot;<span style="font-family: Courier;">Round Rect Button</span>.&quot;   Support for this operation is clearly evident via the &quot;<span style="font-family: Courier;">setfont:</span>&quot; method specified in the class header file, but I couldn&#8217;t find any way to get at the method through the IB Attributes Inspector.</p>
<p>As suggested above, I&#8217;m pretty lazy, so I didn&#8217;t want to abandon IB just to change the font face and size, then a solution appeared.   I simply established an outlet to the specific button:</p>
<p><span style="font-family: Courier;">@interface ButtonTestViewController : UIViewController {</span><br />
&#8230;<br />
<span style="font-family: Courier;">IBOutlet UIButton *theButton;</span><br />
&#8230;</p>
<p>and wrote the following code:<br />
&#8230;<br />
<span style="font-family: Courier;">UIFont *theFont = [UIFont boldSystemFontOfSize:30];<br />
[theButton setFont:theFont];<br />
CGSize tOff = CGSizeMake(2.0,2.0);<br />
[theButton setTitleShadowOffset:tOff];</span><br />
&#8230;</p>
<p>For what it&#8217;s worth, my situation was such that I was able to put the code to set the button in the <span style="font-family: Courier;">viewDidLoad</span> method.</p>
<p>One other thing to keep in mind when you&#8217;re loading your application from a nib, the ViewController&#8217;s initWithCoder is the initialization method that gets called.   Thanks to <a href="http://www.blumtnwerx.com/blog/2009/03/book-recommendation-beginning-iphone-development/">Jeff LaMarche</a> for the explanation of initializers in his response to <a href="http://www.iphonedevsdk.com/forum/iphone-sdk-development/2364-question-about-initwithnibname.html">this question</a>.</p>
<p>Unless you just love writing and maintaining UI code, I strongly urge you to take a careful look at IB.   I&#8217;ll continue to use it whenever I can.</p>
<p>Technorati Tags:  <a rel="tag" href="http://technorati.com/tag/iPhone">iPhone</a> , <a rel="tag" href="http://technorati.com/tag/iPod+Touch">iPod Touch</a> , <a rel="tag" href="http://technorati.com/tag/Apple">Apple</a> , <a rel="tag" href="http://technorati.com/tag/mobile">mobile</a> </p>
]]></content:encoded>
			<wfw:commentRss>http://www.BluMtnWerx.com/blog/2009/03/musings-on-the-sometimes-maligned-interface-builder/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

