ios - NSPredicate to arrange NSMutableArray Objects? -


I have a list of multiple categories (about 45). I want to show some categories like before (helicopter, lake monster, dinosaur attack), which will be the second coming after this rematch. I have used the following code.

It works fine but its length so I want to filter this code.

  NSPredicate * predicate = [NSPredicate predicateWithFormat: @ "SELF IN% @", @ [@ "helicopter", @ "Lake Monster", @ "Dinosaur invasion"]]; NSPredicate * predicate1 = [NSPredicate predicateWithFormat: @ "[CD]% @ in package name, @" helicopter "]; NSPredicate * predicate2 = [NSPredicate predicateWithFormat: @ "[CD]% @ in package name", @ "lake monster"]; NSPredicate * predicate3 = [NSPredicate predicateWithFormat: @ "[CD]% @ in package name", @ "Dinosaur attack"]; NSMutableArray * filteredArray = [[NSMUTABELARROL] INST]; NSArray * arr1 = [Using Filtered Areas: predicate1]; NSArray * arr2 = [Using Filtered Horizets Using: predicate2]; NSERE * AR3 = [Filtered Areas Using Project: Pridet 3]; [Filtered array object: [AR1 ObjectTitx: 0] etndex: 0]; [Filtrated array dot object: [AR2 objectoutx: 0] andx: 1]; [Filtrated Array Dot Object: [AR3 ObjectOut Index: 0] andx: 2]; [Package deleted object: [arr1 objectAtIndex: 0]]; [Package deleted object: [arr2 objectAtIndex: 0]]; [Package Deleted Object: [AR3 ObjectOut Indices: 0]];  

Is there any way to achieve this result with at least the method?

Just clean your own code, you can do the following:

  NSPredicate * predicate1 = [NSPredicate predicateWithFormat: @ "[CD]% @ in package name, @" helicopter "]; NSPredicate * predicate2 = [NSPredicate predicateWithFormat: @ "[CD]% @ in package name", @ "lake monster"]; NSPredicate * predicate3 = [NSPredicate predicateWithFormat: @ "[CD]% @ in package name", @ "Dinosaur attack"]; NSMutableArray * filteredArray = [[NSMUTABELARROL] INST]; (NSPredicate * predicate @ [predicate1, predicate2, predicate3]) {NSArray * arr = [Filter Filtered Applications Use: Forecasting]; [Filtered array add object: ARR [0]]; [Package removed object: ARR [0]]; }  

Comments

Popular posts from this blog

ios - How do I use CFArrayRef in Swift? -

eclipse plugin - Run java code error: Workspace is closed -

c - Error on building source code in VC 6 -