This could be streamlined as if([args count] > 2) { args = [args subarrayWithRange:NSRangeMake(0,1)];}