Ok , I'm consfused about an error :
error: incompatible type for argument 1 of 'initWithFrame:'
This is what causes it:
operationLabel = [[NSTextField alloc] initWithFrame:CGRectMake(0, self.frame.size.height / 2 - (40 * 3), self.frame.size.width, 100)];
The definition is:
- (id)initWithFrame:(NSRect)frameRect;
So the first argument is NSRect, lets check it :
typedef CGRect NSRect;
How can it cause an error? They are same types named differently!
In addition to zoul's answer I thought I'd mention the two helper functions (macros?) by Apple (starting with 10.5):
NSRect NSRectFromCGRect(CGRect cgrect)
CGRect NSRectToCGRect(NSRect nsrect)
NSRect
is the same type as CGRect
if building for iOS, for a 64-bit Mac architecture, or a 32-bit Mac architecture with the macro NS_BUILD_32_LIKE_64
is defined as 1 at the command line or in a prefix header.
Or, to quote NSGeometry.h:
#if __LP64__ || TARGET_OS_EMBEDDED || TARGET_OS_IPHONE || TARGET_OS_WIN32 || NS_BUILD_32_LIKE_64
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With