I can probably shed some light here.
As much as Xojo wants you to think that you can just copy and paste controls, there are some complications.
Part 1: When you copy a control in one project, what gets put on the clipboard is a binary representation of the control. Because there’s no way to know what the destination is going to be, every property and their default values are also included. Now, if you were to paste back into the same type of project, using the very same IDE, everything’s going to work perfectly. However, if the project type changes (or the Xojo version changes a lot) things get a little trickier. You see, the IDE stores the values for all of those properties in a dictionary, and when you paste, that dictionary is just populated with everything from the clipboard. Again, the IDE doesn’t know where the data is coming from.
Part 2: When a project is rendered, prior to compiling, all of the properties currently attached to each control is rendered into an initialization method that is called when a control is first starting up. So if you had a dictionary that looks like this
{
One: 1,
Two: “2”,
Three: True
}
This special hidden initializer might look like this:
Self.One = 1
Self.Two = “2”
Self.Three = True
Since the iOS project is years more mature than Android, there’s bound to be properties that don’t exist on Android that do on iOS, but the IDE doesn’t know that and just dutifully renders all of the properties. This of course causes compile issues because while “Three” existed in an iOS project, it doesn’t on Android, but it may in the future. This retention of properties is actually intentional, and it supports the backward & forward compatibility of the IDE, so it’s not as simple as just stripping them out.
What I suggest is that you follow these steps until the IDE stops making changes. It’ll be easier to track if you’re using version control…
- Save the project as text
- Close the project
- Make a note of any changes
- Open the project
- In the navigator, select a control on a layout that’s giving you trouble and then make a change of some sort, just pressing left & right keys would be enough. Just something to mark the control as “dirty”
- Go to step 1
Repeat this process until the IDE stops making changes and then commit the changes to your version control system.
Note: because that method that initializes the properties only exists during rendering, if a syntax error is encountered, you’ll get a strange error about the problem being in the “name” property of the object. 99.9% of the time you get that compile error, it’s in one of the rendered methods. If you’re really stumped, reach out to Xojo. They can run your project and find out what the offending item is.