iOSLib

  1. 2 weeks ago

    Grant S

    Jul 7 Pre-Release Testers, Xojo Pro Sydney, Australia
    Edited 2 weeks ago

    Greetings and I hope everyone is well.

    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?

    Linking Executable
    ld: building for iOS, but linking against dylib built for OSX, file '/usr/lib/system/libdispatch.dylib' for architecture x86_64

    Any ideas?

    Edit: If forgot to mention I'm using the latest Xojo 2018r1.1 Pro.

    Cheers
    Grant

    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.

  2. Jason K

    Jul 8 Pre-Release Testers

    What you need is:

    Declare function userInteractionEnabled_ lib UIKitLib selector “setUserInteractionEnabled:” (obj_id as ptr, yesNo as Boolean)
    
    userInteractionEnabled_(myImageView.Handle, True)

    As for iOSKit - it’s 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.

  3. Grant S

    Jul 9 Pre-Release Testers, Xojo Pro Sydney, Australia

    Jason,

    Thanks for your input.

    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.

    Any thoughts?

    Cheers
    Grant

  4. Jason K

    Jul 9 Pre-Release Testers

    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.

  5. Grant S

    Jul 9 Pre-Release Testers, Xojo Pro Sydney, Australia
    Edited 2 weeks ago

    Jason,

    Yes this might be what you're looking for:

    Crashed Thread:        0  Dispatch queue: com.apple.main-thread
    
    Exception Type:        EXC_CRASH (SIGABRT)
    Exception Codes:       0x0000000000000000, 0x0000000000000000
    Exception Note:        EXC_CORPSE_NOTIFY
    
    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
    
    Application Specific Backtrace 1:
    0   CoreFoundation                      0x0000000106ec51e6 __exceptionPreprocess + 294
    1   libobjc.A.dylib                     0x0000000104948031 objc_exception_throw + 48
    2   CoreFoundation                      0x0000000106f46784 -[NSObject(NSObject) doesNotRecognizeSelector:] + 132
    3   UIKit                               0x00000001005676db -[UIResponder doesNotRecognizeSelector:] + 295
    4   CoreFoundation                      0x0000000106e47898 ___forwarding___ + 1432
    5   CoreFoundation                      0x0000000106e47278 _CF_forwarding_prep_0 + 120
    6   FullCredit.debug                    0x0000000100027912 iOSExtensions.=$AllowUserInteraction%%o<iOSView>b + 354
    7   FullCredit.debug                    0x0000000100030c24 View1.View1.Event_Open%%o<View1.View1> + 132
    8   FullCredit.debug                    0x0000000100014a6d iOSView.Constructor%%o<iOSView> + 1389
    9   FullCredit.debug                    0x000000010002768d iPhoneScreen.Event__Layout%%o<iPhoneScreen> + 269
    10  FullCredit.debug                    0x0000000100012861 iOSScreen.Constructor%%o<iOSScreen> + 113
    11  FullCredit.debug                    0x00000001000359dc _MakeDefaultScreen + 268
    12  FullCredit.debug                    0x0000000100035bae _Startup + 110
    13  rbframework.dylib                   0x0000000106bce13d GetIOSAppWindowHandle + 670
    14  UIKit                               0x00000001003306fb -[UIApplication _handleDelegateCallbacksWithOptions:isSuspended:restoreState:] + 278
    15  UIKit                               0x0000000100332172 -[UIApplication _callInitializationDelegatesForMainScene:transitionContext:] + 4123
    16  UIKit                               0x00000001003375cb -[UIApplication _runWithMainScene:transitionContext:completion:] + 1677
    17  UIKit                               0x00000001006f9f7e __111-[__UICanvasLifecycleMonitor_Compatability _scheduleFirstCommitForScene:transition:firstActivation:completion:]_block_invoke + 866
    18  UIKit                               0x0000000100acca39 +[_UICanvas _enqueuePostSettingUpdateTransactionBlock:] + 153
    19  UIKit                               0x00000001006f9bba -[__UICanvasLifecycleMonitor_Compatability _scheduleFirstCommitForScene:transition:firstActivation:completion:] + 236
    20  UIKit                               0x00000001006fa3db -[__UICanvasLifecycleMonitor_Compatability activateEventsOnly:withContext:completion:] + 675
    21  UIKit                               0x000000010106b614 __82-[_UIApplicationCanvas _transitionLifecycleStateWithTransitionContext:completion:]_block_invoke + 299
    22  UIKit                               0x000000010106b4ae -[_UIApplicationCanvas _transitionLifecycleStateWithTransitionContext:completion:] + 433
    23  UIKit                               0x0000000100d4f75d __125-[_UICanvasLifecycleSettingsDiffAction performActionsForCanvas:withUpdatedScene:settingsDiff:fromSettings:transitionContext:]_block_invoke + 221
    24  UIKit                               0x0000000100f4a4b7 _performActionsWithDelayForTransitionContext + 100
    25  UIKit                               0x0000000100d4f627 -[_UICanvasLifecycleSettingsDiffAction performActionsForCanvas:withUpdatedScene:settingsDiff:fromSettings:transitionContext:] + 223
    26  UIKit                               0x0000000100acc0e0 -[_UICanvas scene:didUpdateWithDiff:transitionContext:completion:] + 392
    27  UIKit                               0x0000000100335eac -[UIApplication workspace:didCreateScene:withTransitionContext:completion:] + 515
    28  UIKit                               0x0000000100908bcb -[UIApplicationSceneClientAgent scene:didInitializeWithEvent:completion:] + 361
    29  FrontBoardServices                  0x000000010a0682f3 -[FBSSceneImpl _didCreateWithTransitionContext:completion:] + 331
    30  FrontBoardServices                  0x000000010a070cfa __56-[FBSWorkspace client:handleCreateScene:withCompletion:]_block_invoke_2 + 225
    31  libdispatch.dylib                   0x0000000107c3b709 _dispatch_client_callout + 8
    32  libdispatch.dylib                   0x0000000107c408c1 _dispatch_block_invoke_direct + 317
    33  FrontBoardServices                  0x000000010a09c470 __FBSSERIALQUEUE_IS_CALLING_OUT_TO_A_BLOCK__ + 24
    34  FrontBoardServices                  0x000000010a09c12e -[FBSSerialQueue _performNext] + 439
    35  FrontBoardServices                  0x000000010a09c68e -[FBSSerialQueue _performNextFromRunLoopSource] + 45
    36  CoreFoundation                      0x0000000106e67bb1 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 17
    37  CoreFoundation                      0x0000000106e4c4af __CFRunLoopDoSources0 + 271
    38  CoreFoundation                      0x0000000106e4ba6f __CFRunLoopRun + 1263
    39  CoreFoundation                      0x0000000106e4b30b CFRunLoopRunSpecific + 635
    40  GraphicsServices                    0x000000010734ba73 GSEventRunModal + 62
    41  UIKit                               0x0000000100339057 UIApplicationMain + 159
    42  rbframework.dylib                   0x0000000106bce7bd GetIOSAppWindowHandle + 2334
    43  FullCredit.debug                    0x0000000100001f0d Xojo._RuntimeRun + 29
    44  FullCredit.debug                    0x0000000100035efd _Main + 749
    45  FullCredit.debug                    0x00000001000351e3 main + 19
    46  libdyld.dylib                       0x0000000107cb0955 start + 1
  6. Jason K

    Jul 9 Pre-Release Testers

    What is your code where you call that? It looks like you are passing the iOSView in. You need to instead pass the actual image view object’s handle.

  7. Grant S

    Jul 9 Pre-Release Testers, Xojo Pro Sydney, Australia

    I set it in the open event using this extension:

    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

    This is view1 which is the view that loads on launch.

    Cheers
    Grant

  8. Jeremie L

    Jul 9 Pre-Release Testers, XDC Speakers Europe (France)

    This should work:

    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
  9. last week

    Grant S

    Jul 11 Pre-Release Testers, Xojo Pro Sydney, Australia

    Jeremie,

    Thank you so much for your reply. Yes this worked. Moving on.

    I'm now wondering why stuff like this is not already built into Xojo??

    Cheers
    Grant

  10. Jeremie L

    Jul 11 Pre-Release Testers, XDC Speakers Europe (France)
    Edited last week

    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.

  11. Grant S

    Jul 11 Pre-Release Testers, Xojo Pro Sydney, Australia

    My original problem still remains:

    Linking Executable
    ld: building for iOS, but linking against dylib built for OSX, file '/usr/lib/system/libdispatch.dylib' for architecture x86_64

    I know what is wrong but I don't know how to fix it.

    Cheers
    Grant

  12. Jason K

    Jul 11 Pre-Release Testers
    Edited last week

    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.

  13. Jeremie L

    Jul 11 Pre-Release Testers, XDC Speakers Europe (France)

    Do you still need iOSLib ?

    Maybe @Ulrich B can help

  14. Ulrich B

    Jul 11 Pre-Release Testers, Xojo Pro Answer Europe (Germany, Berlin) · xo...

    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.

  15. Grant S

    Jul 12 Pre-Release Testers, Xojo Pro Sydney, Australia

    Ulrich,

    Thanks!! This is now working and my app is looking awesome!!

    Cheers
    Grant

or Sign Up to reply!