Android Question B4X xui Msgbox issue

james_sgp

Active Member
Licensed User
Longtime User
Hi,
I`m using xui Msgbox in an app that is for B4a & B4i, the android version has no issues with the code; but i`m getting an error when compiling for B4i:

B4X:
B4i Version: 8.10
Parsing code.    (0.36s)
Building folders structure.    (0.34s)
Running custom action.    (0.06s)
Compiling code.    (1.14s)
Compiling layouts code.    (0.04s)
Compiling debugger engine code.    (2.72s)
Building Xcode project.    (0.16s)
Preparing project for builder.    (0.37s)
    Project size: 0.98 MB
Sending data to remote compiler.    Error
B4i line: 2642
If Result = xui.DialogResponse_Positive Then
implicit conversion of 'int' to 'id' is disallowed with ARC

my code is:

B4X:
        Wait For (xui.Msgbox2Async("Unsaved profile data!", "W A R N I N G ", "C L O S E", "", "S A V E", Null)) Msgbox_Result (Result As Int)
        If Result = xui.DialogResponse_Positive Then
            Return True
        else if xui.DialogResponse_Negative Then
            'Msgbox2Async("Click the SAVE Icon", "W A R N I N G ", "O K ", "", "", Null, True)
            Return False
        End If

Can anyone help with the issue as it completely breaks my app...

Thanks, James
 

ilan

Expert
Licensed User
Longtime User
when i create a xui msgbox2 i have this template:

B4X:
    Dim sf As Object = xui.Msgbox2Async("Delete file?", "Title", "Yes", "Cancel", "No", Null)
    Wait For (sf) Msgbox_Result (Result As Int)
    If Result = xui.DialogResponse_Positive Then
        Log("Deleted!!!")
    End If

try this:

B4X:
    Dim sf As Object = xui.Msgbox2Async("Unsaved profile data!", "W A R N I N G ", "C L O S E", "", "S A V E", Null)
    Wait For (sf) Msgbox_Result (Result As Int)
    If Result = xui.DialogResponse_Positive Then
         Return True
   else
         Return False
    End If

make sure you are not using RESULT before with a different type!
 
Upvote 0
Top