Better HN
topnewbestaskshowjobs
Log inSign up

johnno1962

1 karma · joined Sep 6, 2012 (14y ago) · 4 submissions

Submissions

1.

Finally Real-time Objective-C code injection(injectionforxcode.com ↗)

1 points · by johnno1962 · 14y ago · discuss

comment 14y ago · link · parent

In fact there are some solutions out there for code injection using bundles on iOS, e.g. the following video:

http://vimeo.com/50137444

It packages it all up as a plugin for Xcode.

comment 14y ago · link · parent

Objective-C supports code replacement very well as it "run-time binds" selectors to method implementations. By injecting a bundle with a new implementation in a category it takes precedence over the original implementation as if the method had been "swizzled". The previous implementation linked into the app is taken out of play and ignored. This is all looked after by the application I mentioned. The complications seem to be minimal in my experience as long as you don't change the class interface...

comment 14y ago · link · parent

Code injection isn't impossible in Objective-C even on iOS, check out http://injectionforxcode.com/ or the write up by Erica Sadun here: http://www.tuaw.com/2012/05/10/devjuice-injection-for-xcode/