Over a million developers have joined DZone.
{{announcement.body}}
{{announcement.title}}

Injection for Xcode

DZone's Guide to

Injection for Xcode

· Mobile Zone
Free Resource

Download this comprehensive Mobile Testing Reference Guide to help prioritize which mobile devices and OSs to test against, brought to you in partnership with Sauce Labs.

Now here’s something we missed back earlier this year: Injection for Xcode!

Using Injection it is possible to make a change to the implementation of an Objective-C® class and have it take effect as soon as the class is saved without having to restart the application. This feature works for OS X and iOS applications in the simulator and on iOS devices.

Injection works by converting your classes into categories using a small set of preprocessor macros. This category can then be loaded at run time using a bundle. As Objective-C “binds” at runtime it will always chose the new implementation of the class over that which the application was last built with…

That sounds like pretty much the niftiest tool you’ve never heard of, doesn’t it? Unfortunately, seems like neither did anybody else, and Apple put it in the “we’ll just sit on this submission forever” limbo…

Screen Shot 2012-12-08 at 7.42.37 AM.png

… but hey, now it’s up on github for you!

h/t: @romainbriche!

Analysts agree that a mix of emulators/simulators and real devices are necessary to optimize your mobile app testing - learn more in this white paper, brought to you in partnership with Sauce Labs.

Topics:

Published at DZone with permission of Alex Curylo, DZone MVB. See the original article here.

Opinions expressed by DZone contributors are their own.

{{ parent.title || parent.header.title}}

{{ parent.tldr }}

{{ parent.urlSource.name }}