I get an error like & ldquo; Assignment to read only property & rdquo; In UIView

If VIN is an text field this code works for me to Hiding keyboard without breaking UITextField functionality..

UIView *dummyView = [[UIView alloc] initWithFrame:CGRectMake(0, 0, 1, 1)];
VIN.inputView = dummyView;

But in another case i need to do same thing for UIVIEW.. it is possible to do for UIView ?

UIView *dummyView = [[UIView alloc] initWithFrame:CGRectMake(0, 0, 1, 1)];
VIN.inputView = dummyView;

In this case VIN Is an UIView.. i am getting error like "Assignment to read only property".


UITextfield has inputview. Default inputview is keyboard. uiview has not input view that you can set so you can't assign input view to UIView.

And for hiding keyboard you should call resignFirstresponder like,

 [myTextField resignFirstResponder];

This will hide keyboard and when you click textfield it will show keyboard again so you should do like this.

Hope this will help :)