Erel B4X founder Staff member Licensed User Longtime User Mar 21, 2017 #2 B4X: Dim no As NativeObject = CallBack Why CallBack? It should be Me. Upvote 0
Erel B4X founder Staff member Licensed User Longtime User Mar 22, 2017 #3 It should be Me however it is indeed not related to the compile time error. See the method signature: https://developer.apple.com/reference/uikit/uialertview/1620765-initwithtitle?language=objc Upvote 0
It should be Me however it is indeed not related to the compile time error. See the method signature: https://developer.apple.com/reference/uikit/uialertview/1620765-initwithtitle?language=objc
Erel B4X founder Staff member Licensed User Longtime User Mar 22, 2017 #4 Upload the project and I'll help you. Upvote 0
Erel B4X founder Staff member Licensed User Longtime User Mar 22, 2017 #5 Correct code: B4X: #If OBJC - (void)ShowInputDialog:(NSString*)Input :(NSString*)Title :(NSString*)Message :(NSString*)OK :(NSString*)Cancel :(int)KeybardType { UIAlertView * alert = [[UIAlertView alloc] initWithTitle:Title message:Message delegate:self cancelButtonTitle:Cancel otherButtonTitles:OK, nil]; alert.alertViewStyle = UIAlertViewStylePlainTextInput; UITextField * alertTextField = [alert textFieldAtIndex:0]; alertTextField.keyboardType = KeybardType; alertTextField.text = Input; alert.delegate = self; [alert show]; } - (void)alertView:(UIAlertView *)alertView clickedButtonAtIndex:(NSInteger)buttonIndex { [self.bi raiseEvent:nil event:@"inputdialog_result::" params:@[@(buttonIndex == 1), [[alertView textFieldAtIndex:0] text]]]; } #End If Note that I've changed the event signature: B4X: Private Sub InputDialog_Result(Success As Boolean, Text As String) CallSub3(CallBack, mEventName & "_Result", Success, Text) End Sub SubExists is not required. Upvote 0
Correct code: B4X: #If OBJC - (void)ShowInputDialog:(NSString*)Input :(NSString*)Title :(NSString*)Message :(NSString*)OK :(NSString*)Cancel :(int)KeybardType { UIAlertView * alert = [[UIAlertView alloc] initWithTitle:Title message:Message delegate:self cancelButtonTitle:Cancel otherButtonTitles:OK, nil]; alert.alertViewStyle = UIAlertViewStylePlainTextInput; UITextField * alertTextField = [alert textFieldAtIndex:0]; alertTextField.keyboardType = KeybardType; alertTextField.text = Input; alert.delegate = self; [alert show]; } - (void)alertView:(UIAlertView *)alertView clickedButtonAtIndex:(NSInteger)buttonIndex { [self.bi raiseEvent:nil event:@"inputdialog_result::" params:@[@(buttonIndex == 1), [[alertView textFieldAtIndex:0] text]]]; } #End If Note that I've changed the event signature: B4X: Private Sub InputDialog_Result(Success As Boolean, Text As String) CallSub3(CallBack, mEventName & "_Result", Success, Text) End Sub SubExists is not required.
Erel B4X founder Staff member Licensed User Longtime User Mar 22, 2017 #6 Filippo said: Was it just the "event signature" ? Click to expand... No. There were several errors in the OBJC code. Upvote 0
Filippo said: Was it just the "event signature" ? Click to expand... No. There were several errors in the OBJC code.