iOS Question References in OBJC

Semen Matusovskiy

Well-Known Member
Licensed User
Hi, guys --

I want to replace - (BOOL) shouldAutorotate in UINavigationController by very simple code, which in Basic looks so
B4X:
If dataCommon.booleanAllowRotateTemporary Then
   dataCommon.booleanAllowRotateTemporary = False
   Return True
Else
    Return dataCommon.booleanAllowRotate
End If

booleanAllowRotateTemporary and booleanAllowRotate are boolean public variables, declared in dataCommon module.

I looked compiled code and converted to
B4X:
 if (self->__datacommon->__booleanallowrotatetemporary) { self->__datacommon->__booleanallowrotatetemporary = false; return true; } else { return self->__datacommon->__booleanallowrotate; }; }

But compiler talks: 'UINavigationController' does not have a member named '__datacommon'.

Any ideas how to refer ?
 
Last edited:

Semen Matusovskiy

Well-Known Member
Licensed User
Erel --

Thanx for reply, but I ask not about "autorotate" feature as it is.
Imagine that I want to replace
B4X:
       NSDictionary* map = [B4IObjectWrapper getMap:self];
       NSNumber* n = map[@"tag"];
       return n.boolValue;
by
B4X:
If dataCommon.booleanAllowRotateTemporary Then
   dataCommon.booleanAllowRotateTemporary = False
   Return True
Else
    Return dataCommon.booleanAllowRotate
End If
How to translate dataCommon.booleanAllowRotateTemporary to objective-c ?
 
Upvote 0

Semen Matusovskiy

Well-Known Member
Licensed User
I use two fragments: one for ordinary NavigationController and another for SideMenuController

Sometimes appears a message
B4X:
Unexpected event (missing RaisesSynchronousEvents): main_shouldautorotate

It seems to me, when I replace one controller to another. So there is a wish to delete raiseEvent in

B4X:
(BOOL)shouldAutorotate { return [(NSNumber*)[B4IObjectWrapper raiseEvent:self :@"_shouldautorotate" :nil] boolValue]; }

In my case Main_ShouldAutoRotate is very simple. Why not to replace to returning of global variable ?
 
Upvote 0
Top