<?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>Life in the Geek Lane &#187; iPhone Dev Musings</title>
	<atom:link href="http://www.geeklane.com/category/iphone-dev-musings/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.geeklane.com</link>
	<description>babblings!</description>
	<lastBuildDate>Tue, 19 Jul 2011 11:06:01 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
		<item>
		<title>Custom NSTableViewCell labels not appearing</title>
		<link>http://www.geeklane.com/2011/07/19/custom-nstableviewcell-labels-not-appearing/</link>
		<comments>http://www.geeklane.com/2011/07/19/custom-nstableviewcell-labels-not-appearing/#comments</comments>
		<pubDate>Tue, 19 Jul 2011 11:05:18 +0000</pubDate>
		<dc:creator>Brett</dc:creator>
				<category><![CDATA[Geek / Apple Stuff]]></category>
		<category><![CDATA[iPhone Dev Musings]]></category>
		<category><![CDATA[cocoa]]></category>
		<category><![CDATA[iphone]]></category>
		<category><![CDATA[objective-c]]></category>

		<guid isPermaLink="false">http://www.geeklane.com/?p=936</guid>
		<description><![CDATA[I&#8217;m working on an iPhone app at the moment that is being upgraded from a previous version. I decided early on to just build on the existing code rather than trying to reinvent the wheel. I&#8217;ve spent a bit of time fixing warnings that have cropped up from changes in the iOS SDK (the original [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;m working on an iPhone app at the moment that is being upgraded from a previous version. I decided early on to just build on the existing code rather than trying to reinvent the wheel.</p>
<p>I&#8217;ve spent a bit of time fixing warnings that have cropped up from changes in the iOS SDK (the original app was developed for iOS 2) but one problem in particular had me stumped for a while.</p>
<p>When subclassing NSTableViewCell, the old init method was: <br />
	- (id)initWithFrame:(CGRect)frame reuseIdentifier:(NSString *)reuseIdentifier</p>
<p>but somewhere along the line the init method definition changed to: <br />
	-(id)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier</p>
<p>I&#8217;m yet to find out when this changed occurred, but it left me with the problem of no longer having access to the &#8220;frame&#8221; parameter. This meant the code in the init method that used to size the views of the custom cell no longer had a point of reference.</p>
<p>It took me a while to figure out that due to this change there was also another new method introduced that now had to be overridden to size the custom cell views:<br />
	-(void)layoutSubviews</p>
<p>In this method is where we are now meant to set the size of the custom cell views.</p>
<p>So I commented out the sizing code that used to be in the init method and moved it to the new layoutSubviews method as follows:<br />
	-(void)layoutSubviews<br />
	{<br />
		[super layoutSubviews];<br />
 		CGRect label, steps;<br />
 		CGRect bounds = [[self contentView] bounds];<br />
 		label.origin.x = 20.0;<br />
 		label.origin.y = 3.0;<br />
 		label.size.height = bounds.size.height &#8211; (label.origin.y*2);<br />
 		label.size.width = 160.0;<br />
 		[dateLabel setFrame:label];</p>
<p>		steps.origin.x = 170.0;<br />
 		steps.origin.y = 5.0;<br />
 		steps.size.height = bounds.size.height &#8211; (steps.origin.y*2);<br />
 		steps.size.width = 120.0;<br />
 		[stepsLabel setFrame:steps];<br />
 	}</p>
<p>This fixed my issue. Running the app now showed the custom cell labels as expected.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.geeklane.com/2011/07/19/custom-nstableviewcell-labels-not-appearing/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>AudioServicesCreateSystemSoundID Weirdness</title>
		<link>http://www.geeklane.com/2009/04/07/audioservicescreatesystemsoundid-weirdness/</link>
		<comments>http://www.geeklane.com/2009/04/07/audioservicescreatesystemsoundid-weirdness/#comments</comments>
		<pubDate>Tue, 07 Apr 2009 11:54:19 +0000</pubDate>
		<dc:creator>Brett</dc:creator>
				<category><![CDATA[iPhone Dev Musings]]></category>

		<guid isPermaLink="false">http://www.geeklane.com/blog/?p=817</guid>
		<description><![CDATA[I was playing around with come code on my iPhone tonight and came across a really weird situation. Using the AudioToolbox to play sounds on the iPhone seems really finicky when it comes to mp3&#8242;s. Two mp3&#8242;s, each recorded and saved using the same program (WireTap Studio in this case). One worked fine, the other [...]]]></description>
			<content:encoded><![CDATA[<p>I was playing around with come code on my iPhone tonight and came across a really weird situation.</p>
<p>Using the AudioToolbox to play sounds on the iPhone seems really finicky when it comes to mp3&#8242;s. Two mp3&#8242;s, each recorded and saved using the same program (WireTap Studio in this case). One worked fine, the other caused it to crash.</p>
<p>I have no idea why. A search of the web reveals that AudioServicesCreateSystemSoundID(&#8230;) at one stage did not support MP3 but considering that one of the two files played I figured that it must have been updated.</p>
<p>Both files where the same format, right down to bitrate and exactly the same length (2 seconds long). I really have no idea.</p>
<p>Anyway, problem was solved by just making all the files WAV format. Increases the filesize a lot but at least it works.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.geeklane.com/2009/04/07/audioservicescreatesystemsoundid-weirdness/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

