CGRect を for 文で・・・

配列の中身が CGRect で、for 文の中で要素を取り出す際の話。

for ( CGRect rect in arrayHoge )
このようにすると、次のエラーになる。
Used type 'CGRect' (aka 'struct CGRect') where arithmetic or pointer type is required

しょうがないので、魔法の id 型を指定する。
for ( id rect in arrayHoge )

次に、取り出した rect を使おうとするとき、
UIBezierPath* path = [UIBezierPath bezierPathWithRect:rect];
このようにすると叱られてしまう。
Sending 'const __strong id' to parameter of incompatible type 'CGRect' (aka 'struct CGRect')

ので、こうすると大丈夫だった。
UIBezierPath* path = [UIBezierPath bezierPathWithRect:[rect CGRectValue]];

うーん、めんどくさいね。