0

カスタムオブジェクトを作成し、タグを使用してアクセスしたいと思いました。私はこれを非カスタムNSObjectに対して何百万回も実行しましたが、以前は機能していましたが、カスタムNSObjectに対しては機能しませんでした。足りないものはありますか?

    dataSplash* splashO = [[dataSplash alloc]initWithFrame:CGRectMake....;
    splashO.tag = 201;
    [self.view addSubview:splash0];

そして私はそれに触れてアクセスしようとし始めました

-(void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event{

    UITouch *touch = [touches anyObject];
    int tagOfView = touch.view.tag ;
    ....
}

タグは常にゼロであると常に言われます。

4

0 に答える 0