I'm building some Kiwi tests and getting a warning that I cannot explain. I'm new to Kiwi.
I have a mock object setup:
id conversationMock = [KWMock mockForProtocol:@protocol(Conversation)];
[conversationMock stub:@selector(end)];
And in my controller, a property called "conversation":
@interface MyController ()
@property (nonatomic, assign) id<Conversation> conversation;
@end
The mock is assigned to the property, then in the spec I check for whether the method "end" is called on the conversation:
it(@"should end conversation", ^{
[[[myController.conversation] should] receive] end];
[myController stopTalking];
});
The compiler (LLVM 3.0) is showing a warning: "Instance method '-attachToVerifier:verifier:' not found"
What is the cause of this? Is this something I need to fix? (test runs ok, checks the method call to end works ok)
Typecasting the id to a NSObject gets rid of the warning:
[[(NSObject*)[myController.conversation] should] receive] end];
What you need to do is:
build settings -> Other Linker flags
Add the flag: -all_load
Based on @Komposr's answer, I looked at a couple of my projects with Kiwi and found that I needed to do the following:
Build Settings -> Other Linker Flags
add the flag: -ObjC
Note that I am NOT USING CocoaPods. I have downloaded and compiled Kiwi as a static library that I am including...
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With