omz:forum

    • Register
    • Login
    • Search
    • Recent
    • Popular

    Welcome!

    This is the community forum for my apps Pythonista and Editorial.

    For individual support questions, you can also send an email. If you have a very short question or just want to say hello — I'm @olemoritz on Twitter.


    [Solved] XCode Template with objc_util module ...

    Pythonista
    objcutil xcode template
    3
    6
    4863
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • Brun0oO
      Brun0oO last edited by Brun0oO

      Hi,

      I've built a sample using objc_util module and I deployed it on my device (using a personal team signing certificate).
      When I start the application on my device, it fails on a "load_framework" command.
      The script runs without any problem on Pythonista, it fails 'only' when he is invoked from the xcode template.
      Could you give me an explanation please ? Is it possible to use load_framework within the xcode template ?

      Thank you..

      1 Reply Last reply Reply Quote 0
      • JonB
        JonB last edited by

        StackOverflow says:
        https://stackoverflow.com/questions/24333981/ios-app-with-framework-crashed-on-device-dyld-library-not-loaded-xcode-6-beta

        Apparantly Brandon's response is the one to follow

        1 Reply Last reply Reply Quote 0
        • Brun0oO
          Brun0oO last edited by

          @JonB : the link you provided is very interesting but in my case, it's the command "load_framework" that is throwing an exception not the framework itself.... so I got :

          load_framework('SceneKit')
          NameError : name 'load_framework' is not defined
          

          I've tried to add the SceneKit framework using the Brandon's method but I got the same error...
          The crazy thing is that the same script runs perfectly under the pythonista editor...

          FYI : I'm using a python 2.7 script with iOS 11.1 / XCode 9.1 Beta and my device is an iPhone 6S+

          1 Reply Last reply Reply Quote 0
          • dgelessus
            dgelessus last edited by

            It's possible that the objc_util version in the Xcode template doesn't have the load_framework function yet - it's relatively new, I'm not sure if it's even in any App Store release yet. The function is implemented in pure Python code though, so you can copy it from your iPhone's objc_util.py to the Xcode template's objc_util.py.

            1 Reply Last reply Reply Quote 0
            • JonB
              JonB last edited by

              Oh, I misread your original post. This is the load_framework from objc_util.

              def load_framework(name):
              	return NSBundle.bundleWithPath_('/System/Library/Frameworks/%s.framework' % (name,)).load()
              
              1 Reply Last reply Reply Quote 0
              • Brun0oO
                Brun0oO last edited by

                @dgelessus : you're right ! I've extracted objc_util.py from my current Pythonista and have copied it to the XCode Template project (PythonistaAppTemplate/PythonistaKit.framework/pylib/site-packages directory ). Now, I can test my app :o)

                @JonB : I don't need to add the framework I want to load in my xcode project. I've removed the framework in the xcode project and my app can be launched without any problem...Perhaps as it's an Apple framework, I don't need to add it....My xcode knowledge is a little low ;o)

                Thank you for your help...

                1 Reply Last reply Reply Quote 1
                • First post
                  Last post
                Powered by NodeBB Forums | Contributors