sub test as int
return 1
end sub
#If OBJC
-(NSInteger)testGettingVal
{
NSInteger aNum;
aNum=[self.bi raiseEvent:nil event:@"test:" params:@[]];
return aNum;
}
#end if
I always get a value of 0 returned. I thought raising an event returned immediately (hence 0 rather than 1 being returned).
There is an extra colon in the in the sub name. There are other problems with this code (you will probably see a warning about unexpected synchronous event in the logs).
Yes, sorry, you are correct. I rewrote my code on the fly to simplify it for the post and I missed the ":". My original code was passing a parameter. I also get the unexpected synchronous event message in the logs. However, I can't use raiseUIEvent because I believe that doesn't return a value.
I know nothing about Objective C. But, as I understand, inline OBJC allows direct calls like in other languages. For example, I added some statements in Erel's sample (see test.zip).