我使用
NSString *str_Message;
if ([txt_NoOfPersons.text length] == 0){
bln_Validate = FALSE;
str_Message = [[NSString alloc]initWithString:@"Number of Persons field is required."];
}
else if ([txt_NoOfPersons.text intValue] == 0)
{
bln_Validate = FALSE;
str_Message = [[NSString alloc]initWithString:@"Please enter your guest count."];}
}
if ([txt_DateAndTime.text length] == 0)
{
bln_Validate = FALSE;
str_Message = [[[email protected]"Date and Time field is required."];
}
insted的的,如果我使用的NSString * str_Message =零;'
if ([txt_NoOfPersons.text length] == 0)
{
bln_Validate = FALSE;
str_Message = @"Number of Persons field is required.";
}
else if ([txt_NoOfPersons.text intValue] == 0)
{
bln_Validate = FALSE;
str_Message = @"Please enter your guest count.";
}
那么会是怎样的效果是什么的NSString *海峡之间的差异; Nsstring * str = nil
我想知道它们之间的区别是什么只设置它为零删除垃圾值 – saurabh