I am creating a trigger.io plugin for warning. Trying to return data from a prompt. This is my code:
// 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 }
The above does not work like me when I try to execute [task success: nil]; and including the task task: (ForgeTask *) , the call stops working.
But without executing the [task success: nil]; and tasks: (ForgeTask *) NSLog works.
How do I get around this?
source share