我编写了一些代码来获取我想要在 ARC 中使用的格式的字符串,我得到了 EXC_BAD_ACCESS(code=2 address=0x100)。
这里的代码:
NSString *inCook = [NSString stringWithFormat:@"GETAFREE_AUTH_HASH=%@; GETAFREE_USER_ID=%@", FRLAuthHash, FRLUserID];
NSLog(@"%@",inCook);
NSString *cookie1 = [[NSString alloc]init];
cookie1 = [NSString stringWithFormat:@"__utma=138759908.342110698.1339513728.1347619146.1347628547.51; __utmz=138759908.1339513728.1.1.utmcsr=google|utmccn=(organic)|utmcmd=organic|utmctr=(not%20provided); __atuvc=0%7C33%2C0%7C34%2C0%7C35%2C16%7C36%2C50%7C37; GETAFREE_REFERRAL_URL=https%3A%2F%2Fwww.freelancer.com%2Fusers%2Fonlogin.php; _chartbeat2=skcgjvrzgugx7kr0.1339513733066.1347628548930.00000000000001; WRUID=0; session2=6d909115a69f37ff641d798045d6f252; __qca=P0-624434954-1344332147605; FL_DASHBOARD_VIEWPAGE_4164248=sellerview; FL_DASHBOARD_TABINDEX_4164248=6; GETAFREE_LANGUAGE=en; __utmc=138759908; __utmb=138759908.1.10.1347628547; SpryMedia_DataTables_project_table_=%7B%22iCreate%22%3A1347628548100%2C%22iStart%22%3A0%2C%22iEnd%22%3A0%2C%22iLength%22%3A10%2C%22sFilter%22%3A%22%22%2C%22sFilterEsc%22%3Atrue%2C%22aaSorting%22%3A%5B%20%5B7%2C%22desc%22%5D%5D%2C%22aaSearchCols%22%3A%5B%20%5B%22%22%2Ctrue%5D%2C%5B%22%22%2Ctrue%5D%2C%5B%22%22%2Ctrue%5D%2C%5B%22%22%2Ctrue%5D%2C%5B%22%22%2Ctrue%5D%2C%5B%22%22%2Ctrue%5D%2C%5B%22%22%2Ctrue%5D%2C%5B%22%22%2Ctrue%5D%2C%5B%22%22%2Ctrue%5D%2C%5B%22%22%2Ctrue%5D%2C%5B%22%22%2Ctrue%5D%2C%5B%22%22%2Ctrue%5D%2C%5B%22%22%2Ctrue%5D%2C%5B%22%22%2Ctrue%5D%2C%5B%22%22%2Ctrue%5D%2C%5B%22%22%2Ctrue%5D%2C%5B%22%22%2Ctrue%5D%5D%2C%22abVisCols%22%3A%5B%20false%2Ctrue%2Cfalse%2Ctrue%2Ctrue%2Ctrue%2Ctrue%2Ctrue%2Ctrue%2Cfalse%2Cfalse%2Cfalse%2Cfalse%2Ctrue%2Cfalse%2Cfalse%2Cfalse%5D%7D"];
NSString *cookie2 = [NSString stringWithFormat:@"%@; %@",cookie1,inCook];
NSLog(@"%@",cookie2);
我在这条线上得到了 EXC_BAD_ACCESS:
cookie1 = [NSString stringWithFormat:@"__utma=138759908.342110698.1339513728.1347619146.1347628547.51; __utmz=138759908.1339513728.1.1.utmcsr=google|utmccn=(organic)|utmcmd=organic|utmctr=(not%20provided); __atuvc=0%7C33%2C0%7C34%2C0%7C35%2C16%7C36%2C50%7C37; GETAFREE_REFERRAL_URL=https%3A%2F%2Fwww.freelancer.com%2Fusers%2Fonlogin.php; _chartbeat2=skcgjvrzgugx7kr0.1339513733066.1347628548930.00000000000001; WRUID=0; session2=6d909115a69f37ff641d798045d6f252; __qca=P0-624434954-1344332147605; FL_DASHBOARD_VIEWPAGE_4164248=sellerview; FL_DASHBOARD_TABINDEX_4164248=6; GETAFREE_LANGUAGE=en; __utmc=138759908; __utmb=138759908.1.10.1347628547; SpryMedia_DataTables_project_table_=%7B%22iCreate%22%3A1347628548100%2C%22iStart%22%3A0%2C%22iEnd%22%3A0%2C%22iLength%22%3A10%2C%22sFilter%22%3A%22%22%2C%22sFilterEsc%22%3Atrue%2C%22aaSorting%22%3A%5B%20%5B7%2C%22desc%22%5D%5D%2C%22aaSearchCols%22%3A%5B%20%5B%22%22%2Ctrue%5D%2C%5B%22%22%2Ctrue%5D%2C%5B%22%22%2Ctrue%5D%2C%5B%22%22%2Ctrue%5D%2C%5B%22%22%2Ctrue%5D%2C%5B%22%22%2Ctrue%5D%2C%5B%22%22%2Ctrue%5D%2C%5B%22%22%2Ctrue%5D%2C%5B%22%22%2Ctrue%5D%2C%5B%22%22%2Ctrue%5D%2C%5B%22%22%2Ctrue%5D%2C%5B%22%22%2Ctrue%5D%2C%5B%22%22%2Ctrue%5D%2C%5B%22%22%2Ctrue%5D%2C%5B%22%22%2Ctrue%5D%2C%5B%22%22%2Ctrue%5D%2C%5B%22%22%2Ctrue%5D%5D%2C%22abVisCols%22%3A%5B%20false%2Ctrue%2Cfalse%2Ctrue%2Ctrue%2Ctrue%2Ctrue%2Ctrue%2Ctrue%2Cfalse%2Cfalse%2Cfalse%2Cfalse%2Ctrue%2Cfalse%2Cfalse%2Cfalse%5D%7D"];
里面的值只是从我从网站上捕获的内容中复制和粘贴。
谁能告诉我做错了什么?
非常感谢