Skip to content

Commit 388137f

Browse files
committed
updated implementation of replaceObjectsInRange:withObjectsFromArray:otherRange: per suggestions
1 parent e9c84b5 commit 388137f

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

Foundation/NSArray.swift

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -673,7 +673,9 @@ public class NSMutableArray : NSArray {
673673
}
674674
}
675675
public func replaceObjectsInRange(range: NSRange, withObjectsFromArray otherArray: [AnyObject], range otherRange: NSRange) {
676-
replaceObjectsInRange(range, withObjectsFromArray: Array(otherArray[otherRange.toRange()!]))
676+
var list = [AnyObject]()
677+
otherArray.bridge().getObjects(&list, range:otherRange)
678+
replaceObjectsInRange(range, withObjectsFromArray:list)
677679
}
678680

679681
public func replaceObjectsInRange(range: NSRange, withObjectsFromArray otherArray: [AnyObject]) {

0 commit comments

Comments
 (0)