我已创建此代码
NSString *insertSQL = [NSString stringWithFormat:@"Update Expense_Group set Expense_sum = Expense_sum-\%@\ where Expense_Type_Id = \"%@\"",strExpAmount,current_Expense_TypeId];
现在,我收到此警告“未知转义序列'\ x20'”。
答案 0 :(得分:1)
您只需要“\
”在“stringWithFormat:
”通话中转义引号...
答案 1 :(得分:0)
NSString *insertSQL = [NSString stringWithFormat:@"Update Expense_Group set Expense_sum = Expense_sum-%@ where Expense_Type_Id = %@",strExpAmount,current_Expense_TypeId];
这可以解决%@之前不需要转义序列的问题。
答案 2 :(得分:0)
NSString *insertSQL = [NSString stringWithFormat:@"Update Expense_Group set Expense_sum = Expense_sum-'%@' where Expense_Type_Id = '%@'",strExpAmount,current_Expense_TypeId];