iOS Question B4xRotary problem with Designer Script

james_sgp

Member
Licensed User
Hi, my B4i app keeps crashing at the Designer Script when using the B4XRotary class; trying to set Left/Top/Width. If I put the Left & Top positions into my code its ok, but I cant put width there either without the app crashing; but wondering why I`m getting this problem.

James
 

james_sgp

Member
Licensed User
b4Xrotary is rotary knob class.

Copying updated assets files (1)
Application_Start
Device locale: en
Found 13 strings.
Application_Active
Error occurred on line: 139 (B4XSwitch)
Object was not initialized (UIView)
Stack Trace: (
CoreFoundation <redacted> + 252
libobjc.A.dylib objc_exception_throw + 56
CoreFoundation <redacted> + 0
V-Analyzer -[B4IObjectWrapper object] + 136
V-Analyzer -[B4IViewWrapper setLeft:] + 52
V-Analyzer -[LS_mainlayout LS_general:::] + 752
CoreFoundation <redacted> + 144
CoreFoundation <redacted> + 292
V-Analyzer +[B4I runDynamicMethod:method:throwErrorIfMissing:args:] + 1608
V-Analyzer +[B4ILayoutBuilder runScripts:::] + 980
V-Analyzer -[B4ILayoutBuilder resizeLayout::] + 768
V-Analyzer __30-[B4IPanelView layoutSubviews]_block_invoke + 588
libdispatch.dylib <redacted> + 24
libdispatch.dylib <redacted> + 16
libdispatch.dylib <redacted> + 1068
CoreFoundation <redacted> + 12
CoreFoundation <redacted> + 1924
CoreFoundation CFRunLoopRunSpecific + 436
GraphicsServices GSEventRunModal + 104
UIKitCore UIApplicationMain + 212
V-Analyzer main + 124
libdyld.dylib <redacted> + 4
)
SignalHandler 6

I have tried a simple app with only the rotary know in it; and the designer script doesn`t crash. So i would guess the DS is conflicting with something else in my app?
 
Last edited:

Erel

Administrator
Staff member
Licensed User
I don't see how we can help you with the information you provided. Sorry.
 

james_sgp

Member
Licensed User
Here is a small app (1 panel, with some object, no code) showing the problem I`m getting. If I uncomment the designer script for 'rotary1' the app crashes during compilation.

James
 

Attachments

klaus

Expert
Licensed User
Hi Erel,
I see it too.
In the attached project, with the xRotaryKnob.b4xlib, it works the first time. And stopping the program and running it again, in the IDE, the program crashes with the error below:

Application_Start
Application_Active
Error occurred on line: 35 (Main)
Object was not initialized (UIView)
Stack Trace: (
CoreFoundation 7519E999-1053-3367-B9D5-8844F6D3BDC6 + 1227356
libobjc.A.dylib objc_exception_throw + 56
CoreFoundation 7519E999-1053-3367-B9D5-8844F6D3BDC6 + 135616
TestRotaryKnobProperties1 0x0000000100202c38 -[B4IObjectWrapper object] + 136
TestRotaryKnobProperties1 0x00000001002038a4 -[B4IViewWrapper setLeft:] + 52
TestRotaryKnobProperties1 0x00000001001fd730 -[LS_main LS_general:::] + 244
CoreFoundation 7519E999-1053-3367-B9D5-8844F6D3BDC6 + 1252384
CoreFoundation 7519E999-1053-3367-B9D5-8844F6D3BDC6 + 7472
TestRotaryKnobProperties1 0x0000000100209040 +[B4I runDynamicMethod:method:throwErrorIfMissing:args:] + 1608
TestRotaryKnobProperties1 0x000000010022bd3c +[B4ILayoutBuilder runScripts:::] + 980
TestRotaryKnobProperties1 0x0000000100229e24 -[B4ILayoutBuilder resizeLayout::] + 768
TestRotaryKnobProperties1 0x00000001002277d8 __30-[B4IPanelView layoutSubviews]_block_invoke + 588
libdispatch.dylib B9D95EAB-9269-367D-B2F4-C2B45821A32D + 374288
libdispatch.dylib B9D95EAB-9269-367D-B2F4-C2B45821A32D + 377220
libdispatch.dylib B9D95EAB-9269-367D-B2F4-C2B45821A32D + 57744
CoreFoundation 7519E999-1053-3367-B9D5-8844F6D3BDC6 + 693732
CoreFoundation 7519E999-1053-3367-B9D5-8844F6D3BDC6 + 673240
CoreFoundation CFRunLoopRunSpecific + 464
GraphicsServices GSEventRunModal + 104
UIKitCore UIApplicationMain + 1936
TestRotaryKnobProperties1 0x00000001001eb320 main + 124
libdyld.dylib 7B531A15-3E73-3185-90E2-B88D9476DA5E + 4960
)
SignalHandler 6
 

Attachments

Erel

Administrator
Staff member
Licensed User
Doesn't happen here. Tested with the project in post #7.

Where does this come from:
TestRotaryKnobProperties1 0x00000001002038a4 -[B4IViewWrapper setLeft:] + 52
TestRotaryKnobProperties1 0x00000001001fd730 -[LS_main LS_general:::] + 244

?

The only designer script that I see is the call to AutoScaleAll.
 

james_sgp

Member
Licensed User
Erel, I was told not to use the B4xlib but rather the class as it wasnt for B4i (see my file on post 6).
 

klaus

Expert
Licensed User
Sorry, I posted an incomplete project, I made quite some tests and posted the wrong one.
Further tests show that the problem happens when using the class file in the project instead of the b4xlib.
Attached the 'new' project.
Then, removing the xRotaryKnob module, and using the xRotaryKnob.b4xlib the problem persists.
And then, commenting these two lines in Designer Script it works again.
'xRotaryKnob1.Left = 10
'xRotaryKnob1.Top = 50
 

Attachments

Erel

Administrator
Staff member
Licensed User
Further tests show that the problem happens when using the class file in the project instead of the b4xlib.
The b4xlib is the recommended way to use this library. If it works fine then we can close this issue.
 

james_sgp

Member
Licensed User
The b4xlib is the recommended way to use this library. If it works fine then we can close this issue.
Erel,

I cant try the B4XLib at the moment, as I`ve broken my app now with separating the panels out and making everything B4XView; I can`t get it to run.
 

james_sgp

Member
Licensed User
Guys,

I still get exactly the same problem in my Post 6 app, using the Class or the B4X library....? I`m pulling my freaking hair out now.... :(
 

klaus

Expert
Licensed User
You did Klaus...haha
I think that you misunderstood in my post: xRotaryKnob Class ! This is the title of the thread I was suggesting you.

The b4xlib is the recommended way to use this library. If it works fine then we can close this issue.
I don't think so.
The problem is that once you have used the class module, remove it and use the library, the problem persists?
That's what james_sgp is getting.
It works only when you remove the lines in the Designer Script as described in post#10.
 
Last edited:

Erel

Administrator
Staff member
Licensed User
I guess that a compiled resource was kept when you removed the module and switched to the library and caused this problem. Cleaning the project would have probably solved it.
 

klaus

Expert
Licensed User
I found the problem:
The original code:
B4X:
    Page1.RootPanel.LoadLayout("Main")
    NavControl.ShowPage(Page1)
It MUST be:
B4X:
    NavControl.ShowPage(Page1)
    Page1.RootPanel.LoadLayout("Main")
The LayoutLoad must be after ShowPage!

Cleaning the project would have probably solved it.
No, it didn't, I had tested it.
 

james_sgp

Member
Licensed User
Even I make a new clean project, and put B4X library in and cleaning before compiling....I`m getting same error!
 
Top