Guest User

Untitled

a guest
Feb 19th, 2018
63
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.75 KB | None | 0 0
  1. ///////////////////////hometext///////////////////////////
  2.  
  3. - (void)viewDidLoad {
  4.  
  5. hometext=[[UITextField alloc]initWithFrame:CGRectMake(10, 80, 300, 30)];
  6. [hometext setBackgroundColor:[UIColor clearColor]];
  7. [hometext setTextColor:[UIColor blackColor]];
  8. //[hometext setBorderStyle:[ UITextBorderStyleRoundedRect]];
  9. hometext.borderStyle=UITextBorderStyleRoundedRect;
  10. hometext.keyboardType = UIKeyboardTypeURL;
  11. [hometext setFont:[UIFont fontWithName:@"Helvetica" size:14 ]];
  12. hometext.placeholder=@"Type or paste the URL of your web app";
  13. hometext.autocorrectionType = UITextAutocorrectionTypeNo;
  14. [self.hometext setReturnKeyType:UIReturnKeyDone];
  15. [self.hometext addTarget:self
  16. action:@selector(textFieldShouldReturn:)
  17. forControlEvents:UIControlEventEditingDidEndOnExit];
  18.  
  19. hometext.returnKeyType = UIReturnKeyDone;
  20. [self.view addSubview:hometext];
  21.  
  22.  
  23.  
  24.  
  25.  
  26. UIImage *img = [UIImage imageNamed:@"Done.png"];
  27.  
  28. done=[[UIButton alloc]init];
  29. // [done setTitle:@"Done" forState:UIControlStateNormal];
  30. [done setImage:img forState:UIControlStateNormal];
  31. done.backgroundColor=[UIColor clearColor];
  32. [done addTarget:self action:@selector(back)
  33. forControlEvents:UIControlEventTouchUpInside];
  34. [done setFrame:CGRectMake(130, 400, 100, 40)];
  35. [self.view addSubview:done];
  36.  
  37.  
  38. }
  39.  
  40.  
  41.  
  42.  
  43. -(void)back{
  44.  
  45. NSLog(@"hhhh");
  46. str=[NSString stringWithFormat:@"my data is %@",self.barcodetext.text];
  47. BarCodeAppViewController *ob = [[BarCodeAppViewController alloc] initWithString:str];
  48.  
  49. if(str==nil){
  50.  
  51. //NSLog(@"hhhh");
  52.  
  53. }
  54. [self presentModalViewController:ob animated:YES];
  55.  
  56.  
  57. // BarCodeAppViewController *ob = [[BarCodeAppViewController alloc] init];
  58. // [self presentModalViewController:ob animated:YES];
  59.  
  60. }
Add Comment
Please, Sign In to add comment