4
我正在爲警報提示創建一個trigger.io插件。 嘗試從警報提示中返回數據。 這是我的代碼:Trigger.io從插件返回數據的iOS插件
// 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
}
以上爲不工作,我當我嘗試做[任務成功:無]。並且包括任務:(ForgeTask *)任務回撥停止工作。
但是不在[任務成功:無]; & 任務:(ForgeTask *)任務 NSLog確實有效。
我該如何解決這個問題?
你怎麼稱呼這從javascript – 2013-12-18 06:58:00
@ V-Xtreme Trigger.io已經創建了自己的通知插件請參閱 - https://trigger.io/modules/notification/current/docs/index.html – 2013-12-18 12:32:33