iOS Question B4xRotary problem with Designer Script

james_sgp

Active Member
Licensed User
Longtime 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

Active Member
Licensed User
Longtime 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:
Upvote 0

james_sgp

Active Member
Licensed User
Longtime 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

  • rotary Error.zip
    277.1 KB · Views: 154
Upvote 0

klaus

Expert
Licensed User
Longtime 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

  • TestRotaryKnobProperties1.zip
    2.5 KB · Views: 141
Upvote 0

james_sgp

Active Member
Licensed User
Longtime 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).
 
Upvote 0

klaus

Expert
Licensed User
Longtime 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

  • TestRotaryKnobProperties11.zip
    65.4 KB · Views: 135
Upvote 0

klaus

Expert
Licensed User
Longtime 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).
Who told you this?
The xRotaryKnob.b4xlib is cross-platform.
In your post HERE, you posted in the RotaryKnobView which is B4A only and I suggested you to look at the xRotaryKnob Class.
 
Upvote 0

james_sgp

Active Member
Licensed User
Longtime User

Attachments

  • Capture.PNG
    Capture.PNG
    41 KB · Views: 130
Upvote 0

james_sgp

Active Member
Licensed User
Longtime 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.
 
Upvote 0

james_sgp

Active Member
Licensed User
Longtime 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.... :(
 
Upvote 0

klaus

Expert
Licensed User
Longtime 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:
Upvote 0

klaus

Expert
Licensed User
Longtime 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.
 
Upvote 0

james_sgp

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