RemoveControl Crashes

I’ve added a bunch of labels to a container control (as in: self.addControl(lbl).

When the user reorients the phone, I need to re-layout the screen. So, I tried to remove the controls (self.removeControl(lbl)). When I do so, Boom. No clue as to why.

Do you have a crash log to share?

Tim,

Good point. I’ll have to go figure out where it is.

However, I decided to approach the issue another way. So I think I’ll consider this question “on hold” for the moment.

The Crash Log:

Aug 31 06:37:29 bmp com.apple.CoreSimulator.SimDevice.44816E43-ADF2-486F-9732-8E1FC99F06C1[1470] (UIKitApplication:net.interrobanggroup.letters[6019][rb-legacy][1755]): Service exited due to SIGABRT

Known issue:
<https://xojo.com/issue/46165>

Well, at least I have an explanation.

Thanks.

I’m obviously seeing this same issue. What is the workaround? Re-create the entire container? Seems like a lot of work, but I don’t see any other way around it. This one has been hanging out for a while too - it was first reported in 2016…

Jon,

Why I ran into this: At the request of one my testers I added the ability to use the app sideways. I’m showing a potentially large list of words and they need to be arranged differently for portrait or landscape.

What I did: I made two copies of the container control. They are both of the same class, but it knows how to do the layout for both portrait and landscape. In the view’s resized event, I determine the orientation and show the appropriate container.

Hope this helps.

Yeah, I have a very different situation. I’m displaying a remote control panel for a video system. Depening on what the user wants to control the number of buttons may change, etc. I had is all working with the buttons on the view directly, but as Apple is now making you release for iPhone as well as iPad, I needed to make it iPhone compatible which means putting things on a scrollable area control. Now I have everything in a container control that’s on the scrollable area. I really want to remove every button and re-create them every time I make a change. I guess I’ll just remove the container and recreate it. Will probably work just fine…

But it’s one of those quirks in the iOS framework that needs some love.

Now that Web2.0 is out, I’m hoping iOS2 isn’t far behind but it’s probably still a year off…

1 Like