重複の可能性:
iPhone Dev - NSString の作成
私は使っている
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 = [[NSStrin@"Date and Time field is required."];
}
私がNsstring *str_Message=nil;を使用する場合、その代わりに。'
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 * str;の効果と違いは何ですか。Nsstring *str=nil