HCMatcher does not conform to the 'NSCopying' proto warning

Discussion of the OCMock framework. If you have patches we would prefer you to send them to the mailing list, but attaching them to a topic is possible, too.

HCMatcher does not conform to the 'NSCopying' proto warning

Postby skrul » 11 Nov 2010, 23:13

Hey all --

I just set up OCMock 1.70 and OCHamcrest (trunk) in my new iPhone xcode project. My test contains this snippet of code using an OCMock mock and the "hasEntry" Hamcrest matcher:

Code: Select all
NSNumber *jsonTrue = [NSNumber numberWithBool:YES];
id delegate =
    [OCMockObject mockForProtocol:@protocol(RemoteRequestDelegate)];
[[[delegate stub] andCall:@selector(stopRunLoop) onObject:self]
    response:[OCMArg any]
    succeededWithResult:hasEntry(@"success", jsonTrue)];


When this is compiled, the line with the "hasEntry" matcher emits the following warning:

Code: Select all
warning: type 'id <HCMatcher>' does not conform to the 'NSCopying' protocol


Otherwise, the test works great. Anyone have any idea how I can get rid of this warning!

Thanks!
skrul
 
Posts: 3
Joined: 11 Nov 2010, 23:05

Re: HCMatcher does not conform to the 'NSCopying' proto warning

Postby skrul » 13 Nov 2010, 01:46

I was able to suppress the warning by casting the return value of hasEntry to NSDictionary*, but there must be a better solution for this?
skrul
 
Posts: 3
Joined: 11 Nov 2010, 23:05


Return to OCMock



cron