2010-12-15 36 views

Répondre

0

Qu'en est-

if ([string length] <= 0) 
0

utilisent ce

if (str == NULL)

0

vous pouvez utiliser

if(!textField.text.length) 

ou

if([txtField.text isEqualToString:@""]) 
0
The Below code will check for the empty textfield and even for the whitespaces. 

NSString *firstNameWithNoSpaces = [firstNameTxtField.text stringByReplacingOccurrencesOfString:@" " withString:@""]; 
    if (![firstNameWithNoSpaces length] <= 0) { 
} 
0

vous pouvez également utiliser cette

if([textfield.text isEqualToString:@""] || textfield.text== nil)