1
我有过简单的UI按钮分配一个值麻烦:对象不能设置 - 无论是只读属性或没有setter发现
//Assume rect is defined
rect = CGRectMake(13, 10, 48, 48);
profileButton = [[UIButton alloc] initWithFrame:rect];
profileButton.buttonType = UIButtonTypeCustom;
我收到“对象不能设置 - 要么只读当试图将buttonType分配给UIButtonTypeCustom时,只有属性或setter发现“。
该诀窍。初始化时我需要记住这一点。谢谢! –