A simple and alternative way to achieve this is to call cycript and system (), however, please WARN the dangers of using the system () before using it, since it is potentially unsafe (which, in my opinion, is not so important on jailbroken iOS, where everything is pretty dangerous)
let's say you have a method like [[SomeClass sharedInstance] methodToBeCalledExternally] that you want to call from another process
you can save this call in a text file in /tmp/something.cy
then you enter this code from the outside by running:
cycript -p Music /tmp/something.cy
but if you need to do this programmatically, and, of course, if the environment is not isolated (I suppose it is not), you can do:
system("cycript -p Music /tmp/something.cy")
this way you can execute arbitrary ObjC code in any process (in this case, in the Music application) from your code.
finally, do not forget to delete the /tmp/something.cy file, as you no longer need it
Eric Castro
source share