Advertisement
Guest User

Untitled

a guest
Feb 22nd, 2019
73
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.61 KB | None | 0 0
  1. NSArray* bundle = [[NSBundle mainBundle] loadNibNamed:@"QnA" owner:self options:nil];
  2.  
  3. QuestionAnswer *qa;
  4. for (id object in bundle) {
  5. if ([object isKindOfClass:[QuestionAnswer class]])
  6. qa = (QuestionAnswer *)object;
  7. }
  8.  
  9. CGRect f = qa.frame;
  10. f.origin.x = x;
  11. f.origin.y = y;
  12. qa.frame = f;
  13. [self.view addSubview: qa];
  14. [qa setup:[questions objectAtIndex:i ]];
  15.  
  16. -(void)setup:(NSString *)label
  17. {
  18. self.afl.text = label;
  19. UITapGestureRecognizer *tgr = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(imageTapped:)];
  20. tgr.delegate = self;
  21. [self addGestureRecognizer:tgr];
  22.  
  23. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement