I have solved the problem creating a hide textfield that become the first responder when the viewcontroller is created. After I have did the same viewController the delegate of this text field. When the BT codebar reader do a read he makes a return at the end so it calls the - (BOOL)textFieldShouldReturn: where I process the information. I hope that will be usefull for someone in the futur with the same problem. I post the code:
_textSender = [[UITextField alloc] initWithFrame:CGRectMake(150, 300, 300, 25)];
[_textSender setBackgroundColor:[UIColor whiteColor]];
[self.view addSubview:_textSender];
_textSender.hidden=YES;
[_textSender becomeFirstResponder];
_textSender.delegate=self;
- (BOOL)textFieldShouldReturn:(UITextField *)textField{
[messageSenderProtocolDelegate message:textField.text];
return YES;
}
It's not a beatiful way to do it and it gives me a little problem, when the BT barcode disconnects the keyboard appears and that's not good for me. I want my view clean without keyboards all the time. Now I will research if it's a function that is called when the keyboard shows to prevent him to be show
If someone have any advice it will be usefull but say thanks for your help Erik!