-[NSObject valueForKey:]
can bypass stubbed methods on partial objects.
#15
Labels
-[NSObject valueForKey:]
can bypass stubbed methods on partial objects.
#15
-valueForKey:
caches method implementations, so if-valueForKey:@"foo"
is called before-foo
is stubbed, then the next invocation of-valueForKey:@"foo"
will call the original implementation, not the stubbed implementation. This mailing list thread provides further context: http://lists.apple.com/archives/cocoa-dev/2010/Mar/msg00788.html.That thread ended with the suggestion that
-valueForKey:
be overridden. We might need to do this--or rather, stub-valueForKey:@"foo"
when-foo
is stubbed.The text was updated successfully, but these errors were encountered: