I’m finally making progress on my iOS application. I am connecting to a Linea Pro barcode scanner. I finally have a connection state event being thrown but my barcodeData event is not. Both are added via AddHandler. Definition below. Am I declaring something wrong?
[code]’ /**
’ Notification sent when barcode is successfuly read. This notification is used when barcode type is set to BARCODE_TYPE_DEFAULT or BARCODE_TYPE_EXTENDED.
’ @param barcode - string containing barcode data
’ @param type - barcode type, one of the BAR_* constants
’ **/
’ -(void)barcodeData:(NSString *)barcode type:(int)type;
Public Sub BarcodeData(oObject as BTDeviceDelegate, barcode as text, type as integer)
//Never gets called
lblBarcode.text = "Barcode: " + barcode + " Type: " + Type.ToText
End Sub[/code]
They are setup in the Open event of my view:
[code]dim oDTDelegate as new BTDeviceDelegate
if oDTDelegate.isNil = false then
setDelegate_(app.oScanner.GetPtr, oDTDelegate)
Well, I’m using the Delegate method that UIKit is using and I think that’s where my initial works needs to be done in figuring that out. So that BarcodeData will have to be after the delegate handler has gotten the message and THEN I can call this method.
We got the issue resolved through PM. The problem turned out to be that no reference was being kept to the delegate so it went out of scope and never received the events.