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:
Francisco Ryan Tolmasky I
2011-01-17 01:31:15 -08:00
parent 8720a952b0
commit 9796f5d5d7
8 changed files with 325 additions and 191 deletions
+4 -4
View File
@@ -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];
}
}