• The Info.plist is just a file, there's nothing you can modify or hook into directly to change its values after it's been loaded. I don't think an app's Info.plist is kept anywhere in nested array/dictionary form, and even if it is, most likely iOS will only read the value from there once and store it in a private property/ivar/whatever for quicker access. So if you want to modify an Info.plist setting at runtime, you'd probably need to find where its value is stored internally, and modify that.

  • @scj643 re: blocks, you can always add instance variables (functions are objects in python).

    def myblk(blk, arg): if myblk.x: return myblk.x myblk.x=2 ... blk=ObjCBlock(myblk)

    It would be nice to have a ObjCBlock as decorator:

    @ObjCBlock(argtypes=[c_void_p], restype=None) def myfun(blk, someargs): ...

    Also, you can have blocks that live as instance methods:

    class MyDelegate(object): ... def myblock(self,_blk): ... print(self.x) ... def __init__(self): ... self.x=10 ... >>> m=MyDelegate() >>> m.blk=ObjCBlock(m.myblock,argtypes=[c_void_p]

    This can let you associate other objects with a particular block, to avoid the need for globals.

  • I think I already mentioned this in the past, but just in case I'll link to it here again: https://github.com/dgelessus/pythonista-c-utils. The C preprocessor part might be useful for you, to handle the conditional blocks and macro definitions and expansion. For the rest, you might be able to expand https://pypi.python.org/pypi/pycparser so it understands Objective-C syntax.

  • I did a quick translation of the code to run with objc_utils

    from objc_util import ObjCClass, ObjCBlock, c_void_p, ns, ObjCInstance def getData(_cmd, pedometerData, error): ped = ObjCInstance(pedometerData) if not error == None: err = ObjCInstance(error) print('error===='+str(err)) else: print('Steps===='+str(ped.numberOfSteps())) print('Distance===='+str(ped.distance())) ped_block = ObjCBlock(getData, restype=None, argtypes=[c_void_p, c_void_p, c_void_p]) CMPedometer = ObjCClass('CMPedometer') NSDate = ObjCClass('NSDate') ped = CMPedometer.alloc().init() if CMPedometer.isStepCountingAvailable(): fromDate = NSDate.dateWithTimeIntervalSinceNow_(-60*60*24*2) toDate = NSDate.dateWithTimeIntervalSinceNow_(-60*60*24*1) ped.queryPedometerDataFromDate_toDate_withHandler_(ns(fromDate),ns(toDate),ped_block) else: print('Unavailable')

    I hope it helps.

  • @JonB - Have you joined Slack yet?

  • yes, you could use transforms inside layout... i had some code for detecting orientation in my RootView class https://github.com/jsbain/objc_hacks

    you can also specify a single orientation in present, which is supposed to lock orientation.

  • @scj643 , yes. Backup/restore methods to whatever service. Or at least some popular services.

  • Definately not.

  • New trace back error log

    Traceback (most recent call last):
    File "<string>", line 1, in <module>
    File "/private/var/mobile/Containers/Shared/AppGroup/5FD2FDE6-F810-4A9A-B188-772796B31F62/Documents/site-packages/music21/init.py", line 167, in <module>
    from music21 import * # @UnresolvedImport # pylint: disable=wildcard-import
    File "/private/var/mobile/Containers/Shared/AppGroup/5FD2FDE6-F810-4A9A-B188-772796B31F62/Documents/site-packages/music21/abcFormat/init.py", line 47, in <module>
    from music21.abcFormat import translate
    File "/private/var/mobile/Containers/Shared/AppGroup/5FD2FDE6-F810-4A9A-B188-772796B31F62/Documents/site-packages/music21/abcFormat/translate.py", line 32, in <module>
    from music21 import stream
    File "/private/var/mobile/Containers/Shared/AppGroup/5FD2FDE6-F810-4A9A-B188-772796B31F62/Documents/site-packages/music21/stream/init.py", line 44, in <module>
    from music21 import metadata
    File "/private/var/mobile/Containers/Shared/AppGroup/5FD2FDE6-F810-4A9A-B188-772796B31F62/Documents/site-packages/music21/metadata/init.py", line 51, in <module>
    from music21.metadata import caching
    File "/private/var/mobile/Containers/Shared/AppGroup/5FD2FDE6-F810-4A9A-B188-772796B31F62/Documents/site-packages/music21/metadata/caching.py", line 414, in <module>
    class WorkerProcess(multiprocessing.Process): # @UndefinedVariable pylint: disable=inherit-non-class
    AttributeError: 'module' object has no attribute 'Process'

  • If you are talking about the list of values down the right hand side of a tableview. I have created a uitableview implementation with objc_utils it doesn't currently implement a delegate or all of the data source protocol but might help you out if you want to implement your own.

    https://gist.github.com/shaun-h/e86a8a3b5ea2ca16f136

  • The soft tabs and show mixed indentation options in Pythonista give you the best of both worlds. I always keep them both turned on. It is kind of anachronistic that all the example scripts use tabs.

Internal error.

Oops! Looks like something went wrong!