iPhone/Objective-C struct question my own CGRectZero

Posted by Mark on Stack Overflow See other posts from Stack Overflow or by Mark
Published on 2010-04-25T15:25:26Z Indexed on 2010/04/25 15:33 UTC
Read the original article Hit count: 256

Filed under:
|
|

I am designing a Padding struct as follows:

/* Padding. */
struct CGPadding {
 CGFloat left;
 CGFloat top;
 CGFloat right;
 CGFloat bottom;
};
typedef struct CGPadding CGPadding;

CG_INLINE CGPadding CGPaddingMake(CGFloat left, CGFloat top, CGFloat right, CGFloat bottom) { CGPadding p; p.left = left; p.top = top; p.right = right; p.bottom = bottom; return p; }

This all works perfectly well, the problem is how can I create a const CGPadding CGPaddingZero? If I do like this:

const CGPadding CGPaddingZero = (CGPadding){0.0, 0.0, 0.0, 0.0};

It doesnt work. So what am I doing wrong?

© Stack Overflow or respective owner

Related posts about iphone

Related posts about objective-c