• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: "weak link" framework refs for 10.1 compatibility?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: "weak link" framework refs for 10.1 compatibility?


  • Subject: Re: "weak link" framework refs for 10.1 compatibility?
  • From: Marco Scheurer <email@hidden>
  • Date: Sat, 9 Nov 2002 16:40:37 +0100

On Friday, November 8, 2002, at 11:17 AM, Bill Cheeseman wrote:
The bottom line, as I understand it, is that an application using C
constants that are new in 10.2 will not launch in 10.1.x or earlier.
Checking the system version to branch around them will not work, because the
loader tries to load them all at once, up front.

Is that true? The following code, in a category of NSTextField, compiled on 10.2 does not break on 10.1.x (text field is not rounded).

- (void) beRounded
{
if (IsJaguarOrLater()) {
[self setBezeled:YES];
[self setBezelStyle:NSTextFieldRoundedBezel];
}
}

Not only the NSTextFieldRoundedBezel constant, but also the setBezelStyle method are new to 10.2. These are defined in NSTextFieldCell and NSTextField like this:

#if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_2
typedef enum {
NSTextFieldSquareBezel = 0,
NSTextFieldRoundedBezel = 1
} NSTextFieldBezelStyle;
#endif


#if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_2
- (void)setBezelStyle:(NSTextFieldBezelStyle)style;
- (NSTextFieldBezelStyle)bezelStyle;
#endif


And IsJaguarOrLater uses Gestalt to get the OS version:

BOOL IsJaguarOrLater()
{
unsigned long os_version = 0;
Gestalt (gestaltSystemVersion, &os_version);
return (os_version >= 0x1020);
}

Marco Scheurer
Sen:te, Lausanne, Switzerland http://www.sente.ch
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.

  • Follow-Ups:
    • Re: "weak link" framework refs for 10.1 compatibility?
      • From: Ondra Cada <email@hidden>
    • Re: "weak link" framework refs for 10.1 compatibility?
      • From: Bill Cheeseman <email@hidden>
References: 
 >Re: "weak link" framework refs for 10.1 compatibility? (From: Bill Cheeseman <email@hidden>)

  • Prev by Date: Re: AddressBook & phone multivalue
  • Next by Date: Re: .dmg displaying license agreement when mounted
  • Previous by thread: Re: "weak link" framework refs for 10.1 compatibility?
  • Next by thread: Re: "weak link" framework refs for 10.1 compatibility?
  • Index(es):
    • Date
    • Thread