Disappointed in XCode/clang today.

The following line of code doesn’t compile:

UIButton *searchBtn = [[UIButton alloc] initWithFrame:{CGPointZero, image.size}];

But this line does:

UIButton *searchBtn = [[UIButton alloc] initWithFrame:(CGRect){CGPointZero, image.size}];

My computer knows who my mother and father are, where I live and where I go to work. Why can’t my computer detect properly typed struct literals when they’re input to strongly typed struct parameters?

Such a fail.


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s