0

これは新しいもので、特定の UITableView セルがタッチされた場合にリンクをロードしようとしています。

-(void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event 
{
  NSDictionary *dic = [NSJSONSerialization JSONObjectWithData:responseData options:0 error:nil];
  NSArray *deals = [dic objectForKey:@"deals"];
  NSDictionary *dealOne = [deals objectAtIndex:0];
  NSString *url = [dealOne objectForKey:@"url"];

  UITouch *touch = [[event allTouches] anyObject];

  if([touch isKindOfClass:[UITableViewCell class]])
  {
    UITableViewCell *cell;
    CGPoint location = [touch locationInView: self.view];
    cell.center = location;

    [[UIApplication sharedApplication] openURL:[NSURL URLWithString:url]];
  }
  NSLog(@"TABLECELL TOUCHED");
}
4

1 に答える 1