iphone - NSString caused EXC_BAD_ACCESS, string too long? -
when app gets this, receive exc_bad_access
nsstring *namedata = nametextfield.text; nsstring *emaildata= emailtextfield.text; nsstring *phonedata = phonetextfield.text; nsstring *servicedata = servicetextview.text; nsstring *post = [nsstring stringwithformat:@"email_address=&contents=&form_identifier=538b7271-df83-41f5-84b0-db0fed518ade&form_type=1&empty_form_msg=please%20fill%20in%20something%20before%20submitting.&1_1_10_40_first%2bname=%@&2_1_20_30_last%2bname=&3_1_25_25_company=&4_1_30_999_email=%@&5_1_40_10_phone=%@&6_1_50_0_address%2b1=&7_1_60_-10_address%2b2=&8_1_70_-20_city=&9_3_80_-30_county=&10_3_90_-40_postcode=&11_2_100_-50_comments=%@&submit=send",namedata,emaildata,phonedata,servicedata]; is because data in string long?
i suspect stringwithformat interprets (some of?) % characters format elements, more 4 arguments interpreted. (e.g. %20f take float argument)
try replace literal % (i.e. %@) %%. string format specifiers summarizes format supported nsstring.
Comments
Post a Comment