The Code Jedi

Using OData from Objective-C - Fixing the odatagen NSRangeException bug

Lately, I've been working on getting a small sample project up and running on the iOS platform, and using an OData endpoint for external data access. Fortunately, the OData site is an incredibly useful resource for a vast array of information, from both the publisher and consumer perspective. There is even an office Microsoft OData helper project for Objective-C which lives over on Codeplex.

Part of this toolkit is an incredibly indispensible tool, which in its simplest form, can generate your entity classes (.h and .m files) from the OData Metadata. So in theory, if you wanted to generate the entities for the Netflix catalog API, all you need to do is call it as such:
./odatagen /uri= /out=~/Projects/MyNetflixApp