Fixed DND playlist bug where dragging between the playlist could cause a crash.
parent
2b00672b45
commit
4dc7d7199e
|
@ -111,8 +111,10 @@ NSString *MovedRowsType = @"MOVED_ROWS_TYPE";
|
||||||
insertIndex -= 1;
|
insertIndex -= 1;
|
||||||
}
|
}
|
||||||
object = [objects objectAtIndex:removeIndex];
|
object = [objects objectAtIndex:removeIndex];
|
||||||
|
[object retain];
|
||||||
[self removeObjectAtArrangedObjectIndex:removeIndex];
|
[self removeObjectAtArrangedObjectIndex:removeIndex];
|
||||||
[self insertObject:object atArrangedObjectIndex:insertIndex];
|
[self insertObject:object atArrangedObjectIndex:insertIndex];
|
||||||
|
[object release];
|
||||||
|
|
||||||
index = [indexSet indexLessThanIndex:index];
|
index = [indexSet indexLessThanIndex:index];
|
||||||
}
|
}
|
||||||
|
|
|
@ -170,7 +170,9 @@
|
||||||
if ([info draggingSource] == tableView)
|
if ([info draggingSource] == tableView)
|
||||||
{
|
{
|
||||||
//DNDArrayController handles moving...still need to update the uhm...indices
|
//DNDArrayController handles moving...still need to update the uhm...indices
|
||||||
|
NSLog(@"Archive stuff");
|
||||||
NSArray *rows = [NSKeyedUnarchiver unarchiveObjectWithData:[[info draggingPasteboard] dataForType: MovedRowsType]];
|
NSArray *rows = [NSKeyedUnarchiver unarchiveObjectWithData:[[info draggingPasteboard] dataForType: MovedRowsType]];
|
||||||
|
NSLog(@"Whatever");
|
||||||
NSIndexSet *indexSet = [self indexSetFromRows:rows];
|
NSIndexSet *indexSet = [self indexSetFromRows:rows];
|
||||||
int firstIndex = [indexSet firstIndex];
|
int firstIndex = [indexSet firstIndex];
|
||||||
if (firstIndex > row)
|
if (firstIndex > row)
|
||||||
|
|
Loading…
Reference in New Issue