I am having trouble over simply assigning a value to a UI Button:
//Assume rect is defined
rect = CGRectMake(13, 10, 48, 48);
profileButton = [[UIButton alloc] initWithFrame:rect];
profileButton.buttonType = UIButtonTypeCustom;
I am getting “object cannot be set – either read-only property or setter found” when trying to assign the buttonType to UIButtonTypeCustom.
This is because
buttonTypeis a read-only property. You can only create buttons of a specific type withbuttonWithType:.(Not knowing what
profileButtonis, but assuming it is not a retaining property)