iOS Question Call B4i sub from inline OBJC and return value

CaptKronos

Active Member
Licensed User
Longtime User
How would I call from inline OBJC a B4i sub such as the following and have the inline code receive the sub's return value:
Code:
sub test as int
   return 1
end sub
Thanks.
 
Do you mean like this:
Code:
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).
 
Upvote 0
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.
 
Upvote 0
Back
Top