我正在使用以下代码查找我的设备:
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);
}];
我究竟做错了什么?我收到“exc_bad_access”错误。