-1
qr 코드가 대리자가 실행되는 것을 감지하면 qrar SDK를 사용합니다.이 대리자 내에서 myView를 정의하고 해당 qr 코드에 대한 정보가있는 카메라의 오버레이로 사용했습니다. myView 내부에 메서드 (testAction)를 호출하는 버튼이 있지만이 메서드 내부에서 델리게이트에서 정의한 객체에 액세스 할 수 없으며 testAction 내부의 myView 및 객체에 어떻게 액세스 할 수 있습니까?델리게이트 내부에서 메서드 호출
- (void) imagePickerController: (UIImagePickerController*) reader
didFinishPickingMediaWithInfo: (NSDictionary*) info
{
UIView *myView;
CGRect frame= CGRectMake(0, 0, 320, 428);
myView=[[UIView alloc] initWithFrame:frame];
myView.backgroundColor=[UIColor greenColor];
myView.alpha=0.7;
CGRect labelFrame = CGRectMake(0, 0, 500, 30);
UILabel* myLabel = [[UILabel alloc] initWithFrame: labelFrame];
[myLabel setTextColor: [UIColor orangeColor]];
NSString *combined = [NSString stringWithFormat:@"%@%@", @"Title: ", symbol.data];
myLabel.text=combined;
UIButton * myButton = [UIButton buttonWithType:UIButtonTypeRoundedRect];
myButton.frame = CGRectMake(10, 50, 100, 50);
myButton.tag = 121;
[myButton setTitle:@"Do Something" forState:UIControlStateNormal];
[myButton setBackgroundImage:nil forState:UIControlStateNormal];
[myButton addTarget:self action:@selector(testAction:) forControlEvents:UIControlEventTouchUpInside];
//[button setBackgroundColor:red];
[myView addSubview: myLabel];
[myView addSubview: myButton];
reader.cameraOverlayView=myView;
}
- (void)testAction: (id)sender{
//my issue is here
}
OMG 때때로 뇌 그냥 잠! – user2211254