Guest User

Untitled

a guest
Apr 28th, 2012
27
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.39 KB | None | 0 0
  1. Re-index sorting with Core Data, NSTreeController and NSOutlineView
  2. - (void)reIndex {
  3. NSUInteger count = [[_arrayController arrangedObjects] count];
  4. NSArray *array = [NSArray arrayWithArray:[_treeController arrangedObjects]];
  5.  
  6. for (int i = 0; i < count; i++) {
  7. id item = [array objectAtIndex:i];
  8. [item setValue:[NSNumber numberWithInt:i] forKey:@"sortIndex"];
  9. }
  10. }
Advertisement
Add Comment
Please, Sign In to add comment