sách gpt4 ai đã đi

Plugin iOS Trigger.io trả về dữ liệu từ lệnh gọi lại

In lại 作者:可可西里 更新时间:2023-11-01 06:16:05 35 4
mua khóa gpt4 Nike

我正在为警报提示创建一个 trigger.io 插件。尝试从警报提示返回数据。这是我的代码:

 // Prompt
+ (void)show_prompt:(ForgeTask*)task{
// Create the alert
UIAlertView *prompt = [[UIAlertView alloc] initWithTitle:@"Title"
message:@"Message"
delegate:self
cancelButtonTitle:@"OK"
otherButtonTitles:@"Cancel", nil];
UITextField *promptTextBox = [[UITextField alloc] initWithFrame:CGRectMake(12, 45, 260, 25)];

[promptTextBox setTag:30050]; // set tag to find the text box
[promptTextBox setBackgroundColor:[UIColor whiteColor]];
[prompt addSubview:promptTextBox]; // add it to the alert
[prompt show]; //show alert

}

// Call back
+ (void)alertView:(UIAlertView *)alertView clickedButtonAtIndex:(NSInteger)buttonIndex task:(ForgeTask*)task
{
// Grab the reply from text box
UITextField* promptTextBox = (UITextField*)[alertView viewWithTag:30050];
NSLog(@"%@", [promptTextBox text]); // output to log
[task success:nil]; // output call back

}

当我尝试执行 [task success:nil]; 并包括 task:(ForgeTask*)task 时,上面的方法不起作用,回调停止工作.

但是如果没有 [task success:nil]; & task:(ForgeTask*)task NSLog 确实可以工作。

我该如何解决这个问题?

1 Câu trả lời

所以您正在尝试将 [promptTextBox 文本] 返回给调用 JavaScript?

这个怎么样:

NSLog(@"%@", [promptTextBox text]); // output to log   
[task success:[promptTextBox text]]; // output call back

... 还是我没捕获要点?

关于ios - Trigger.io iOS 插件从回调返回数据,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/14984023/

35 4 0
Bài viết được đề xuất: iphone - MPVolumeView 拇指图像不居中
Bài viết được đề xuất: iphone - 使用 url scheme 传递参数
Bài viết được đề xuất: ios - 有没有办法检查 UIImage 是否已解压缩?
Bài viết được đề xuất: ios - 将 View 添加到 UIStackView 后,UITableViewCell 不会更新高度
可可西里
Hồ sơ cá nhân

Tôi là một lập trình viên xuất sắc, rất giỏi!

Nhận phiếu giảm giá Didi Taxi miễn phí
Mã giảm giá Didi Taxi
Giấy chứng nhận ICP Bắc Kinh số 000000
Hợp tác quảng cáo: 1813099741@qq.com 6ren.com