<?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 Tutorial &#8211; UISearchDisplayController with NSPredicate</title>
	<atom:link href="http://blog.mugunthkumar.com/coding/iphone-tutorial-uisearchdisplaycontroller-with-nspredicate/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.mugunthkumar.com/coding/iphone-tutorial-uisearchdisplaycontroller-with-nspredicate/</link>
	<description>iPhone, iPad, Windows Phone Development and Usability Guidelines</description>
	<lastBuildDate>Tue, 07 Feb 2012 00:53:00 +0800</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
	<item>
		<title>By: antucks</title>
		<link>http://blog.mugunthkumar.com/coding/iphone-tutorial-uisearchdisplaycontroller-with-nspredicate/comment-page-1/#comment-3176</link>
		<dc:creator>antucks</dc:creator>
		<pubDate>Fri, 30 Dec 2011 19:28:00 +0000</pubDate>
		<guid isPermaLink="false">http://blog.mugunthkumar.com/?p=549#comment-3176</guid>
		<description>Mugunth, thank you for introducing me the NSPredicate, yes powerful and easy to use - you just don&#039;t know how much it helped my app!
</description>
		<content:encoded><![CDATA[<p>Mugunth, thank you for introducing me the NSPredicate, yes powerful and easy to use &#8211; you just don&#8217;t know how much it helped my app!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: kamlesh gk</title>
		<link>http://blog.mugunthkumar.com/coding/iphone-tutorial-uisearchdisplaycontroller-with-nspredicate/comment-page-1/#comment-2895</link>
		<dc:creator>kamlesh gk</dc:creator>
		<pubDate>Thu, 28 Jul 2011 07:51:00 +0000</pubDate>
		<guid isPermaLink="false">http://blog.mugunthkumar.com/?p=549#comment-2895</guid>
		<description>wonderful blog....thanx...
Also Jonathan Saggau - ur comments are much appreciated...

the final code in the filterContentForSearchText 





	[self.filteredstaffList removeAllObjects]; // First clear the filtered array.
	
	NSPredicate *predicate = nil;
	if([scope isEqualToString:@&quot;Staff Code&quot;])
	{
		predicate = [NSPredicate predicateWithFormat:@&quot;(SELF.staffCode contains[cd] %@)&quot;, searchText]; 	
	}
	if([scope isEqualToString:@&quot;Staff FullName&quot;])
	{
		predicate = [NSPredicate predicateWithFormat:@&quot;(SELF.staffFullName contains[cd] %@)&quot;, searchText]; 
	}
	
	NSArray *array = [staffList filteredArrayUsingPredicate:predicate];
	self.filteredstaffList = [NSMutableArray arrayWithArray: array];</description>
		<content:encoded><![CDATA[<p>wonderful blog&#8230;.thanx&#8230;<br />
Also Jonathan Saggau - ur comments are much appreciated&#8230;</p>
<p>the final code in the filterContentForSearchText </p>
<p>	[self.filteredstaffList removeAllObjects]; // First clear the filtered array.</p>
<p>	NSPredicate *predicate = nil;<br />
	if([scope isEqualToString:@"Staff Code"])<br />
	{<br />
		predicate = [NSPredicate predicateWithFormat:@"(SELF.staffCode contains[cd] %@)&#8221;, searchText]; <br />
	}<br />
	if([scope isEqualToString:@"Staff FullName"])<br />
	{<br />
		predicate = [NSPredicate predicateWithFormat:@"(SELF.staffFullName contains[cd] %@)&#8221;, searchText]; <br />
	}</p>
<p>	NSArray *array = [staffList filteredArrayUsingPredicate:predicate];<br />
	self.filteredstaffList = [NSMutableArray arrayWithArray: array];</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Anonymous</title>
		<link>http://blog.mugunthkumar.com/coding/iphone-tutorial-uisearchdisplaycontroller-with-nspredicate/comment-page-1/#comment-2741</link>
		<dc:creator>Anonymous</dc:creator>
		<pubDate>Thu, 24 Feb 2011 15:13:00 +0000</pubDate>
		<guid isPermaLink="false">http://blog.mugunthkumar.com/?p=549#comment-2741</guid>
		<description>Thank you! This is the information I&#039;m looking for. Great work!</description>
		<content:encoded><![CDATA[<p>Thank you! This is the information I&#8217;m looking for. Great work!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: olof</title>
		<link>http://blog.mugunthkumar.com/coding/iphone-tutorial-uisearchdisplaycontroller-with-nspredicate/comment-page-1/#comment-1036</link>
		<dc:creator>olof</dc:creator>
		<pubDate>Thu, 18 Mar 2010 16:41:27 +0000</pubDate>
		<guid isPermaLink="false">http://blog.mugunthkumar.com/?p=549#comment-1036</guid>
		<description>I dont understand the line: 
 
[product.productID compare:searchText options:NSCaseInsensitiveSearch]; 
 
What does that line do? </description>
		<content:encoded><![CDATA[<p>I dont understand the line: </p>
<p>[product.productID compare:searchText options:NSCaseInsensitiveSearch]; </p>
<p>What does that line do?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jonathan Saggau</title>
		<link>http://blog.mugunthkumar.com/coding/iphone-tutorial-uisearchdisplaycontroller-with-nspredicate/comment-page-1/#comment-940</link>
		<dc:creator>Jonathan Saggau</dc:creator>
		<pubDate>Sat, 13 Feb 2010 00:48:33 +0000</pubDate>
		<guid isPermaLink="false">http://blog.mugunthkumar.com/?p=549#comment-940</guid>
		<description>There are a few little details that would make this better. 
Look at -[NSArray filteredArrayUsingPredicate:(NSPredicate *)predicate] and you won&#039;t need that loop.  In any case, there is no need to make a new predicate identical to the last one each time through that loop.  You should probably put it outside of the loop. 
 
I also suggest that you consider modifying the predicate you are filtering with, rather than filtering using the if([scope isEqualToString...] bits.  For example: 
 
if([scope isEqualToString:@&quot;Product ID&quot;]) { 
    predicate = [NSPredicate predicateWithFormat:@&quot;(SELF.productID contains[cd] %@)&quot;, searchText]; 
} 
 
then the filtered array is just: 
 
[tableData filteredArrayUsingPredicate:predicate] 
 
so you won&#039;t need a loop. 
 
You can even drop an AND or an OR into your predicate or just use NSCompoundPredicate&#039;s various class methods to make your filter more dynamic. 
 
See Apple&#039;s Predicate Programming Guide for more details </description>
		<content:encoded><![CDATA[<p>There are a few little details that would make this better.<br />
Look at -[NSArray filteredArrayUsingPredicate:(NSPredicate *)predicate] and you won&#039;t need that loop.  In any case, there is no need to make a new predicate identical to the last one each time through that loop.  You should probably put it outside of the loop. </p>
<p>I also suggest that you consider modifying the predicate you are filtering with, rather than filtering using the if([scope isEqualToString...] bits.  For example: </p>
<p>if([scope isEqualToString:@&quot;Product ID&quot;]) {<br />
    predicate = [NSPredicate predicateWithFormat:@&quot;(SELF.productID contains[cd] %@)&quot;, searchText];<br />
} </p>
<p>then the filtered array is just: </p>
<p>[tableData filteredArrayUsingPredicate:predicate] </p>
<p>so you won&#039;t need a loop. </p>
<p>You can even drop an AND or an OR into your predicate or just use NSCompoundPredicate&#039;s various class methods to make your filter more dynamic. </p>
<p>See Apple&#039;s Predicate Programming Guide for more details</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: mugunthkumar</title>
		<link>http://blog.mugunthkumar.com/coding/iphone-tutorial-uisearchdisplaycontroller-with-nspredicate/comment-page-1/#comment-477</link>
		<dc:creator>mugunthkumar</dc:creator>
		<pubDate>Tue, 17 Nov 2009 09:25:38 +0000</pubDate>
		<guid isPermaLink="false">http://blog.mugunthkumar.com/?p=549#comment-477</guid>
		<description>try it now... I&#039;m sorry.  </description>
		<content:encoded><![CDATA[<p>try it now&#8230; I&#039;m sorry.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Ted</title>
		<link>http://blog.mugunthkumar.com/coding/iphone-tutorial-uisearchdisplaycontroller-with-nspredicate/comment-page-1/#comment-461</link>
		<dc:creator>Ted</dc:creator>
		<pubDate>Mon, 16 Nov 2009 14:24:54 +0000</pubDate>
		<guid isPermaLink="false">http://blog.mugunthkumar.com/?p=549#comment-461</guid>
		<description>There are 8 ads in that short block of code :( </description>
		<content:encoded><![CDATA[<p>There are 8 ads in that short block of code <img src='http://blog.mugunthkumar.com/wp-includes/images/smilies/icon_sad.gif' alt=':(' class='wp-smiley' /> </p>
]]></content:encoded>
	</item>
</channel>
</rss>

<!-- Performance optimized by W3 Total Cache. Learn more: http://www.w3-edge.com/wordpress-plugins/

Minified using disk: basic
Page Caching using disk: enhanced

Served from: blog.mugunthkumar.com @ 2012-02-07 21:15:13 -->
