Fascinating... To be honest, I didn't expect this to work at all. I downloaded the Objective-C framework from realm.io, signed it on the Mac, using
codesign -s "iPhone Developer" Realm.framework
(the version in ios/dynamic – this obviously requires that you have a valid iOS code signing identity in your keychain)
...then I copied the signed framework to Pythonista, and tried the following:
from objc_util import *
NSBundle = ObjCClass('NSBundle')
bundle = NSBundle.bundleWithPath_('Realm.framework')
loaded = bundle.load()
print 'Framework loaded: %s' % loaded
RLMObject = ObjCClass('RLMObject')
print RLMObject
I haven't done anything else with it, and to be honest, I have my doubts if this particular framework will be of much use in Pythonista (the lack of block support in objc_util might be limiting), but it's still pretty amazing that the technique seems to work in general. Thanks @jan4843!
I've also tried an unsigned version of the framework. In that case, the load() method returned False (which I expected), but I'm not sure if there's a requirement that a loaded framework is signed by the same key as the app that loads it (which is obviously not a problem for me, but it wouldn't work for others if that's the case).