1
ResearchKitを使用しているプロジェクト(Swift)で作業していて、キャンセルバーボタンが機能しません。 私はそれがResearchKitキャンセルボタンが機能しない
- (void)setCancelButtonItem:(UIBarButtonItem *)cancelButtonItem {
[super setCancelButtonItem:cancelButtonItem];
[cancelButtonItem setTarget:self];
[cancelButtonItem setAction:@selector(cancelButtonHandler:)];
}
- (void)cancelButtonHandler:(id)sender {
STRONGTYPE(self.taskViewController.delegate) strongDelegate = self.taskViewController.delegate;
if ([strongDelegate respondsToSelector:@selector(taskViewController:didFinishWithReason:error:)]) {
[strongDelegate taskViewController:self.taskViewController didFinishWithReason:ORKTaskViewControllerFinishReasonDiscarded error:nil];
}
}
私は破棄結果を取得し、ポップアップをキャンセル動作させる必要があり、次の方法を発見したが、私は破棄結果のオプションをタップすると何も起こりません。
他に何か確認する必要がありますか?私はどこかに接続する必要がありますか?
はい、それは私のためにそのように働きました。私はこのような何かをした:(:ORKTaskViewController、didFinishWithReason理由:ORKTaskViewControllerFinishReason、エラー:?NSError taskViewController){スイッチ理由{ケース.Completed:...場合.Saved、.Failed、.Discarded: \t \t \t taskViewController taskViewController FUNC。 dismissViewControllerAnimated(true、completed:nil) \t \t \t休憩 \t \t} – asheyla