ios - EXC_BAD_ACCESS issue on iphone and simulator -


i getting exc_bad_access out side of own code. code gets url through shareurlcache object , starts url connection. once leave method starts url connection hit exc_bad_access. have tried using instruments find zombies , have analysed memory leaks , not turned either. @ point stuck.

here code loads url , starts url connection

- (void)locationmanager:(cllocationmanager *)manager  didupdatetolocation:(cllocation *)newlocation         fromlocation:(cllocation *)oldlocation {     nslog(@"at new location: %@",newlocation);      mkcoordinateregion region =              mkcoordinateregionmakewithdistance([newlocation coordinate], 750, 750);      [mapview setregion:region animated:yes];     [location stopupdatinglocation];      cllocationcoordinate2d coord = [newlocation coordinate];     nsurl *url = [urlcache getreccomendationforuid:@"12345" atlat:coord.latitude                                           atlon:coord.longitude forcategories:nil];       // create request.     nsurlrequest *request = [nsurlrequest requestwithurl:url                                          cachepolicy:nsurlrequestuseprotocolcachepolicy                                      timeoutinterval:60.0];   // create connection request // , start loading data     connection = [[nsurlconnection alloc] initwithrequest:request delegate:self startimmediately:yes];     if (connection) {         // create nsmutabledata hold received data.         // xmldata instance variable declared elsewhere.         xmldata = [[nsmutabledata alloc]init];     } else {         nslog(@"could not create connection");     } } 

method sharedurlcache returns url

-(nsurl *)getreccomendationforuid:(nsstring *)u atlat:(double)lat atlon:(double)lon forcategories:(nsarray *)cat {     if(remote) {         nsmutablestring *categories = [[nsmutablestring alloc]init];         for(nsstring *s in cat) {             [categories appendstring:@"&cat="];             [categories appendstring:s];         }         nsstring *s = [nsstring stringwithformat:@"%@/recommendation?uid=%@&psw=null&lat=%f&lon=%f?%@",                    apiroot,u,lat,lon,categories];         [categories release];         return [nsurl urlwithstring:s];     } else {         return [[nsbundle mainbundle] urlforresource:@"xmltest" withextension:@"xml"];;     } } 

just start commenting out code , running see if can mem error disappear start adding code again until appears, have better idea issue is. anywhere in code since seem have number of objects in there not passed in e.g. 'location'.

[location stopupdatinglocation]; 

Comments

Popular posts from this blog

php - What is the difference between $_SERVER['PATH_INFO'] and $_SERVER['ORIG_PATH_INFO']? -

fortran - Function return type mismatch -

queue - mq_receive: message too long -