iOS Question Problem resetting TopLeftButtons to default

jo1234

Active Member
Licensed User
Longtime User
Hi,

I use this code to replace the default TopLeftButton with a Stop button:
B4X:
Dim b1 As BarButton
b1.InitializeText(trans.GetText("Stop"), "StopButton")
Page1.TopLeftButtons = Array(b1)
That works fine.

My question is: How can I reset the TopLeftButtons to default (i.e. the original "Back" button with swipe functionality)?

I tried
B4X:
Page1.TopLeftButtons.Clear
but that causes a crash.

Error occurred on line: 490 (scanner)
-[__NSArrayI removeAllObjects]: unrecognized selector sent to instance 0x146d3ce0
Stack Trace: (
CoreFoundation <redacted> + 150
libobjc.A.dylib objc_exception_throw + 38
CoreFoundation <redacted> + 0
CoreFoundation <redacted> + 714
CoreFoundation _CF_forwarding_prep_0 + 24
AppName 0x000bc1fb -[B4IList Clear] + 82
CoreFoundation <redacted> + 68
CoreFoundation <redacted> + 300
AppName 0x000b557d +[B4I runDynamicMethod:method:throwErrorIfMissing:args:] + 1928
AppName 0x0010468b -[B4IShell runVoidMethod] + 210
AppName 0x001039e3 -[B4IShell raiseEventImpl:method:args::] + 2002
AppName 0x00106871 -[B4IShellBI raiseEvent:event:params:] + 1316
AppName 0x000b4a5b __33-[B4I raiseUIEvent:event:params:]_block_invoke + 74
libdispatch.dylib <redacted> + 10
libdispatch.dylib <redacted> + 22
libdispatch.dylib _dispatch_main_queue_callback_4CF + 718
CoreFoundation <redacted> + 8
CoreFoundation <redacted> + 1512
CoreFoundation CFRunLoopRunSpecific + 476
CoreFoundation CFRunLoopRunInMode + 106
GraphicsServices GSEventRunModal + 136
UIKit UIApplicationMain + 1440
AppName 0x0006229d main + 116
libdyld.dylib <redacted> + 2
)

Any suggestions?
Thanks a lot!
 
Top