I finally had access to an iOS development device this week. Unlike the other platforms, I didn’t have any prior experience developing for it. So I spent some time familiarizing myself with the tools and stuff. This process was mostly painless but did end up consuming some time.
I also setup my kivy-ios tool chain for the first time. After a couple hello-world programs and fixing minor typos in the examples code, I then moved on to further explore pyobjus for writing Plyer facades. I worked on a new version of the accelerometer example that was not dependent on
bridge.m supplied with all kivy-ios packages by default. When I am done moving all the sensors we could do away with the classes contained in the bridge (note to self!).
While playing with this code, I also noticed something interesting on the Xcode dashboard:
Xcode visualizations helps find otherwise unsuspected errors such as the memory leak here – pic.twitter.com/iEEnK2d23t
— Gaurav Trivedi (@trivedigaurav) August 1, 2014
Turns out that we had a hit a major bug in Pyobjus that was causing the memory allocated for
accelerometerData to leak. In fact this would happen everywhere you’d otherwise need to use something like
@autoreleasepool in your Objective C code. Pyobjus objects didn’t account for cases like these. Tito suggested a fix for the issue but is still working on finalizing it.
Meanwhile, I also created another iOS facade for retrieving battery status. Although it was a fairly short one to code but I did have to learn many background things before I could finish that. I hope that this will make it easy for me to finish the other facades in the coming weeks.