【发布时间】:2015-01-12 20:46:23
【问题描述】:
我是第一次使用wit.ai iOS SDK,我按照官网https://wit.ai/docs/ios/3.1.1/quickstart的入门页面中的内容一步步进行操作。我收到了这个错误:
协议“WitDelegate”中的方法“witDidGraspIntent:entities:body:error:”未实现。
我仍然可以运行应用程序,并且消息显示在我的收件箱中(在控制台中),但没有发回响应并且应用程序崩溃。我收到了这个错误:
从回调中排队缓冲区时出错
这是我的代码
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's up";
[self.view addSubview:labelView];
}
ViewController.h
#import <UIKit/UIKit.h>
#import <Wit/Wit.h>
@interface ViewController : UIViewController <WitDelegate>
@end
谢谢。
【问题讨论】:
-
你只实现了
witDidGraspIntent:messageId:customData:error:。你需要(也?)实现witDidGraspIntent:entities:body:error:。 -
我应该添加一个新的 -void 吗?为什么这没有在网站的入门指南中列出?谢谢。
-
您应该实现协议要求的所有方法。如果您还有其他问题,请直接联系入门指南的作者。
-
我已经做到了。并在此处发布此问题,以防有人遇到相同问题并可以提供帮助。谢谢
标签: ios objective-c wit.ai