Generics are a popular and useful feature of many programming languages, but at this stage do not yet exist within Objective-C.
Some time ago I mentioned a library called NanoProfiler that makes it easy to profile the speed of a specific method.
Here’s another interesting library from the same developer, Tomer Shiri, called Objective-C Generics that provides a macro based implementation of basic generics using Objective-C.
Here’s an image showing how you can use generics with arrays just like in Java or C# with Objective-C Generics:
You can find Objective-C Generics on Github here.
A nice addition to Objective-C.
- Open Source: Macros And Additions For Making Objective-C Coding More Concise
- The Objective-C 2.0 @ Compiler Directives Cheat Sheet
- Open Source Library For Super Fast Fuzzy NSString Matching
- Easy To Use Objective-C Library For Basic Communications With An FTP Server
- Open Source iOS Library Providing Automatic NSCoding Support For Your Objects
Original article: Open Source Library Providing Basic Generics Within Objective-C
©2013 iOS App Dev Libraries, Controls, Tutorials, Examples and Tools. All Rights Reserved.