Skip to content

-[NSObject valueForKey:] can bypass stubbed methods on partial objects. #15

@wearhere

Description

@wearhere

-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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions