The iPhone camera has a fixed focus depth, which works well for many situations but is not ideal for scanning barcodes. Specifically, anything that is too close to the camera will look fuzzy and will be difficult to decode. For best barcode scanning results:

This will give the decoder a large picture containing mainly the barcode, which will be the easiest for it to decode.