怎么样:
- (IBAction)enableDecimalValues
{
NSArray *combinedArray =
[nonOctalValueCollection
arrayByAddingObjectsFromArray:nonBinaryValueCollection];
[combinedArray makeObjectsPerformSelector:@selector(setEnabled:)
withObject:[NSNumber numberWithBool:YES]];
[combinedArray makeObjectsPerformSelector:@selector(setAlpha:)
withObject:[NSNumber numberWithFloat:1.0f]];
}
或者:
- (IBAction)enableDecimalValues
{
NSArray *combinedArray =
[nonOctalValueCollection
arrayByAddingObjectsFromArray:nonBinaryValueCollection];
[combinedArray enumerateObjectsUsingBlock:
^(UIButton *button, NSUInteger idx, BOOL *stop)
{
button.enabled = YES;
button.alpha = 1.0f;
}];
}
导致:
- (IBAction)enableDecimalValues
{
[[nonOctalValueCollection
arrayByAddingObjectsFromArray:nonBinaryValueCollection]
enumerateObjectsUsingBlock:
^(UIButton *button, NSUInteger idx, BOOL *stop)
{
button.enabled = YES;
button.alpha = 1.0f;
}];
}