Get Updates By E-mail 

Article Written By:
Johann Dowa

Open Source Library Bringing Microsoft .NET Linq Style Queries To Objective-C Collections

  •  
  •  
  •  
  •  
  •  

Previously I mentioned the iOS-Queryable framework that provides a Microsoft .NET LINQ style syntax for creating core data queries.

Anton Bukov has created a project called NSEnumeratorLinq that aims to provide an API modeled after the Linq Enumerable API found in .NET providing an extensive number of methods for easier queries of Objectice-c collections.

Here’s an example from the NSEnumeratorLinq readme showing use of the library on an NSArray:

NSArray * arr = @[@1,@2,@3,@4,@5,@6,@7,@8];
NSArray * subarr = [[[[[arr objectEnumerator]                                // 1,2,3,4,5,6,7,8
                    where:^(id a){return [a intValue]%2 == 1}]               // 1,3,5,7
                    select:^(id a){return @([a intValue]*2)}]                // 2,6,10,14
                    where:^(id a){return [a intValue]>2 && [a intValue]<12}] // 6,10
                    allObjects];

You can find NSEnumeratorLinq on Github here.

There are many methods available that you’ll find listed on the Github page.


  •  
  •  
  •  
  •  
  •  

Submit A Resource

Have you created a useful tutorial, library or tool for iOS development that you would like to get in front of our 300,000+ monthly page views from iOS developers?

You can submit the url here.

The resources we feel will appeal to our readers the most will be posted on the front page.

Comments