I’ve just started an iOS Xojo project and I’m running into obstacles. I want to have a picture backdrop on a view, and have a few buttons on that view, but the buttons are not responding to clicks in the simulator. It looks like I need iOS Kit from what I can glean on the forums here about this issue.
I’ve downloaded iOSLib from GitHub but the following error has me stumped. Am I doing something wrong or not added a component or something?
[quote]Linking Executable
ld: building for iOS, but linking against dylib built for OSX, file ‘/usr/lib/system/libdispatch.dylib’ for architecture x86_64[/quote]
Any ideas?
Edit: If forgot to mention I’m using the latest Xojo 2018r1.1 Pro.
Declare function userInteractionEnabled_ lib UIKitLib selector setUserInteractionEnabled: (obj_id as ptr, yesNo as Boolean)
userInteractionEnabled_(myImageView.Handle, True)
As for iOSKit - its a different thing than iOSLib. IOSKit is available at https://github.com/kingj5/IOSKit (link also in my signature). If you are familiar with git I recommend you fork the project so you can pull updates when they are made available. The project has some examples included but all you need to do is copy the Modules folder into your project for everything to be available.
Just another problem, is this supposed to be a function or a sub? This doesn’t work as a function. It complains about a return value. I changed it to a sub and it will compile, but the app crashes.
Whoops yeah should be a sub. I just threw it together on the forum yesterday. Can you show the crash log? I might have something else wrong in the declare.
Application Specific Information:
*** Terminating app due to uncaught exception ‘NSInvalidArgumentException’, reason: ‘-[XOJViewController setUserInteractionEnabled:]: unrecognized selector sent to instance 0x124603d40’
terminating with uncaught exception of type NSException
abort() called
CoreSimulator 518.22 - Device: iPhone 6s - Runtime: iOS 11.4 (15F79) - DeviceType: iPhone 6s
[code]Public Sub AllowUserInteraction(extends view as iOSView, assigns value as Boolean)
declare sub userInteractionEnabled_ lib “UIKit” selector “setUserInteractionEnabled:” (obj_id as ptr, yesNo as Boolean)
userInteractionEnabled_(view.Handle, value)
End Sub[/code]
This is view1 which is the view that loads on launch.
[code]Public Sub AllowUserInteraction(extends imgView as iOSImageView, assigns value as Boolean)
declare sub userInteractionEnabled_ lib “UIKit” selector “setUserInteractionEnabled:” (obj_id as ptr, yesNo as Boolean)
userInteractionEnabled_(imgView, value)
End Sub[/code]
You’re welcome Grant !
I consider this as an advanced feature, which is sort of hidden in the Apple iOS docs.
Just like on Desktop, there are some features that are only available using declares.
[quote]Linking Executable
ld: building for iOS, but linking against dylib built for OSX, file ‘/usr/lib/system/libdispatch.dylib’ for architecture x86_64[/quote]
I know what is wrong but I don’t know how to fix it.
Are you sure you have iOSKit installed? It is distinct from iOSLib.
Edit: And if you are using iOSLib you need to move to AppleLib instead I think. Ulrich said that he is no longer supporting iOSLib about 2 years ago. If there is something specific that you need in iOSLib that iOSKit doesn’t have I can see if that can be added as well. Trying to use them in the same project is difficult at best.
Sorry for not seeing this; my ISP created some outages during the last days for me and I must have missed the thread in the hundreds of mails that arrived later.
Please try to change to constant name to
/usr/lib/libSystem.dylib
I do not maintain this version of AppleLib anymore. I started a new one with better integration of shared code which is now on hold due to the changes API 2.0 will bring.
I’m trying to submit my iOS app to the Apple App Store, but I’ve received an email from Apple after submitting as follows:
[quote]Dear Developer,
We identified one or more issues with a recent delivery for your app, “XXXXXXX The App”. Please correct the following issues, then upload again.
Non-public API usage:
The app references non-public selectors in XXXXXXX-The App: cgColor, pointValue, rectValue, setInputFormat:forBus:, sizeValue, timeStamp, valueWithPoint:, valueWithRect:, valueWithSize:
If method names in your source code match the private Apple APIs listed above, altering your method names will help prevent this app from being flagged in future submissions. In addition, note that one or more of the above APIs may be located in a static library that was included with your app. If so, they must be removed.[/quote]
Please locate the getsizevalue, getrectvalue and getpointvalue external method declarations in AppleValue.
Duplicate them.
Uncheck the originals iOS checkboxes in Inspector.
Make sure the new copies have the same name (remove their 1s), und make their selectors
CGSizeValue, CGRectValue, CGPointValue
Check only their iOS check boxes.
Repeat the same with valuewithpoint, valuewithSize and ValuewithRect - name the iOS selectors
In AVAudioNode, remove the setter of the inputFormat property and the setinputformat external method. This is read-only.
The same should apply for outputformat. I wonder why that wasnt noted?
I cannot find selectors named cgColor and timestamp (with these exact cases) but I know the first one exists in iOSKit. Do you use it too?
EDIT: Now I could find timestamp:
Please locate AppleNSEvent und make the property Timestamp and the external method gettimestamp macOS-only.
For cgColor, still, I cannot find it but this selector should be named “CGColor”.
Thank you very much for your response, this has cleared up my app with only one problem left. Have you seen this one before? I can’t find the info.plist so I can modify it:
[quote]Dear Developer,
We identified one or more issues with a recent delivery for your app, “Full Credit Podcast The App”. Please correct the following issues, then upload again.
Missing Info.plist key - This app attempts to access privacy-sensitive data without a usage description. The app’s Info.plist must contain an NSMicrophoneUsageDescription key with a string value explaining to the user how the app uses this data.
[quote=400432:@Ulrich Bogun]Glad to hear that, Grant!
About the plist: There is none by default in your project, so you have to create it. See the LR.[/quote]
Just for clarity, what you are entering in the plist is a message that will appear to the user in the confirmation dialog which explains why your app wants access to the microphone.