I want to use contents of String or Array in an IF ELSE statement for iphone
- by Michael Robinson
I want to check to see if an array is empty to activate a shipping method.
Here is the code for returning 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];
I want to write something like:
if NSString *fullFileName ="" ;
[nnNEP EnableShipping];
else
[nnNEP DisableShipping];
OR
if array contents ="" ;
[nnNEP EnableShipping];
else
[nnNEP DisableShipping];
I just can't find the right or description on how to do this properly.
Thanks,