Permalink
Browse files

Fixed a compilation warning: "Multiple methods named 'count' found."

Added a (NSArray *) typecast to those method invocations.
  • Loading branch information...
1 parent b75f127 commit 256f4d0b802b44f3911d61a8a123946b6be036bf @bourquep bourquep committed Mar 27, 2012
Showing with 2 additions and 2 deletions.
  1. +2 −2 MAKVONotificationCenter.m
@@ -99,7 +99,7 @@ - (id)initWithObserver:(id)observer object:(id)target keyPaths:(NSSet *)keyPaths
{
if ([target isKindOfClass:[NSArray class]])
{
- [target addObserver:self toObjectsAtIndexes:[NSIndexSet indexSetWithIndexesInRange:NSMakeRange(0, [target count])]
+ [target addObserver:self toObjectsAtIndexes:[NSIndexSet indexSetWithIndexesInRange:NSMakeRange(0, [(NSArray *)target count])]
forKeyPath:keyPath options:options context:&MAKVONotificationHelperMagicContext];
}
else
@@ -158,7 +158,7 @@ - (void)deregister
//NSLog(@"deregistering observer %@ target %@ observation %@", _observer, _target, self);
if ([_target isKindOfClass:[NSArray class]])
{
- NSIndexSet *idxSet = [NSIndexSet indexSetWithIndexesInRange:NSMakeRange(0, [_target count])];
+ NSIndexSet *idxSet = [NSIndexSet indexSetWithIndexesInRange:NSMakeRange(0, [(NSArray *)_target count])];
for (NSString *keyPath in _keyPaths)
[_target removeObserver:self fromObjectsAtIndexes:idxSet forKeyPath:keyPath context:&MAKVONotificationHelperMagicContext];

0 comments on commit 256f4d0

Please sign in to comment.