我在應用中創了帶Button的IBOutletCollect:
@property (retain, nonatomic) IBOutletCollection(UIButton) NSArray *allButtons;
現在需要改一下這些按鈕的位置和框架:
[_allButtons makeObjectsPerformSelector:@selector(setFrame:) withObject: ????? ];
怎麼設置值?我用的方法編譯器報錯:
[_allButtons makeObjectsPerformSelector:@selector(setFrame:) withObject:CGRectMake(10, 0, 0, 10)];
CGRect不是對象,所以不能直接添加,把它放到NSValue中:
[NSValue valueWithCGRect:]
看一下NSValue的說明