On Wed, Jun 10, 2009 at 2:11 PM, Chunk 1978<[email protected]> wrote:
> i don't understand why i'm getting an error "invalid initializer" when
> just declaring some variables in a method:
>
> -=-=-=-
> CGRect fullScreenRect = [[UIScreen mainScreen] bounds];
> CGPoint screenCenterPoint = (CGRectGetMidX(fullScreenRect),
> CGRectGetMidY(fullScreenRect));
> -=-=-=-

Replace the parentheses around the two CGRectGetMid... functions with
curly braces:

CGPoint screenCenterPoint = {CGRectGetMidX(fullScreenRect),
CGRectGetMidY(fullScreenRect)};

-- 
Clark S. Cox III
[email protected]
_______________________________________________

Cocoa-dev mailing list ([email protected])

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to [email protected]

Reply via email to