<?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: iPhone: how to create a transparent table header</title>
	<atom:link href="http://blog.jameshiggs.com/2009/03/01/transparent-table-header-uitableview/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.jameshiggs.com/2009/03/01/transparent-table-header-uitableview/</link>
	<description>James Higgs&#039;s Blog</description>
	<lastBuildDate>Tue, 31 Jan 2012 08:53:17 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
	<item>
		<title>By: Billy</title>
		<link>http://blog.jameshiggs.com/2009/03/01/transparent-table-header-uitableview/comment-page-1/#comment-8882</link>
		<dc:creator>Billy</dc:creator>
		<pubDate>Fri, 04 Dec 2009 11:09:33 +0000</pubDate>
		<guid isPermaLink="false">http://blog.jameshiggs.com/?p=176#comment-8882</guid>
		<description>I agree with win it would be easier to create the view in a NIB and connect it to ContactStyleeViewController.

Also, just to point out that your method (as is) wouldn&#039;t work out with a table with multiple sections. You&#039;d have to change viewForHeaderInSection to this

	if (section == 0)
		return [[appDelegate headerViewController] view];
	else
		return nil;


The better way to do it would be to just do the following on viewDidLoad 
self.tableView.tableHeaderView = headerViewfromNIB;

My 2cents</description>
		<content:encoded><![CDATA[<p>I agree with win it would be easier to create the view in a NIB and connect it to ContactStyleeViewController.</p>
<p>Also, just to point out that your method (as is) wouldn&#8217;t work out with a table with multiple sections. You&#8217;d have to change viewForHeaderInSection to this</p>
<p>	if (section == 0)<br />
		return [[appDelegate headerViewController] view];<br />
	else<br />
		return nil;</p>
<p>The better way to do it would be to just do the following on viewDidLoad<br />
self.tableView.tableHeaderView = headerViewfromNIB;</p>
<p>My 2cents</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jason McCreary</title>
		<link>http://blog.jameshiggs.com/2009/03/01/transparent-table-header-uitableview/comment-page-1/#comment-5541</link>
		<dc:creator>Jason McCreary</dc:creator>
		<pubDate>Wed, 28 Oct 2009 01:09:47 +0000</pubDate>
		<guid isPermaLink="false">http://blog.jameshiggs.com/?p=176#comment-5541</guid>
		<description>Nice article. I was looking to create something similar. Although I agree with what you have and the implementation, I feel like the contact app may indeed use a custom cell for this top section. The main reason for this belief is when you tap the edit button.

I would appreciate any comments you could make on updating the UI to support this edit behavior.</description>
		<content:encoded><![CDATA[<p>Nice article. I was looking to create something similar. Although I agree with what you have and the implementation, I feel like the contact app may indeed use a custom cell for this top section. The main reason for this belief is when you tap the edit button.</p>
<p>I would appreciate any comments you could make on updating the UI to support this edit behavior.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Win</title>
		<link>http://blog.jameshiggs.com/2009/03/01/transparent-table-header-uitableview/comment-page-1/#comment-3297</link>
		<dc:creator>Win</dc:creator>
		<pubDate>Tue, 14 Jul 2009 23:23:13 +0000</pubDate>
		<guid isPermaLink="false">http://blog.jameshiggs.com/?p=176#comment-3297</guid>
		<description>Thanks for the great post!  Though, wouldn&#039;t it be easier just to create the view in a NIB and connect it to ContactStyleeViewController and return that view for the viewHeaderForSection method? Maybe something like:

@interface ContactStyleeViewController : UITableViewController  {
  IBOutlet UIView *headerView;
}

That way you wouldn&#039;t have to use the delegate method and a separate controller just to get access to the header view?

Just a thought.  I may be way off-base.</description>
		<content:encoded><![CDATA[<p>Thanks for the great post!  Though, wouldn&#8217;t it be easier just to create the view in a NIB and connect it to ContactStyleeViewController and return that view for the viewHeaderForSection method? Maybe something like:</p>
<p>@interface ContactStyleeViewController : UITableViewController  {<br />
  IBOutlet UIView *headerView;<br />
}</p>
<p>That way you wouldn&#8217;t have to use the delegate method and a separate controller just to get access to the header view?</p>
<p>Just a thought.  I may be way off-base.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: higgis</title>
		<link>http://blog.jameshiggs.com/2009/03/01/transparent-table-header-uitableview/comment-page-1/#comment-2448</link>
		<dc:creator>higgis</dc:creator>
		<pubDate>Fri, 03 Apr 2009 09:32:45 +0000</pubDate>
		<guid isPermaLink="false">http://blog.jameshiggs.com/?p=176#comment-2448</guid>
		<description>Hi Chuck,

You need to be doing this from a higher level in the view hierarchy, I think. Here&#039;s what I do. On my application delegate class, I declare a method that gets called from the table delegate&#039;s &lt;code&gt;didSelectRowAtIndexPath:&lt;/code&gt; method. Here&#039;s the app delegate method:

&lt;pre&gt;- (void)thingWasSelected:(NSString *)thingName {
   [navController pushViewController:self.newViewController animated:YES];
}&lt;/pre&gt;

And here&#039;s the UITableViewDelegate method (note the cast to our concrete app delegate class):

&lt;pre&gt;- (void)tableView:(UITableView *)tableView 
       didSelectRowAtIndexPath:(NSIndexPath *)indexPath {

   [((MyAppDelegate *)[[UIApplication sharedApplication] delegate]) 
     thingWasSelected:[self.dataSource objectAtIndex:indexPath.row]];
}&lt;/pre&gt;

We could add a category to &lt;code&gt;UIApplication&lt;/code&gt; to return our concrete with a header file like this:

&lt;pre&gt;// UIApplication+MyAppDelegate.h
// forward declaration
@class MyAppDelegate;

@interface UIApplication (MyAppDelegate) 
- (MyAppDelegate *)concreteDelegate;
@end&lt;/pre&gt;

And here&#039;s the implementation file:

&lt;pre&gt;// UIApplication+MyAppDelegate.m
#import &quot;UIApplication+MyAppDelegate.h&quot;
#import &quot;MyAppDelegate.h&quot;

@implementation UIApplication (UIAppDelegate)

- (MyAppDelegate *)concreteDelegate {
   return (MyAppDelegate *)self;
}

@end&lt;/pre&gt;

Then you just need to &lt;code&gt;#import UIApplication+MyAppDelegate.h&lt;/code&gt; into the appropriate file and instead of the cast, do this:

&lt;code&gt;[[UIApplication sharedApplication] concreteDelegate];&lt;/code&gt;

(I&#039;ve written most of this code away from XCode, so please be on the lookout for typos!)

Hope that helps.

Cheers,
James</description>
		<content:encoded><![CDATA[<p>Hi Chuck,</p>
<p>You need to be doing this from a higher level in the view hierarchy, I think. Here&#8217;s what I do. On my application delegate class, I declare a method that gets called from the table delegate&#8217;s <code>didSelectRowAtIndexPath:</code> method. Here&#8217;s the app delegate method:</p>
<pre>- (void)thingWasSelected:(NSString *)thingName {
   [navController pushViewController:self.newViewController animated:YES];
}</pre>
<p>And here&#8217;s the UITableViewDelegate method (note the cast to our concrete app delegate class):</p>
<pre>- (void)tableView:(UITableView *)tableView
       didSelectRowAtIndexPath:(NSIndexPath *)indexPath {

   [((MyAppDelegate *)[[UIApplication sharedApplication] delegate])
     thingWasSelected:[self.dataSource objectAtIndex:indexPath.row]];
}</pre>
<p>We could add a category to <code>UIApplication</code> to return our concrete with a header file like this:</p>
<pre>// UIApplication+MyAppDelegate.h
// forward declaration
@class MyAppDelegate;

@interface UIApplication (MyAppDelegate)
- (MyAppDelegate *)concreteDelegate;
@end</pre>
<p>And here&#8217;s the implementation file:</p>
<pre>// UIApplication+MyAppDelegate.m
#import "UIApplication+MyAppDelegate.h"
#import "MyAppDelegate.h"

@implementation UIApplication (UIAppDelegate)

- (MyAppDelegate *)concreteDelegate {
   return (MyAppDelegate *)self;
}

@end</pre>
<p>Then you just need to <code>#import UIApplication+MyAppDelegate.h</code> into the appropriate file and instead of the cast, do this:</p>
<p><code>[[UIApplication sharedApplication] concreteDelegate];</code></p>
<p>(I&#8217;ve written most of this code away from XCode, so please be on the lookout for typos!)</p>
<p>Hope that helps.</p>
<p>Cheers,<br />
James</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Chuck</title>
		<link>http://blog.jameshiggs.com/2009/03/01/transparent-table-header-uitableview/comment-page-1/#comment-2446</link>
		<dc:creator>Chuck</dc:creator>
		<pubDate>Fri, 03 Apr 2009 00:40:22 +0000</pubDate>
		<guid isPermaLink="false">http://blog.jameshiggs.com/?p=176#comment-2446</guid>
		<description>How would I go about pushing another view after clicking on a table row, when setup like this?

I&#039;ve tried: &quot;[self.navigationController pushViewController:newViewController ];&quot;

But it doesn&#039;t work.</description>
		<content:encoded><![CDATA[<p>How would I go about pushing another view after clicking on a table row, when setup like this?</p>
<p>I&#8217;ve tried: &#8220;[self.navigationController pushViewController:newViewController ];&#8221;</p>
<p>But it doesn&#8217;t work.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Nir</title>
		<link>http://blog.jameshiggs.com/2009/03/01/transparent-table-header-uitableview/comment-page-1/#comment-2390</link>
		<dc:creator>Nir</dc:creator>
		<pubDate>Mon, 02 Mar 2009 16:43:35 +0000</pubDate>
		<guid isPermaLink="false">http://blog.jameshiggs.com/?p=176#comment-2390</guid>
		<description>Amazing - solved all my problems !!</description>
		<content:encoded><![CDATA[<p>Amazing &#8211; solved all my problems !!</p>
]]></content:encoded>
	</item>
</channel>
</rss>

