<?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>Chris Danielson&#039;s Blog &#187; iPhone Development</title>
	<atom:link href="http://www.chrisdanielson.com/tag/iphone-development/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.chrisdanielson.com</link>
	<description>Trials and Tribulations of a Software Developer</description>
	<lastBuildDate>Wed, 14 Sep 2011 00:00:51 +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>Upgrading your iPhone OS 2.0 Application to 3.0 and Deprecation Warnings</title>
		<link>http://www.chrisdanielson.com/2009/08/02/upgrading-your-iphone-os-2-0-application-to-3-0-and-deprecation-warnings/</link>
		<comments>http://www.chrisdanielson.com/2009/08/02/upgrading-your-iphone-os-2-0-application-to-3-0-and-deprecation-warnings/#comments</comments>
		<pubDate>Sun, 02 Aug 2009 18:04:52 +0000</pubDate>
		<dc:creator>Chris Danielson</dc:creator>
				<category><![CDATA[iPhone Development]]></category>
		<category><![CDATA[deprecated calls]]></category>
		<category><![CDATA[OS 2.0]]></category>
		<category><![CDATA[OS 3.0]]></category>
		<category><![CDATA[UITableView]]></category>
		<category><![CDATA[UITableViewCell]]></category>
		<category><![CDATA[Upgrade]]></category>

		<guid isPermaLink="false">http://www.chrisdanielson.com/?p=113</guid>
		<description><![CDATA[I just wanted to post a brief entry here regarding getting rid of deprecated warnings when upgrading your iPhone applications from OS 2.0 to 3.x. The warnings I was getting are as follows: warning: &#8216;setImage:&#8217; is deprecated (declared at /Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/ iPhoneSimulator3.0.sdk/System/Library/Frameworks/UIKit.framework/ Headers/UITableViewCell.h:199) warning: &#8216;setText:&#8217; is deprecated (declared at /Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/ iPhoneSimulator3.0.sdk/System/Library/Frameworks/UIKit.framework/ Headers/UITableViewCell.h:199) Before&#8230; View Code OBJC//This [...]]]></description>
			<content:encoded><![CDATA[<p>I just wanted to post a brief entry here regarding getting rid of deprecated warnings when upgrading your iPhone applications from OS 2.0 to 3.x.</p>
<p>The warnings I was getting are as follows:</p>
<p>warning: &#8216;setImage:&#8217; is deprecated (declared at /Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/<br />
iPhoneSimulator3.0.sdk/System/Library/Frameworks/UIKit.framework/<br />
Headers/UITableViewCell.h:199)</p>
<p>warning: &#8216;setText:&#8217; is deprecated (declared at /Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/<br />
iPhoneSimulator3.0.sdk/System/Library/Frameworks/UIKit.framework/<br />
Headers/UITableViewCell.h:199)</p>
<p>Before&#8230;</p>

<div class="wp_codebox_msgheader"><span class="right"></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p113code3'); return false;">View Code</a> OBJC</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table><tr id="p1133"><td class="code" id="p113code3"><pre class="objc" style="font-family:monospace;"><span style="color: #11740a; font-style: italic;">//This worked perfect in OS 2.0</span>
<span style="color: #002200;">-</span> <span style="color: #002200;">&#40;</span>UITableViewCell <span style="color: #002200;">*</span><span style="color: #002200;">&#41;</span>tableView<span style="color: #002200;">:</span><span style="color: #002200;">&#40;</span>UITableView <span style="color: #002200;">*</span><span style="color: #002200;">&#41;</span>tableView cellForRowAtIndexPath<span style="color: #002200;">:</span><span style="color: #002200;">&#40;</span><a href="http://developer.apple.com/documentation/Cocoa/Reference/Foundation/Classes/NSIndexPath_Class/"><span style="color: #400080;">NSIndexPath</span></a> <span style="color: #002200;">*</span><span style="color: #002200;">&#41;</span>indexPath <span style="color: #002200;">&#123;</span>
     <span style="color: #a61390;">static</span> <a href="http://developer.apple.com/documentation/Cocoa/Reference/Foundation/Classes/NSString_Class/"><span style="color: #400080;">NSString</span></a> <span style="color: #002200;">*</span>UserSettingButtonCellIdentifier <span style="color: #002200;">=</span> <span style="color: #bf1d1a;">@</span><span style="color: #bf1d1a;">&quot;UserSetting&quot;</span>;
	UITableViewCell <span style="color: #002200;">*</span>cell <span style="color: #002200;">=</span> <span style="color: #002200;">&#91;</span>tableView dequeueReusableCellWithIdentifier<span style="color: #002200;">:</span>UserSettingButtonCellIdentifier<span style="color: #002200;">&#93;</span>;
	<span style="color: #a61390;">if</span> <span style="color: #002200;">&#40;</span>cell <span style="color: #002200;">==</span> <span style="color: #a61390;">nil</span><span style="color: #002200;">&#41;</span> <span style="color: #002200;">&#123;</span>
		cell <span style="color: #002200;">=</span> <span style="color: #002200;">&#91;</span><span style="color: #002200;">&#91;</span><span style="color: #002200;">&#91;</span>UITableViewCell alloc<span style="color: #002200;">&#93;</span> initWithFrame<span style="color: #002200;">:</span>CGRectZero reuseIdentifier<span style="color: #002200;">:</span> UserSettingButtonCellIdentifier<span style="color: #002200;">&#93;</span> autorelease<span style="color: #002200;">&#93;</span>;
	<span style="color: #002200;">&#125;</span>
     NSUInteger row <span style="color: #002200;">=</span> <span style="color: #002200;">&#91;</span>indexPath row<span style="color: #002200;">&#93;</span>;
     UserSetting <span style="color: #002200;">*</span>rowData <span style="color: #002200;">=</span> <span style="color: #002200;">&#91;</span>list objectAtIndex<span style="color: #002200;">:</span>row<span style="color: #002200;">&#93;</span>;
     UIImage <span style="color: #002200;">*</span>image <span style="color: #002200;">=</span> <span style="color: #002200;">&#91;</span>UIImage imageNamed<span style="color: #002200;">:</span><span style="color: #bf1d1a;">@</span><span style="color: #bf1d1a;">&quot;bullet_ball_glass_blue.png&quot;</span><span style="color: #002200;">&#93;</span>;
     <span style="color: #a61390;">if</span> <span style="color: #002200;">&#40;</span>row <span style="color: #002200;">!=</span> <span style="color: #2400d9;">0</span><span style="color: #002200;">&#41;</span>
         cell.image <span style="color: #002200;">=</span> image; <span style="color: #11740a; font-style: italic;">//WARNING here</span>
     cell.text <span style="color: #002200;">=</span> rowData.name; <span style="color: #11740a; font-style: italic;">//WARNING here</span>
     <span style="color: #002200;">&#91;</span>rowData release<span style="color: #002200;">&#93;</span>;
     <span style="color: #a61390;">return</span> cell;
<span style="color: #002200;">&#125;</span>
<span style="color: #11740a; font-style: italic;">//the tableView method is completely deprecated.</span>
<span style="color: #002200;">-</span> <span style="color: #002200;">&#40;</span>UITableViewCellAccessoryType<span style="color: #002200;">&#41;</span>tableView<span style="color: #002200;">:</span><span style="color: #002200;">&#40;</span>UITableView <span style="color: #002200;">*</span><span style="color: #002200;">&#41;</span>tableView accessoryTypeForRowWithIndexPath<span style="color: #002200;">:</span><span style="color: #002200;">&#40;</span><a href="http://developer.apple.com/documentation/Cocoa/Reference/Foundation/Classes/NSIndexPath_Class/"><span style="color: #400080;">NSIndexPath</span></a> <span style="color: #002200;">*</span><span style="color: #002200;">&#41;</span>indexPath <span style="color: #002200;">&#123;</span>
	<span style="color: #a61390;">return</span> UITableViewCellAccessoryDisclosureIndicator;
<span style="color: #002200;">&#125;</span></pre></td></tr></table></div>

<p>After, doing the mods to get rid of the deprecated warnings:</p>

<div class="wp_codebox_msgheader"><span class="right"></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p113code4'); return false;">View Code</a> OBJC</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table><tr id="p1134"><td class="code" id="p113code4"><pre class="objc" style="font-family:monospace;"><span style="color: #002200;">-</span> <span style="color: #002200;">&#40;</span>UITableViewCell <span style="color: #002200;">*</span><span style="color: #002200;">&#41;</span>tableView<span style="color: #002200;">:</span><span style="color: #002200;">&#40;</span>UITableView <span style="color: #002200;">*</span><span style="color: #002200;">&#41;</span>tableView cellForRowAtIndexPath<span style="color: #002200;">:</span><span style="color: #002200;">&#40;</span><a href="http://developer.apple.com/documentation/Cocoa/Reference/Foundation/Classes/NSIndexPath_Class/"><span style="color: #400080;">NSIndexPath</span></a> <span style="color: #002200;">*</span><span style="color: #002200;">&#41;</span>indexPath <span style="color: #002200;">&#123;</span>
	<span style="color: #a61390;">static</span> <a href="http://developer.apple.com/documentation/Cocoa/Reference/Foundation/Classes/NSString_Class/"><span style="color: #400080;">NSString</span></a> <span style="color: #002200;">*</span>UserSettingButtonCellIdentifier <span style="color: #002200;">=</span> <span style="color: #bf1d1a;">@</span><span style="color: #bf1d1a;">&quot;UserSetting&quot;</span>;
	UITableViewCell <span style="color: #002200;">*</span>cell <span style="color: #002200;">=</span> <span style="color: #002200;">&#91;</span>tableView dequeueReusableCellWithIdentifier<span style="color: #002200;">:</span>UserSettingButtonCellIdentifier<span style="color: #002200;">&#93;</span>;
	<span style="color: #a61390;">if</span> <span style="color: #002200;">&#40;</span>cell <span style="color: #002200;">==</span> <span style="color: #a61390;">nil</span><span style="color: #002200;">&#41;</span> <span style="color: #002200;">&#123;</span>
		cell <span style="color: #002200;">=</span> <span style="color: #002200;">&#91;</span><span style="color: #002200;">&#91;</span><span style="color: #002200;">&#91;</span>UITableViewCell alloc<span style="color: #002200;">&#93;</span> initWithFrame<span style="color: #002200;">:</span>CGRectZero reuseIdentifier<span style="color: #002200;">:</span> UserSettingButtonCellIdentifier<span style="color: #002200;">&#93;</span> autorelease<span style="color: #002200;">&#93;</span>;
	<span style="color: #002200;">&#125;</span>
	NSUInteger row <span style="color: #002200;">=</span> <span style="color: #002200;">&#91;</span>indexPath row<span style="color: #002200;">&#93;</span>;
	UserSetting <span style="color: #002200;">*</span>rowData <span style="color: #002200;">=</span> <span style="color: #002200;">&#91;</span>list objectAtIndex<span style="color: #002200;">:</span>row<span style="color: #002200;">&#93;</span>;
	UIImage <span style="color: #002200;">*</span>image <span style="color: #002200;">=</span> <span style="color: #002200;">&#91;</span>UIImage imageNamed<span style="color: #002200;">:</span><span style="color: #bf1d1a;">@</span><span style="color: #bf1d1a;">&quot;bullet_ball_glass_blue.png&quot;</span><span style="color: #002200;">&#93;</span>;
	<span style="color: #a61390;">if</span> <span style="color: #002200;">&#40;</span>row <span style="color: #002200;">!=</span> <span style="color: #2400d9;">0</span><span style="color: #002200;">&#41;</span>
		cell.imageView.image <span style="color: #002200;">=</span> image; <span style="color: #11740a; font-style: italic;">//FIXED here</span>
	cell.textLabel.text <span style="color: #002200;">=</span> rowData.name; <span style="color: #11740a; font-style: italic;">//FIXED here</span>
&nbsp;
<span style="color: #6e371a;">#ifdef __IPHONE_3_0</span>
        <span style="color: #11740a; font-style: italic;">//This is a replacement for the tableView method</span>
	cell.accessoryType <span style="color: #002200;">=</span>  UITableViewCellAccessoryDisclosureIndicator;
<span style="color: #6e371a;">#endif</span>
&nbsp;
	<span style="color: #002200;">&#91;</span>rowData release<span style="color: #002200;">&#93;</span>;
	<span style="color: #a61390;">return</span> cell;
<span style="color: #002200;">&#125;</span>
<span style="color: #6e371a;">#ifndef __IPHONE_3_0</span>
<span style="color: #002200;">-</span> <span style="color: #002200;">&#40;</span>UITableViewCellAccessoryType<span style="color: #002200;">&#41;</span>tableView<span style="color: #002200;">:</span><span style="color: #002200;">&#40;</span>UITableView <span style="color: #002200;">*</span><span style="color: #002200;">&#41;</span>tableView accessoryTypeForRowWithIndexPath<span style="color: #002200;">:</span><span style="color: #002200;">&#40;</span><a href="http://developer.apple.com/documentation/Cocoa/Reference/Foundation/Classes/NSIndexPath_Class/"><span style="color: #400080;">NSIndexPath</span></a> <span style="color: #002200;">*</span><span style="color: #002200;">&#41;</span>indexPath <span style="color: #002200;">&#123;</span>
	<span style="color: #a61390;">return</span> UITableViewCellAccessoryDisclosureIndicator;
<span style="color: #002200;">&#125;</span>
<span style="color: #6e371a;">#endif</span></pre></td></tr></table></div>

]]></content:encoded>
			<wfw:commentRss>http://www.chrisdanielson.com/2009/08/02/upgrading-your-iphone-os-2-0-application-to-3-0-and-deprecation-warnings/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>

