I use this function without problems in B4A and B4J .. but it generates an error in B4I (on Wait For)
Why? Perchè?
B4X:
Public Sub ReadSingleResult(Query As String,Field As String) As ResumableSub
Dim j As HttpJob
Dim Result As String = ""
j.Initialize("", Me)
j.Download($"${url}query.php?query=${Query}&Field=${Field}"$)
Wait For (j) JobDone(j As HttpJob) <<<<------- ERROR
'Log(j.GetString)
If j.Success Then
Result=J.GetString
End If
Return Result
End Sub
ResumableSub said:Application_Start
Application_Active
ResponseError: unsupported URL, status code: 0
Unexpected event (missing RaisesSynchronousEvents): AFTER_SLEEP
Error occurred on line: 60 (php_comunicate)
*** -[__NSSingleObjectArrayI objectAtIndex:]: index 1 beyond bounds [0 .. 0]
Stack Trace: (
CoreFoundation <redacted> + 252
libobjc.A.dylib objc_exception_throw + 56
CoreFoundation <redacted> + 0
CoreFoundation <redacted> + 144
CoreFoundation <redacted> + 292
Cosa si Mangia +[B4I runDynamicMethod:method:throwErrorIfMissing:args:] + 1624
Cosa si Mangia -[B4IShell runMethod:] + 448
Cosa si Mangia -[B4IShell raiseEventImpl:method:args::] + 1648
Cosa si Mangia __40-[B4IShell raiseEventImpl:method:args::]_block_invoke + 36
libdispatch.dylib <redacted> + 24
libdispatch.dylib <redacted> + 16
libdispatch.dylib <redacted> + 1068
CoreFoundation <redacted> + 12
CoreFoundation <redacted> + 1964
CoreFoundation CFRunLoopRunSpecific + 436
GraphicsServices GSEventRunModal + 100
UIKitCore UIApplicationMain + 212
Cosa si Mangia main + 124
libdyld.dylib <redacted> + 4
)
Why? Perchè?