NSString is empty

You can try something like this:

@implementation NSString (JRAdditions)

+ (BOOL)isStringEmpty:(NSString *)string {
   if([string length] == 0) { //string is empty or nil
       return YES;
   } 

   if(![[string stringByTrimmingCharactersInSet:[NSCharacterSet whitespaceAndNewlineCharacterSet]] length]) {
       //string is all whitespace
       return YES;
   }

   return NO;
}

@end

Check out the NSString reference on ADC.

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)