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.


    New Xcode Template (beta)

    Pythonista
    13
    31
    35309
    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.
    • dvader9
      dvader9 last edited by

      Note that the simple crash in the TableView UI from the ui-tutorial, as reported here is fixed in this latest Xcode template.

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

        @omz, Thank you.
        now canvas is OK.

        The result of the last line's 'print "Selected File ="...' in this " file selection script " is not displayed.

        It displays in v1.5 or Pythonista IDE.
        Does this script is wrong ?

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

          UI works fine, but it possible to end the UI with the two fingers gesture which leaves the app in an unusable state. Is it possible to add a configuration switch for disabling the gesture or to disable it when running as separate app outside pythonista?

          Files dropped in the Script folder are read only in the documents folder after 'xCoding' (?) How can I add a file which I want to edit or to replace from outside (f.ex. a database file updated via iTunes/UIFileSharing)?

          Regards Tom

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

            @tomkirn

            UI works fine, but it possible to end the UI with the two fingers gesture which leaves the app in an unusable state. Is it possible to add a configuration switch for disabling the gesture or to disable it when running as separate app outside pythonista?

            I have that on my todo list.

            Files dropped in the Script folder are read only in the documents folder after 'xCoding' (?) How can I add a file which I want to edit or to replace from outside (f.ex. a database file updated via iTunes/UIFileSharing)?

            If I understand you correctly, the easiest way would be to enable iTunes file sharing for the app. Just open the Info.plist file in the project, add a new row (select the last row and click the '+' button), enter UIFileSharingEnabled as the key, and select YES for the value. When you deploy the app to a device now, it should show up in iTunes' file sharing interface.

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

              @OMZ: That's exactly what I have done.....and it is not my problem.

              An example: in folder scripts I have three files (main.py, main.pyui, bes.db). All the files will be placed in the documents folder and can be accessed in iTunes. So far it is working well.

              Now I replaced the bes.db via iTunes and start the program again. Surprise! The new bes.db will be overwritten with the old one and is gone. Another look into documents will show up the old version again.

              Have I done something wrong?

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

                OMZ,

                Thanks so much for your effort. I can get an app to build, but when I try to add the .ipa to my device (ad hoc via iTunes) it says that it cannot be added because it's not a valid app.

                I have a valid bundle ID, the info.plist looks OK, I can't figure out what it is. My PyCharm/Kivy-ios builds and techBASIC builds work fine.

                Any thoughts?

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

                  OMZ,

                  FYI, I just replaced your info.plist with one from a working kivy-ios project and that works OK. Update: A newbie error I guess -- apparently the LS key LSRequiresIPhoneOS is required to build an app!

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

                    Love the new template! One thing: I can't seem to get the Pythonista 1.6/iOS 8 document picker in the dialogs module to work. Launching it makes my app crash. Any suggestions?

                    Thanks!

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

                      Quick tip: one of the differences between the previous template and this latest one, is that the "Skip Install" flag in the Build settings is set to Yes. This means that when you create an App Archive for submitting to the store, it doesn't automatically export it to your Organizer Tool.

                      I haven't gone through the whole pipeline with this project template yet: script in Pythonista on the iDevice -> porting script to Xcode -> debugging in Xcode -> submitting to store -> distributing on store; it's not a priority for me at this point, but I have been playing with some of the settings. You've given us a good tool, @omz, to learn Xcode at a very superficial level, thanks. Anybody gone through the whole pipeline yet?

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

                        @dvader9: I've done ad hoc deployment to local iPads. The template works well on the few examples I've tried. The modifications I had to make to the info.plist file are the "LSRequiresIPhoneOS" key as I mentioned above and that "Skip Install" flag in the Build Settings that you mentioned.

                        The kids in my class will soon be creating apps for submission -- I'll let everyone know how that goes.

                        @OMZ: Thanks again for all your work!

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

                          I was this close to posting a bug report about how I couldn't run the vanilla template. But then I read the part about using a non-64 bit simulator.

                          Anyways. THIS IS AWESOME! I'm excited.

                          Oh yea - will this not work for UI generated using the 1.5 version of pythonista?

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

                            @omz This is probably a question directly for you.

                            When running an app built with the Xcode template, the launch screen/image is shown and then a screen similar to the Pythonista console is shown for a few seconds. After that the app starts.

                            I assume the console-like screen is loading up Python and all your code, but is there a way to overwrite this screen and possibly continue to show the launch screen/image defined in Xcode (or a custom image of some sort)? This would make the transition from launch screen to app much smoother looking.

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

                              I was also curious about the question above. Not having a smoother transition from splash screen to app could hurt overall ux. @andymitchhank have you tried dropping the splash screen? Do you still see the "load" page so to speak?

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

                                @jfryznke Just tested your idea and, unfortunately, the load page was still visible for a few seconds before the application loaded.

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

                                  @andymitchhank hmmm, hopefully @omz has a solution. I haven't come across this anywhere else in the forums or in my own experience using pythonista/xcode. I haven't taken anything COMPLETELY through the pipeline yet, so I'm not sure if I would encounter a similar problem but I love to troubleshoot before I get there and help others troubleshoot to learn from their experience. Keep me posted on your progress and I'll update you if I have a similar issue.

                                  In my other xcode experiences using a language other than obj c, I've never seen/heard something like this...it is intriguing.

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

                                    I haven't worked with the most recent XCode template, but my experience with the prior one is the same. My splash screen shows up, then everything goes blank for a second or 2, then my interface appears.

                                    I would really prefer that my splash screen remain visible till my first UI update takes place. Is there some way to force that to happen?

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

                                      @jesse so do you just experience a blank screen for a brief moment or a page filled with code?

                                      I feel that just a blank screen for a few moments is less of an issue than the problem @andymitchhank cited

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

                                        Hi guys - I have some really strange behavior going on, and it's probably not related to the template, but I don't know so I thought I would see if you guys can draw on your immense wisdom to come up with some "obvious" answer. I don't want you guys to debug my code or anything, just please let me know if there's something obvious I'm missing.

                                        So I have my app running inside pythonista 1.6 latest perfectly. I have it working in the template out of xCode as well. I'm using mysqldb.
                                        At one point in my code I have a try except clause that attempts to cursor.execute("....") to create the table we'll be using and it excepts if that table already exists. (the table DOES already exist, and should except.)

                                        Inside the pythonista app, it goes straight to the except clause like it should, "Table couldn't be created..." and proceeds as normal. Wierdness: Inside the xCode simulator however, it gets stuck at "....trying table creation"

                                        AND HERE'S the SUPER WIERDNESS:

                                        inside the simulator it will remain stuck trying to execute the database call UNTIL I RUN THE APP FROM THE PHONE. So as soon as I run the app on my phone it gets the simulator unstuck and moving past the except clause like it should...

                                        huh. (I added the ip address of my mac to the amazon rds security group, but that doesn't seem to have any effect)

                                        Any thoughts?

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

                                          That's very strange...the iOS simulator should be completely disconnected from the physical iOS device. Just a few questions: when you run the script on your physical iOS device to unfreeze the simulator, are you running it within Pythonista or as a standalone app compiled with Xcode? Also, is your physical iOS device connected to the computer running the simulator? If so, is it a wired or wireless connection? Does your physical iOS device appear in Xcode as a potential target to run the template (with your script filled in) on alongside the iOS simulator? One last set of questions: this may sound dumb, but which of your devices (specifically your computer running the simulator and your physical iOS device) are connected to the Internet? Does your script connect to any server at all, or can it be run, with nothing disabled, when completely offline? Does your script use Bluetooth at all, perhaps with the cb module in the Pythonista 1.6 beta? This may seem like a lot to ask for, but I honestly have no idea what could possibly make something like this happen, so I want to narrow down the possibilities as much as, well, possible (I can't possibly think of a possible synonym for "possible" right now, so yeah).
                                          Also, make sure to remember that @omz hasn't yet released a template for the latest Pythonista 1.6 betas (the old template doesn't support features like the appex or sk modules), and there might be under-the-hood changes that break other stuff between the old template and the new betas. Don't say I didn't warn you ;-).

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

                                            Answers:
                                            On my iPhone 6 plus, it's running from within Pythonista. Internet access is necessary for the script - doesn't work at all if offline. It doesn't seem to matter whether the phone's connected through LTE or wifi - the behavior persists. The Mac is connected through wifi, and all network functionality works. No Bluetooth module being used.

                                            Update: xCode Beta 7. Will try xCode 6 and see how it goes.

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