Method not implemented in protocol (using wit.ai SDK)

I used the wit.ai iOS SDK for the first time and I followed step by step what is written on the getting started page on the official site https://wit.ai/docs/ios/3.1.1/quickstart . I got this error:

The 'witDidGraspIntent: entity: body: error:' method is not implemented in the 'WitDelegate' protocol.

I could still launch the application and the message is displayed in my mailbox (in the console), but no response is returned and the application crashes. I got this error:

Fallback buffer error from callback

Here is my code

ViewController.m

#import "ViewController.h"
@interface ViewController ()

@end

@implementation ViewController {
    UILabel *labelView;
}

- (void)witDidGraspIntent:(NSArray *)outcomes 
                messageId:(NSString *)messageId 
               customData:(id)customData 
                    error:(NSError*)e {
    //Implementation here...
    labelView.text = @"Hey what up";
    [self.view addSubview:labelView];
}

      

ViewController.h

#import <UIKit/UIKit.h>
#import <Wit/Wit.h>

@interface ViewController : UIViewController <WitDelegate>


@end

      

Thank.

+3


source to share


1 answer


Dude, the crash message you receive tells you exactly what is wrong.

The 'witDidGraspIntent: entity: body: error:' method is not implemented in the "WitDelegate" protocol.

Your protocol implementation is missing a ( witDidGraspIntent:entities:body:error:

) method . You must implement all the required methods in the protocol. In this case, the missing method witDidGraspIntent:entities:body:error:

.



Are you asking, "Should I add a new -void?" That being said, if you mean, if you add a method implementation witDidGraspIntent:entities:body:error:

, the answer is YES !

I haven't used the wit.ai SDK before. You might want to change your question and ask the people who have used this SDK to help implement the method if you cannot figure out how to do it yourself. You can also add "(using wit.ai SDK)" to your question title so that people familiar with this structure will notice your question.

+3


source







All Articles