Q:

Invalid operands to binary expressions ("id" and "int")

I'm using the GPUImage framework to take the average red values of some camera input. I'm storing all of the average red values in an array, and I'm trying this:
NSMutableArray *redValues = [NSMutableArray array];
__block int counter = 0;

GPUImageVideoCamera *videoCamera = [[GPUImageVideoCamera alloc] initWithSessionPreset:AVCaptureSessionPreset640x480 cameraPosition:AVCaptureDevicePositionBack];
videoCamera.outputImageOrientation = UIInterfaceOrientationPortrait;

GPUImageAverageColor *averageColor = [[GPUImageAverageColor alloc] init];
[averageColor setColorAverageProcessingFinishedBlock:^(CGFloat redComponent, CGFloat greenComponent, CGFloat blueComponent, CGFloat alphaComponent, CMTime frameTime)
 {
     NSLog(@"%f", redComponent);
     [redValues addObject:@(redComponent)];         
     counter++;
 }];

for (int i = 0; i < counter; i++)
{
    redValues[i] *= 255; // errors occurs here
}

A:

The error you get is because you are trying to multiply an NSNumber by an int. However, there is a deeper logical issue in that you are receiving redComponent as a value between 0 and 1. When you convert to an int, you truncate almost all values to 0 (at which point multiplying by 255 will not help much). Instead, you should inline the multiplication (and eliminate the second loop):
averageColor.colorAverageProcessingFinishedBlock = ^(CGFloat redComponent, CGFloat greenComponent, CGFloat blueComponent, CGFloat alphaComponent, CMTime frameTime) {
     NSLog(@"%f", redComponent);
     [redValues addObject:@(redComponent * 255)];
};

