I want to use contents of String or Array in an IF ELSE statement for iphone

Posted by Michael Robinson on Stack Overflow See other posts from Stack Overflow or by Michael Robinson
Published on 2010-03-19T03:17:16Z Indexed on 2010/03/19 3:21 UTC
Read the original article Hit count: 205

Filed under:
|
|
|

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,

© Stack Overflow or respective owner

Related posts about nsstring

Related posts about iphone