Skip to content
Browse files

Bugfixing

  • Loading branch information...
1 parent 9f7a35e commit 8314f7d536bccb2d0ac94bf35d97ca5a51bc8323 Philip Messlehner committed Jan 19, 2010
Showing with 27 additions and 1 deletion.
  1. +26 −0 Classes/TasksListViewController.m
  2. +1 −1 toodledo-objc
View
26 Classes/TasksListViewController.m
@@ -238,6 +238,32 @@ - (void)tableView:(UITableView *)tableView commitEditingStyle:(UITableViewCellEd
NSError *error;
Task *t = (Task *)[self.tasks objectAtIndex:row];
+
+ //Remove Folder
+ Folder *f = t.folder;
+ if (f != nil)
+ [f removeTasksObject:t];
+ t.folder = nil;
+
+ //Remove Context
+ Context *c = t.context;
+ if (c != nil)
+ [c removeTasksObject:t];
+ t.context = nil;
+
+ //Remove Tags
+ NSMutableArray *tagsToRemove = [NSMutableArray array];
+ for(Tag *tag in t.tags)
+ {
+ [tagsToRemove addObject:tag];
+ }
+ for(Tag *tag in tagsToRemove)
+ {
+ [tag removeTasksObject:t];
+ }
+ [t removeTags:[NSSet setWithArray:tagsToRemove]];
+
+
[Task deleteObject:t error:&error];
[BaseManagedObject commit];
2 toodledo-objc
@@ -1 +1 @@
-Subproject commit f64ceafa3371661cadde59df4ea2eed6507d8e79
+Subproject commit 0c27f47b900a4a2e4c853c5cf4460b4960e3b64b

0 comments on commit 8314f7d

Please sign in to comment.
Something went wrong with that request. Please try again.