iOSKit now building with API2.0

Thanks to the help of @Greg_O_Lone iOSKit will now compile in 2020r2.1. There are still deprecation warnings that will be addressed in the future, but you will no longer see compiler errors. If you are using iOSKit and a Xojo version that does not yet support API2 on iOS an “API1-compatible” branch is now available for you since the “master” branch now supports API2.

As always you can get it here:

13 Likes

Thanks very much Jason for such great efforts to support iOS. I have taken a project that works on 2019r3.2 and tried to get it to compile on 2020r2.1 with your latest version of iOSKit. I get 4 errors that I can’t resolve.
AVFoundation.AVAudioPlayer.Name - Can’t import “Xojo” because its member “Data” would conflict with “data” that is already defined in this block
Foundation.NSData.Name has the same error message
Foundation.NSMutableData.Name has the same error message
Foundation.NSData.Operator_Convert, Line 5 - There is more than one method with this name but this does not match any of the available signatures.

Thanks for any hints.

I guess you have simple references enabled in your project.
The errors can easily be fixed by renaming the Data methods to DataValue

Data is now a reserved word for method names in some cases.

2 Likes

The following changes to iOSKit may break something at some time but I can now compile and the app seems to run correctly.
AVFoundation.AVAudioPlayer property “data” of class NSData–changed name to “dataValue”
Foundation.NSData shared method “Data”–changed name to “DataValue”
Foundation.NSMutableData shared method “Data”–changed name to “DataValue”

Foundation.NSDate.Operator_Convert (note NSDate NOT NSData in original post)–the line causing compile error was:
Dim d As New DateTime(timeIntervalSince1970(Self), TimeZone.Current)
I don’t see anything wrong but TimeZone is optional in constructor so removed it and error stopped.

After implementing the changes @C_T_Baumgartner suggested, my Xojo 2020R2.1 project, converted from a running Xojo 2020R1.2 iOS project, gives me an error while compiling. The Message is “This item does not exist”, but no clue as to which item that error is refering to, as none are shown in the Errors section. It’s hard to fix a non existing item if no hint is provided on what it is referring to.
@Jason_King : Any idea how to find out what is causing this?

I suggest turning off simple references. It hides a great deal of things, including errors.

Thanks Greg. I’m going to ask a possibly stupid question; where do I switch them off?

Never mind. I overlooked it but found it. :relaxed:

1 Like

Maybe I am stupid, but in Xojo 2020R2.1, I don’t see a Shared Build setting called Simple References off. I do in 2020R1.2, but it’s gone in 2020R2.1

I’ll have to look as I’m not at my desk yet today.

Turns out the switch was removed:

62569 IDE » Inspector To prevent confusion between API 2.0 class names and classes in the Xojo namespaces, we do not display the Simple References setting in the iOS Shared Build settings for OS projects created in 2020r2 or later. It will default to OFF.

So they should be off by default, yet I’m getting no error explanation.

if it’s not in the errors section, is it a dialog?

Yes, here’s a screenshot


So just the error message, with no clue where.

Ah. Errors like that are typically from a plugin, whether ours or a 3rd party.

Ok, any suggestions on how to analyse what is causing it? I don’t use plugins, but do use iOSKit from @Jason_King as without it, Xojo lacks too many features. I’d like to start using Xojo 2020R2.1 as my app compiled with Xojo2020R1.2 running on iOS13 and 14 is suffering from what seems to be a memory leak, that it does not have on iOS12.
Basically, the app gets slower on iOS 13 and 14 each time I return to the main View after closing another View. On iOS12 it runs fine.
Not being able to compile on Xojo2020R2.1 means I cannot support iOS 13 and 14 properly.
As a suggestion on how to get iOSKit working, @Jason_King suggests switching off simple references, but as they are off by default, that’s not an option. Ideas anyone?

I might suggest you submit a feedback case so Xojo can take a look at your project. Some new iOS features are in plugins and perhaps there is an issue with one of those you are now using?

Yeah, we will need to see your project to sort that out.

OK, I will submit a ticket and make the app available.

Created Feedback case 63386 with the project as a zipped attachment.

1 Like