mirror of
https://github.com/cappuccino/cappuccino.git
synced 2026-08-30 23:43:37 +00:00
Fix CPPopUpButton menu support.
- Added enumerateObjectsUsingBlock: to CPArray - Fixed a remaining case of [] being used instead of objectAtIndex: in CPMutableArray. - Added KVO support for menu items array in menus. - Changed CPPopUpButton to use KVO to sync up with menu instead of notifications. - Removed extra menu encoding in CPPopUpButton. - Removed extra mainMenu object from CPApplication. - Use setters in CPResponder instead of direct ivar access in initWithCoder:. Closes #298. Closes $1059. Reviewed by me.
This commit is contained in:
@@ -136,15 +136,15 @@
|
||||
@param anIndexSet the set of indices to array positions that will be replaced
|
||||
@param objects the array of objects to place in the specified indices
|
||||
*/
|
||||
- (void)replaceObjectsAtIndexes:(CPIndexSet)anIndexSet withObjects:(CPArray)objects
|
||||
- (void)replaceObjectsAtIndexes:(CPIndexSet)indexes withObjects:(CPArray)objects
|
||||
{
|
||||
var i = 0,
|
||||
index = [anIndexSet firstIndex];
|
||||
index = [indexes firstIndex];
|
||||
|
||||
while (index !== CPNotFound)
|
||||
{
|
||||
[self replaceObjectAtIndex:index withObject:objects[i++]];
|
||||
index = [anIndexSet indexGreaterThanIndex:index];
|
||||
[self replaceObjectAtIndex:index withObject:[objects objectAtIndex:i++]];
|
||||
index = [indexes indexGreaterThanIndex:index];
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user