<?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: Core Data Tutorial: How To Use NSFetchedResultsController</title>
	<atom:link href="http://www.raywenderlich.com/999/core-data-tutorial-how-to-use-nsfetchedresultscontroller/feed" rel="self" type="application/rss+xml" />
	<link>http://www.raywenderlich.com/999/core-data-tutorial-how-to-use-nsfetchedresultscontroller</link>
	<description>Tutorials for iPhone / iOS Developers and Gamers</description>
	<lastBuildDate>Sun, 29 Jan 2012 06:07:20 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.1.2</generator>
	<item>
		<title>By: MaKo</title>
		<link>http://www.raywenderlich.com/999/core-data-tutorial-how-to-use-nsfetchedresultscontroller#comment-8147</link>
		<dc:creator>MaKo</dc:creator>
		<pubDate>Wed, 22 Dec 2010 04:21:30 +0000</pubDate>
		<guid isPermaLink="false">http://www.raywenderlich.com/?p=999#comment-8147</guid>
		<description>Hi Ray
thanks so much for your tutorials bro (very enlightening!)

One question, request plz
Im porting the same example to a ipad app, but with a UIViewController instead of a UITableViewController,
to have a little table not for the whole screen

but I get this error&gt;
&quot;Request for member &#039;tableView&#039; in something not a structure or union

here is my project
http://hyperprogram.com/banksCD.zip

is the same I think for the one you show us how to make but with the ipad in mind, I have searched a lot in google how to fix it to no avail 
plz help man,
also check the project and I&#039;ll leave it for other people if you want,

thank you so much!</description>
		<content:encoded><![CDATA[<p>Hi Ray<br />
thanks so much for your tutorials bro (very enlightening!)</p>
<p>One question, request plz<br />
Im porting the same example to a ipad app, but with a UIViewController instead of a UITableViewController,<br />
to have a little table not for the whole screen</p>
<p>but I get this error&gt;<br />
&#8220;Request for member &#8216;tableView&#8217; in something not a structure or union</p>
<p>here is my project<br />
<a href="http://hyperprogram.com/banksCD.zip" rel="nofollow">http://hyperprogram.com/banksCD.zip</a></p>
<p>is the same I think for the one you show us how to make but with the ipad in mind, I have searched a lot in google how to fix it to no avail<br />
plz help man,<br />
also check the project and I&#8217;ll leave it for other people if you want,</p>
<p>thank you so much!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: ZaldzBugz</title>
		<link>http://www.raywenderlich.com/999/core-data-tutorial-how-to-use-nsfetchedresultscontroller#comment-7947</link>
		<dc:creator>ZaldzBugz</dc:creator>
		<pubDate>Fri, 17 Dec 2010 08:22:03 +0000</pubDate>
		<guid isPermaLink="false">http://www.raywenderlich.com/?p=999#comment-7947</guid>
		<description>hi Ray, I&#039;ve been working with CoreData lately and i found that when i set numberOfSectionsInTableView to return 2 for example. The app will crash with the error -&gt;&gt;&gt;&gt;&gt; [NSMutableArray objectAtIndex:]: index 1 beyond bounds [0 .. 0]&#039; &lt;&lt;&lt;&lt;-----

Can you teach me how to work with number of sections in CoreData.

Was planning to work with coredata together with indexes for searching.

Thanks for your help Ray.</description>
		<content:encoded><![CDATA[<p>hi Ray, I&#8217;ve been working with CoreData lately and i found that when i set numberOfSectionsInTableView to return 2 for example. The app will crash with the error -&gt;&gt;&gt;&gt;&gt; [NSMutableArray objectAtIndex:]: index 1 beyond bounds [0 .. 0]&#8216; &lt;&lt;&lt;&lt;&#8212;&#8211;</p>
<p>Can you teach me how to work with number of sections in CoreData.</p>
<p>Was planning to work with coredata together with indexes for searching.</p>
<p>Thanks for your help Ray.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jean-Marc</title>
		<link>http://www.raywenderlich.com/999/core-data-tutorial-how-to-use-nsfetchedresultscontroller#comment-7755</link>
		<dc:creator>Jean-Marc</dc:creator>
		<pubDate>Tue, 14 Dec 2010 22:44:42 +0000</pubDate>
		<guid isPermaLink="false">http://www.raywenderlich.com/?p=999#comment-7755</guid>
		<description>Ray,
I didn&#039;t do exactly what you proposed (the predicate is defined in fetchedResultsController, not in viewWillAppear), but your answer led me to the solution:&quot; _fetchedResultsController=nil;&quot; before re-fetching (in viewWillAppear).
Thank you very much for your help.</description>
		<content:encoded><![CDATA[<p>Ray,<br />
I didn&#8217;t do exactly what you proposed (the predicate is defined in fetchedResultsController, not in viewWillAppear), but your answer led me to the solution:&#8221; _fetchedResultsController=nil;&#8221; before re-fetching (in viewWillAppear).<br />
Thank you very much for your help.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Ray Wenderlich</title>
		<link>http://www.raywenderlich.com/999/core-data-tutorial-how-to-use-nsfetchedresultscontroller#comment-7651</link>
		<dc:creator>Ray Wenderlich</dc:creator>
		<pubDate>Tue, 14 Dec 2010 01:23:38 +0000</pubDate>
		<guid isPermaLink="false">http://www.raywenderlich.com/?p=999#comment-7651</guid>
		<description>@Luca: Yes, Core Data is usually best for this kind of thing, it just requires a bit of learning curve at start.  

@AD: Thanks for helping out Luca!  :]

@Jaho: Thanks!  :]

@Jean-Marc: In your viewWillAppear, update the fetchRequest&#039;s predicate, then call performFetch to re-fetch what you want to see.</description>
		<content:encoded><![CDATA[<p>@Luca: Yes, Core Data is usually best for this kind of thing, it just requires a bit of learning curve at start.  </p>
<p>@AD: Thanks for helping out Luca!  :]</p>
<p>@Jaho: Thanks!  :]</p>
<p>@Jean-Marc: In your viewWillAppear, update the fetchRequest&#8217;s predicate, then call performFetch to re-fetch what you want to see.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jean-Marc</title>
		<link>http://www.raywenderlich.com/999/core-data-tutorial-how-to-use-nsfetchedresultscontroller#comment-7532</link>
		<dc:creator>Jean-Marc</dc:creator>
		<pubDate>Sun, 12 Dec 2010 13:18:31 +0000</pubDate>
		<guid isPermaLink="false">http://www.raywenderlich.com/?p=999#comment-7532</guid>
		<description>Hi Ray,
I am struggling since weeks with an issue related to fetchedResultsController. Reading this thread, looks like you may be able to help me.

Below a &quot;summary&quot;, simplified, version of my code.
 
I manage in CoreData a simple hierarchy.&quot;CardSet&quot; is the master table &quot;Card&quot; is the child.
 
This code works find for the first selection (whichever &quot;cardSet&quot; is selected, the right &quot;childs&quot; cards are displayed).
But for any further selection, whichever &quot;cardSet&quot; is selected, the same &quot;childs&quot; are always displayed.
Looks like, in the fetchedResultsController method, aside from the 1st time, the only code executed is: &quot;if (_fetchedResultsController != nil) return _fetchedResultsController;&quot;, hence giving always the same result. I think I have an issue with &quot;resetting&quot; the fetchedResultsController.

Thank you very much for your time.
---------------------------------------------------------
In each controller, I have
- (void)viewDidUnload {
self.fetchedResultsController=nil;  }
- (void)dealloc {
[_fetchedResultsController release];}
------------------------------------------------------------------------------------------------------------------------------------
//  CardSetTableController.m  (is a UITableViewController)
 
- (void)viewDidLoad {
entityForName=@&quot;CardSet&quot;;
sortKey=@&quot;label&quot;;
[super viewDidLoad];
}
 
- (void)viewWillAppear:(BOOL)animated {
NSError *error;
[self fetchedResultsController] performFetch:&amp;error];
[self.tableView reloadData];
}
 
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
 
if (downCardController == nil) {
downCardController=[[CardTableController alloc]
initWithStyle:UITableViewStylePlain];
}
CardSet *oneCardSet=[self.fetchedResultsController objectAtIndexPath:indexPath];
downCardController.cardSet=oneCardSet;
 
[self.navigationController pushViewController:downCardController animated:YES];
 
}
 
-(NSFetchedResultsController *) fetchedResultsController {
// Is the same as the code below in CardTableController.m, except for the
// predicate indicated between //============
}
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
//  CardTableController.m  (is a UITableViewController)
- (void)viewDidLoad {
entityForName=@&quot;Card&quot;;
sortKey=@&quot;label&quot;;
[super viewDidLoad];
}
 
- (void)viewWillAppear:(BOOL)animated {
NSError *error;
[self fetchedResultsController] performFetch:&amp;error];
[self.tableView reloadData];
}
 
-(NSFetchedResultsController *) fetchedResultsController {
if (_fetchedResultsController != nil) return _fetchedResultsController;
 
NSFetchRequest *fetchRequest = [[NSFetchRequest alloc] init];
AppDelegate *appDelegate = [[UIApplication sharedApplication] delegate];
NSManagedObjectContext *context=[appDelegate managedObjectContext];
 
NSEntityDescription *entity=[NSEntityDescription entityForName:entityForName
inManagedObjectContext:context];
[fetchRequest setEntity:entity];
 
//====================================================================
//Predicate for selection of Cards &quot;of&quot; the selected CardSet
NSPredicate *pred= [[NSPredicate alloc]init];
pred=[NSPredicate predicateWithFormat:@&quot;(cardSet.label=%@)&quot;,cardSet.label];
[fetchRequest setPredicate:pred];
//====================================================================
 
NSSortDescriptor *sortDescriptor=[[NSSortDescriptor alloc] initWithKey:sortKey
ascending:YES];
NSArray *sortDescriptors=[[NSArray alloc] initWithObjects:sortDescriptor, nil];
[fetchRequest setSortDescriptors:sortDescriptors];
 
NSFetchedResultsController *frc= [[NSFetchedResultsController alloc]
  initWithFetchRequest:fetchRequest
  managedObjectContext:context
  sectionNameKeyPath:nil
  cacheName:@&quot;cacheCard&quot;]; 
frc.delegate=self;
_fetchedResultsController=frc;
[fetchRequest release];
[sortDescriptor release];
[sortDescriptors release];
[pred release];
 
return _fetchedResultsController;
}
-----------------------------------------------------------------------------------------------------------------------------------------------------</description>
		<content:encoded><![CDATA[<p>Hi Ray,<br />
I am struggling since weeks with an issue related to fetchedResultsController. Reading this thread, looks like you may be able to help me.</p>
<p>Below a &#8220;summary&#8221;, simplified, version of my code.</p>
<p>I manage in CoreData a simple hierarchy.&#8221;CardSet&#8221; is the master table &#8220;Card&#8221; is the child.</p>
<p>This code works find for the first selection (whichever &#8220;cardSet&#8221; is selected, the right &#8220;childs&#8221; cards are displayed).<br />
But for any further selection, whichever &#8220;cardSet&#8221; is selected, the same &#8220;childs&#8221; are always displayed.<br />
Looks like, in the fetchedResultsController method, aside from the 1st time, the only code executed is: &#8220;if (_fetchedResultsController != nil) return _fetchedResultsController;&#8221;, hence giving always the same result. I think I have an issue with &#8220;resetting&#8221; the fetchedResultsController.</p>
<p>Thank you very much for your time.<br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;<br />
In each controller, I have<br />
- (void)viewDidUnload {<br />
self.fetchedResultsController=nil;  }<br />
- (void)dealloc {<br />
[_fetchedResultsController release];}<br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;<br />
//  CardSetTableController.m  (is a UITableViewController)</p>
<p>- (void)viewDidLoad {<br />
entityForName=@&#8221;CardSet&#8221;;<br />
sortKey=@&#8221;label&#8221;;<br />
[super viewDidLoad];<br />
}</p>
<p>- (void)viewWillAppear:(BOOL)animated {<br />
NSError *error;<br />
[self fetchedResultsController] performFetch:&amp;error];<br />
[self.tableView reloadData];<br />
}</p>
<p>- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {</p>
<p>if (downCardController == nil) {<br />
downCardController=[[CardTableController alloc]<br />
initWithStyle:UITableViewStylePlain];<br />
}<br />
CardSet *oneCardSet=[self.fetchedResultsController objectAtIndexPath:indexPath];<br />
downCardController.cardSet=oneCardSet;</p>
<p>[self.navigationController pushViewController:downCardController animated:YES];</p>
<p>}</p>
<p>-(NSFetchedResultsController *) fetchedResultsController {<br />
// Is the same as the code below in CardTableController.m, except for the<br />
// predicate indicated between //============<br />
}<br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;<br />
//  CardTableController.m  (is a UITableViewController)<br />
- (void)viewDidLoad {<br />
entityForName=@&#8221;Card&#8221;;<br />
sortKey=@&#8221;label&#8221;;<br />
[super viewDidLoad];<br />
}</p>
<p>- (void)viewWillAppear:(BOOL)animated {<br />
NSError *error;<br />
[self fetchedResultsController] performFetch:&amp;error];<br />
[self.tableView reloadData];<br />
}</p>
<p>-(NSFetchedResultsController *) fetchedResultsController {<br />
if (_fetchedResultsController != nil) return _fetchedResultsController;</p>
<p>NSFetchRequest *fetchRequest = [[NSFetchRequest alloc] init];<br />
AppDelegate *appDelegate = [[UIApplication sharedApplication] delegate];<br />
NSManagedObjectContext *context=[appDelegate managedObjectContext];</p>
<p>NSEntityDescription *entity=[NSEntityDescription entityForName:entityForName<br />
inManagedObjectContext:context];<br />
[fetchRequest setEntity:entity];</p>
<p>//====================================================================<br />
//Predicate for selection of Cards &#8220;of&#8221; the selected CardSet<br />
NSPredicate *pred= [[NSPredicate alloc]init];<br />
pred=[NSPredicate predicateWithFormat:@"(cardSet.label=%@)",cardSet.label];<br />
[fetchRequest setPredicate:pred];<br />
//====================================================================</p>
<p>NSSortDescriptor *sortDescriptor=[[NSSortDescriptor alloc] initWithKey:sortKey<br />
ascending:YES];<br />
NSArray *sortDescriptors=[[NSArray alloc] initWithObjects:sortDescriptor, nil];<br />
[fetchRequest setSortDescriptors:sortDescriptors];</p>
<p>NSFetchedResultsController *frc= [[NSFetchedResultsController alloc]<br />
  initWithFetchRequest:fetchRequest<br />
  managedObjectContext:context<br />
  sectionNameKeyPath:nil<br />
  cacheName:@&#8221;cacheCard&#8221;];<br />
frc.delegate=self;<br />
_fetchedResultsController=frc;<br />
[fetchRequest release];<br />
[sortDescriptor release];<br />
[sortDescriptors release];<br />
[pred release];</p>
<p>return _fetchedResultsController;<br />
}<br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jaho</title>
		<link>http://www.raywenderlich.com/999/core-data-tutorial-how-to-use-nsfetchedresultscontroller#comment-7037</link>
		<dc:creator>Jaho</dc:creator>
		<pubDate>Thu, 02 Dec 2010 10:51:30 +0000</pubDate>
		<guid isPermaLink="false">http://www.raywenderlich.com/?p=999#comment-7037</guid>
		<description>fantastic !!</description>
		<content:encoded><![CDATA[<p>fantastic !!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: AD</title>
		<link>http://www.raywenderlich.com/999/core-data-tutorial-how-to-use-nsfetchedresultscontroller#comment-6742</link>
		<dc:creator>AD</dc:creator>
		<pubDate>Fri, 26 Nov 2010 17:55:55 +0000</pubDate>
		<guid isPermaLink="false">http://www.raywenderlich.com/?p=999#comment-6742</guid>
		<description>Yes, Core Data seems fine for that kind of thing, download the sample core data (books) from developer.apple.com for more sample projects.</description>
		<content:encoded><![CDATA[<p>Yes, Core Data seems fine for that kind of thing, download the sample core data (books) from developer.apple.com for more sample projects.</p>
]]></content:encoded>
	</item>
</channel>
</rss>

