Correct way to create a NSPredicate
===

i found 2 different ways to create a NSPredicate.

Way 1:

    NSExpression *exprName = [NSExpression expressionForKeyPath:@"name"];
    NSExpression *exprFilter = [NSExpression expressionForConstantValue: name ]; 
    NSPredicate *predicate = [NSComparisonPredicate predicateWithLeftExpression: exprName 
                                                                  rightExpression: exprFilter 
                                                                         modifier: NSDirectPredicateModifier  
                                                                             type: NSContainsPredicateOperatorType 
                                                                          options: NSCaseInsensitivePredicateOption];       
    
      

Way 2:  

    NSPredicate *predicate = [NSPredicate predicateWithFormat:@"name CONTAINS[c] %@", name];

What is the best way to create a NSPredicate and also prevent SQLInjection?