0
我創建了簡單的iPhone應用程序。我發送數據到Web服務。第一次當我調試應用程序硬編碼日期是這樣的:NSString總是相同的值問題
NSString *TA_DAY = @"5/6/2009 11:00:00 AM";
只是爲了檢查是否可以,它的工作原理。但下一次,我改變了這一行:
NSString *TA_DAY = @"11/23/2010 11:00:00 AM";
當調試TA_DAY是'11/23 ......」但是當它來到數據庫是‘5/6 ......’ 我添加[TA_DAY發佈]但沒有。任何想法我做錯了什麼?
好吧,我發現那裏的問題,但不知道該怎麼辦究竟:這是我如何發送數據:
int TA_COUNTER = 666090;
NSString *TA_DAY = @"6/2/2009 11:00:00 AM";
NSString *TA_FILEREF = @"sad";
NSString *TA_PICKUPHOUR = @"12/12/2009 11:00:00 AM";
NSString *TA_DLVRYCOMPANY = @"sps";
NSString *TA_AIRLINE = @"BA";
NSString *TA_AGREEMENT = @"";
...
NSString *soapMsg =
[NSString stringWithFormat:
@"<?xml version=\"1.0\" encoding=\"utf-8\"?>"
"<soap:Envelope xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\" xmlns:soap=\"http://schemas.xmlsoap.org/soap/envelope/\">"
"<soap:Body>"
"<AddTaxiVoucher xmlns=\"http://??????????/\">"
"<ta_counter>%i</ta_counter>"
"<ta_day>%@</ta_day>"
"<ta_fileref>%@</ta_fileref>"
"<ta_pickuphour>%@</ta_pickuphour>"
"<ta_dlvrycompany>%@</ta_dlvrycompany>"
"<ta_airline>%@</ta_airline>"
"<ta_agreement>%@</ta_agreement>"
"</AddTaxiVoucher>"
"</soap:Body>"
"</soap:Envelope>",TA_COUNTER,TA_DAY,TA_FILEREF,TA_PICKUPHOUR,TA_DLVRYCOMPANY,TA_AIRLINE];
但不知何故TA_PICKUPHOUR保存在數據庫中,其中TA_DAY應保存。我在這裏做錯了什麼?
但再次...這是肥皂按摩我發送給WService:
<?xml version="1.0" encoding="utf-8"?><soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"><soap:Body><AddTaxiVoucher xmlns="http://??????/"><ta_counter>666090</ta_counter><ta_day>6/2/2009 11:00:00 AM</ta_day><ta_fileref>sad</ta_fileref><ta_pickuphour>12/12/2009 11:00:00 AM</ta_pickuphour><ta_dlvrycompany>AKS</ta_dlvrycompany><ta_airline>BA</ta_airline><ta_agreement></ta_agreement><ta_name>VLADA</ta_name><ta_address1>Trg Topolivaca</ta_address1><ta_address2></ta_address2><ta_telephone>064 333 444</ta_telephone>...
你可以顯示你如何更新你的數據庫的代碼? – 2010-11-23 16:12:40