"YOU AND THE ART OF ONLINE DATING" is the only product on the market that will take you step-by-step through the process of online dating, provide you with the resources to help ensure success. Get it now!
Try this (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { static NSString *CellIdentifier = @"Cell"; UITableViewCell *cell = tableView dequeueReusableCellWithIdentifier:CellIdentifier; if (cell == nil) { cell = UITableViewCell alloc initWithStyle:UITableViewCellStyleSubtitle reuseIdentifier:CellIdentifier autorelease; } Routine *tempRoutine = (Routine *)yourFetchController objectAtIndexPath:indexPath; cell.textLabel. Text = tempRoutine. Name; cell.
AccessoryType = UITableViewCellAccessoryDisclosureIndicator; return cell; } or (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { static NSString *CellIdentifier = @"Cell"; UITableViewCell *cell = tableView dequeueReusableCellWithIdentifier:CellIdentifier; if (cell == nil) { cell = UITableViewCell alloc initWithStyle:UITableViewCellStyleSubtitle reuseIdentifier:CellIdentifier autorelease; } NSManagedObject *managedObject = objectAtIndexPath:indexPath; cell.textLabel. Text = managedObject. Name; cell.
AccessoryType = UITableViewCellAccessoryDisclosureIndicator; return cell; } UPDATE if (editingStyle == UITableViewCellEditingStyleDelete) { // Delete the managed object for the given index path NSManagedObjectContext *context = self. FetchedResultsController managedObjectContext; context deleteObject:self. FetchedResultsController objectAtIndexPath:indexPath; // Update the array and table view.
//eventsArray removeObjectAtIndex:indexPath. Row; if (!managedObjectContext save:&error) { // Handle the error. } tableView deleteRowsAtIndexPaths:NSArray arrayWithObject:indexPath withRowAnimation:YES; // Commit the change.
NSError *error = nil; } to disable sorting comment follwoing line in (NSFetchedResultsController *)fetchedResultsController method Edit the sort key as appropriate. NSSortDescriptor *sortDescriptor = NSSortDescriptor alloc initWithKey:@"name" ascending:NO; NSArray *sortDescriptors = NSArray alloc initWithObjects:sortDescriptor, nil; fetchRequest setSortDescriptors:sortDescriptors.
Try this, - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { static NSString *CellIdentifier = @"Cell"; UITableViewCell *cell = tableView dequeueReusableCellWithIdentifier:CellIdentifier; if (cell == nil) { cell = UITableViewCell alloc initWithStyle:UITableViewCellStyleSubtitle reuseIdentifier:CellIdentifier autorelease; } Routine *tempRoutine = (Routine *)yourFetchController objectAtIndexPath:indexPath; cell.textLabel. Text = tempRoutine. Name; cell.
AccessoryType = UITableViewCellAccessoryDisclosureIndicator; return cell; } or - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { static NSString *CellIdentifier = @"Cell"; UITableViewCell *cell = tableView dequeueReusableCellWithIdentifier:CellIdentifier; if (cell == nil) { cell = UITableViewCell alloc initWithStyle:UITableViewCellStyleSubtitle reuseIdentifier:CellIdentifier autorelease; } NSManagedObject *managedObject = objectAtIndexPath:indexPath; cell.textLabel. Text = managedObject. Name; cell.
AccessoryType = UITableViewCellAccessoryDisclosureIndicator; return cell; } UPDATE if (editingStyle == UITableViewCellEditingStyleDelete) { // Delete the managed object for the given index path NSManagedObjectContext *context = self. FetchedResultsController managedObjectContext; context deleteObject:self. FetchedResultsController objectAtIndexPath:indexPath; // Update the array and table view.
//eventsArray removeObjectAtIndex:indexPath. Row; if (!managedObjectContext save:&error) { // Handle the error. } tableView deleteRowsAtIndexPaths:NSArray arrayWithObject:indexPath withRowAnimation:YES; // Commit the change.
NSError *error = nil; } to disable sorting comment follwoing line in - (NSFetchedResultsController *)fetchedResultsController method. // Edit the sort key as appropriate. NSSortDescriptor *sortDescriptor = NSSortDescriptor alloc initWithKey:@"name" ascending:NO; NSArray *sortDescriptors = NSArray alloc initWithObjects:sortDescriptor, nil; fetchRequest setSortDescriptors:sortDescriptors.
This fixes the issue, thanks. I just need to get rid of the rest of the references to eventsArray now. – Faisal Apr 14 at 4:02 In the addEvent method, what should I do with eventsArray addObject:routine;?
– Faisal Apr 14 at 4:03 comment it and try. Main thing is updating the data and reloading table. – Ravin Apr 14 at 4:06 I'm still getting problems with the rest of the places were eventsArray was.
Such as in the delete row and the viewDidLoad's self setEventsArray:mutableFetchResults; – Faisal Apr 14 at 4:09 Actually I commented that viewDidLoad line out and it seems to make no difference. When I delete cells from the table however, I need to fix the following line: eventsArray removeObjectAtIndex:indexPath. Row; – Faisal Apr 14 at 4:20.
NSFetchedResultsController *aFetchedResultsController = NSFetchedResultsController alloc initWithFetchRequest:fetchRequest managedObjectContext:self. Replace this implementation with code to handle the error appropriately. Abort() causes the application to generate a crash log and terminate.
I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.