How do I write an IF ELSE to check string contents of an array?
- by Michael Robinson
I'm trying to write an IF ELSE statement to enable shipping, If user doesn't add an address the array contents remain as "-" & "-" for the two items in the array. I want to check to see if those are in the array, if they are then I want to enableshipping.
Here is the code for getting the array:
NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);
NSString *documentsDirectory = [paths objectAtIndex:0];
NSString *fullFileName = [NSString stringWithFormat:@"%@/arraySaveFile", documentsDirectory];
NSMutableArray *array = [[NSMutableArray alloc] initWithContentsOfFile:fullFileName];
How do I write this first line to look for the "-" & "-"?
if ([fullFileName isEqualToString:@"-","-"])
{
[nnNEP EnableShipping];
}
else {
[nnNEP DisableShipping];
}
Thanks,
michael