Home:ALL Converter>Can a UIView be a UITextField Delegate

Can a UIView be a UITextField Delegate

Ask Time:2011-03-20T06:18:07         Author:Blane Townsend

Json Formatter

I am getting a sigabrt error when I try to set the delegate of my UITextField to my UIView class. I have used the UITextFieldDelgate Protocal. here is my code

    nameField = [[UILabel alloc] initWithFrame:CGRectMake(130, 40, 200, 30)];
    [nameField setDelegate:self];
    nameField.placeholder = @"<Game Name>";
    nameField.textAlignment = UITextAlignmentCenter;
    [self addSubview:nameField];

Author:Blane Townsend,eproduced under the CC 4.0 BY-SA copyright license with a link to the original source and this disclaimer.
Link to original article:https://stackoverflow.com/questions/5365304/can-a-uiview-be-a-uitextfield-delegate
yy