I'm doing some kind of finding my device using this code:
NSOperationQueue* quququ;
int i=0;
for (i=0; i<256; i++) {
//NSLog(@"%i",i);
NSString *url=[NSString stringWithFormat:@"http://%i.%i.%i.%i/",myip1,myip2,myip3,i];
//NSLog(@"urlGET = %@", url);
NSURLRequest* request = [NSURLRequest requestWithURL:[NSURL URLWithString:url] cachePolicy:NSURLRequestUseProtocolCachePolicy timeoutInterval:1];
[NSURLConnection sendAsynchronousRequest:request queue:quququ completionHandler:^(NSURLResponse *respons, NSData *data, NSError *error) {
//do smth
NSLog(@"data: %ld bytes. res: %@, error: %@", (long)[data length], respons, error);
}];
what am i doing wrong? i receive the "exc_bad_access" error.