<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	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/"
		>
<channel>
	<title>Comments on: Custom UITableViewCell from a XIB in Interface Builder</title>
	<atom:link href="http://www.bdunagan.com/2009/06/28/custom-uitableviewcell-from-a-xib-in-interface-builder/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.bdunagan.com/2009/06/28/custom-uitableviewcell-from-a-xib-in-interface-builder/</link>
	<description></description>
	<lastBuildDate>Mon, 06 Sep 2010 01:13:11 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
	<item>
		<title>By: Elliot Babchick</title>
		<link>http://www.bdunagan.com/2009/06/28/custom-uitableviewcell-from-a-xib-in-interface-builder/comment-page-1/#comment-6008</link>
		<dc:creator>Elliot Babchick</dc:creator>
		<pubDate>Mon, 23 Aug 2010 04:16:52 +0000</pubDate>
		<guid isPermaLink="false">http://www.bdunagan.com/?p=293#comment-6008</guid>
		<description>@Andrew @Urs @bdunagan

Found the problem. In the code you provide in the post you have this little booger:

UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:@&quot;BDCustomCell&quot;];

Change &quot;UITableViewCell&quot; to your custom cell class and cast it appropriately or do something to that effect so XCode understands those custom structures. Cheers.</description>
		<content:encoded><![CDATA[<p>@Andrew @Urs @bdunagan</p>
<p>Found the problem. In the code you provide in the post you have this little booger:</p>
<p>UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:@"BDCustomCell"];</p>
<p>Change &#8220;UITableViewCell&#8221; to your custom cell class and cast it appropriately or do something to that effect so XCode understands those custom structures. Cheers.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Andrew</title>
		<link>http://www.bdunagan.com/2009/06/28/custom-uitableviewcell-from-a-xib-in-interface-builder/comment-page-1/#comment-5642</link>
		<dc:creator>Andrew</dc:creator>
		<pubDate>Wed, 14 Jul 2010 15:51:40 +0000</pubDate>
		<guid isPermaLink="false">http://www.bdunagan.com/?p=293#comment-5642</guid>
		<description>@Urs @bdunagan

So, I came back to this page for my second project to use this.  After reading your comments, I realize that I had the same problem too.  When I use the deprecated setText: method, the program runs with a warning.  However, using the cell.labelname.text format, I get the error about labelname not being part of a structure or union.

My guess here is that &quot;cell&quot; is not what we think it is, although I can&#039;t figure out how.  My XIB&#039;s File Owner is set to UIViewController, and the cell view is set to the custom class.  All IBOutlets are connected properly as far as I can tell.  The view for the File&#039;s Owner is also set to the UITableViewCell.

There seems to be a missing link somewhere which I just can&#039;t see, and that the online material I&#039;m searching also doesn&#039;t have an explanation for.  I&#039;ll keep looking and if I find something I&#039;ll post it.</description>
		<content:encoded><![CDATA[<p>@Urs @bdunagan</p>
<p>So, I came back to this page for my second project to use this.  After reading your comments, I realize that I had the same problem too.  When I use the deprecated setText: method, the program runs with a warning.  However, using the cell.labelname.text format, I get the error about labelname not being part of a structure or union.</p>
<p>My guess here is that &#8220;cell&#8221; is not what we think it is, although I can&#8217;t figure out how.  My XIB&#8217;s File Owner is set to UIViewController, and the cell view is set to the custom class.  All IBOutlets are connected properly as far as I can tell.  The view for the File&#8217;s Owner is also set to the UITableViewCell.</p>
<p>There seems to be a missing link somewhere which I just can&#8217;t see, and that the online material I&#8217;m searching also doesn&#8217;t have an explanation for.  I&#8217;ll keep looking and if I find something I&#8217;ll post it.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: bdunagan</title>
		<link>http://www.bdunagan.com/2009/06/28/custom-uitableviewcell-from-a-xib-in-interface-builder/comment-page-1/#comment-5635</link>
		<dc:creator>bdunagan</dc:creator>
		<pubDate>Tue, 13 Jul 2010 05:31:49 +0000</pubDate>
		<guid isPermaLink="false">http://www.bdunagan.com/?p=293#comment-5635</guid>
		<description>@Urs Be sure that you declare accessors for &#039;label&#039; in the custom cell, either via @property/@synthesize or the manual method, &quot;- (UILabel *)label;&quot;. Hope that helps!</description>
		<content:encoded><![CDATA[<p>@Urs Be sure that you declare accessors for &#8216;label&#8217; in the custom cell, either via @property/@synthesize or the manual method, &#8220;- (UILabel *)label;&#8221;. Hope that helps!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Urs</title>
		<link>http://www.bdunagan.com/2009/06/28/custom-uitableviewcell-from-a-xib-in-interface-builder/comment-page-1/#comment-5633</link>
		<dc:creator>Urs</dc:creator>
		<pubDate>Tue, 13 Jul 2010 00:49:37 +0000</pubDate>
		<guid isPermaLink="false">http://www.bdunagan.com/?p=293#comment-5633</guid>
		<description>I&#039;m trying to get this to work - but when I try to access the IBOutlets I set, I get an error saying that it&#039;s not a structure...

I user the first (View based) approach. Once I get the pointer to the cell, I try to access its outlets by using 

cell.label.text = @&quot;test&quot;;

Where «label» is one of the outlets...

Everything is set up as you describe and it&#039;s perfectly working up to the issue with the outlets...

Any idea?</description>
		<content:encoded><![CDATA[<p>I&#8217;m trying to get this to work &#8211; but when I try to access the IBOutlets I set, I get an error saying that it&#8217;s not a structure&#8230;</p>
<p>I user the first (View based) approach. Once I get the pointer to the cell, I try to access its outlets by using </p>
<p>cell.label.text = @&#8221;test&#8221;;</p>
<p>Where «label» is one of the outlets&#8230;</p>
<p>Everything is set up as you describe and it&#8217;s perfectly working up to the issue with the outlets&#8230;</p>
<p>Any idea?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Andrew</title>
		<link>http://www.bdunagan.com/2009/06/28/custom-uitableviewcell-from-a-xib-in-interface-builder/comment-page-1/#comment-5590</link>
		<dc:creator>Andrew</dc:creator>
		<pubDate>Mon, 05 Jul 2010 23:53:32 +0000</pubDate>
		<guid isPermaLink="false">http://www.bdunagan.com/?p=293#comment-5590</guid>
		<description>Wow, there are some other suggestions on how to make this happen, but this one is the simplest and works well.  Not sure if using the UIViewController is the standard method but it sure seems to work well.  I was pretty frustrated with this, but 5 minutes after reading this example, everything came together.

Thanks for the tutorial.  It&#039;s still helping out a year after being written!</description>
		<content:encoded><![CDATA[<p>Wow, there are some other suggestions on how to make this happen, but this one is the simplest and works well.  Not sure if using the UIViewController is the standard method but it sure seems to work well.  I was pretty frustrated with this, but 5 minutes after reading this example, everything came together.</p>
<p>Thanks for the tutorial.  It&#8217;s still helping out a year after being written!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Mahboud</title>
		<link>http://www.bdunagan.com/2009/06/28/custom-uitableviewcell-from-a-xib-in-interface-builder/comment-page-1/#comment-2862</link>
		<dc:creator>Mahboud</dc:creator>
		<pubDate>Mon, 23 Nov 2009 02:32:40 +0000</pubDate>
		<guid isPermaLink="false">http://www.bdunagan.com/?p=293#comment-2862</guid>
		<description>Or you can instantiate this way (using an IBOutlet):

    HighScoresTableCell *cell = (HighScoresTableCell *) [tableView dequeueReusableCellWithIdentifier:CellIdentifier];
    if (cell == nil) {		
		// refresh the outlet
		[[NSBundle mainBundle] loadNibNamed:@&quot;HighScoresTableCell&quot; owner:self options:nil];
		cell = highScoresTableCell; // get the object from the outlet
		highScoresTableCell = nil; // make sure this can&#039;t be re-used accidentally
	}
    
    // Set up the cell...</description>
		<content:encoded><![CDATA[<p>Or you can instantiate this way (using an IBOutlet):</p>
<p>    HighScoresTableCell *cell = (HighScoresTableCell *) [tableView dequeueReusableCellWithIdentifier:CellIdentifier];<br />
    if (cell == nil) {<br />
		// refresh the outlet<br />
		[[NSBundle mainBundle] loadNibNamed:@&#8221;HighScoresTableCell&#8221; owner:self options:nil];<br />
		cell = highScoresTableCell; // get the object from the outlet<br />
		highScoresTableCell = nil; // make sure this can&#8217;t be re-used accidentally<br />
	}</p>
<p>    // Set up the cell&#8230;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: bdunagan</title>
		<link>http://www.bdunagan.com/2009/06/28/custom-uitableviewcell-from-a-xib-in-interface-builder/comment-page-1/#comment-2370</link>
		<dc:creator>bdunagan</dc:creator>
		<pubDate>Sat, 08 Aug 2009 05:20:09 +0000</pubDate>
		<guid isPermaLink="false">http://www.bdunagan.com/?p=293#comment-2370</guid>
		<description>Great! Glad it worked for you. It&#039;s true that it doesn&#039;t reuse the cells until an existing one goes off the screen and a new one is needed. That confused me at first as well. And thanks for the link; much more detail in that post.</description>
		<content:encoded><![CDATA[<p>Great! Glad it worked for you. It&#8217;s true that it doesn&#8217;t reuse the cells until an existing one goes off the screen and a new one is needed. That confused me at first as well. And thanks for the link; much more detail in that post.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: haiku</title>
		<link>http://www.bdunagan.com/2009/06/28/custom-uitableviewcell-from-a-xib-in-interface-builder/comment-page-1/#comment-2361</link>
		<dc:creator>haiku</dc:creator>
		<pubDate>Fri, 07 Aug 2009 04:02:17 +0000</pubDate>
		<guid isPermaLink="false">http://www.bdunagan.com/?p=293#comment-2361</guid>
		<description>hmm. tried to put a link in that last post:  &quot;http://humblecoder.blogspot.com/2009/05/iphone-tutorial-creating-table-cells-in.html&quot;  perhaps?</description>
		<content:encoded><![CDATA[<p>hmm. tried to put a link in that last post:  &#8220;http://humblecoder.blogspot.com/2009/05/iphone-tutorial-creating-table-cells-in.html&#8221;  perhaps?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: haiku</title>
		<link>http://www.bdunagan.com/2009/06/28/custom-uitableviewcell-from-a-xib-in-interface-builder/comment-page-1/#comment-2360</link>
		<dc:creator>haiku</dc:creator>
		<pubDate>Fri, 07 Aug 2009 04:01:48 +0000</pubDate>
		<guid isPermaLink="false">http://www.bdunagan.com/?p=293#comment-2360</guid>
		<description>Ah!   indicates that there is no re-use until there is one for every visible row in the table!  very good.</description>
		<content:encoded><![CDATA[<p>Ah!   indicates that there is no re-use until there is one for every visible row in the table!  very good.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: haiku</title>
		<link>http://www.bdunagan.com/2009/06/28/custom-uitableviewcell-from-a-xib-in-interface-builder/comment-page-1/#comment-2359</link>
		<dc:creator>haiku</dc:creator>
		<pubDate>Fri, 07 Aug 2009 03:55:18 +0000</pubDate>
		<guid isPermaLink="false">http://www.bdunagan.com/?p=293#comment-2359</guid>
		<description>I think that if you set a breakpoint you will find that your cell is not actually being reused in either case.  At least they do not seem to be in the tests I&#039;ve done.  Most sample code that is doing this on the net is reloading the cell from the nib/xib file every time because the dequeue cell command is failing even though the cell has a reuseIdentifier (which is supposed to trigger it to be reused).  They are not getting added to the _reusableTableCells dictionary in the table view for some reason.

If you can confirm that your solution doesn&#039;t have this problem, I&#039;d be interested to hear that.</description>
		<content:encoded><![CDATA[<p>I think that if you set a breakpoint you will find that your cell is not actually being reused in either case.  At least they do not seem to be in the tests I&#8217;ve done.  Most sample code that is doing this on the net is reloading the cell from the nib/xib file every time because the dequeue cell command is failing even though the cell has a reuseIdentifier (which is supposed to trigger it to be reused).  They are not getting added to the _reusableTableCells dictionary in the table view for some reason.</p>
<p>If you can confirm that your solution doesn&#8217;t have this problem, I&#8217;d be interested to hear that.</p>
]]></content:encoded>
	</item>
</channel>
</rss>
