Skip navigation.
 
mlRe: "weak link" framework refs for 10.1 compatibility?
FROM : Rosyna
DATE : Sun Nov 10 05:30:58 2002

Something like this? (for my class)

-(void)getRKAliasClass
{
    thisBundle=[NSBundle bundleForClass:[self class]];
    if (NSClassFromString(@"RKAlias")==NULL)
    {

   NSBundle* rkBundle=[NSBundle bundleWithPath:[NSString
stringWithFormat:@"%@/%@",[thisBundle
privateFrameworksPath],@"Protocol7Additions.framework"]];
   [rkBundle load];
   RKAliasClass=NSClassFromString(@"RKAlias");
    }
    RKAliasClass=(NSClassFromString(@"RKAlias"));
    NSLog(@"%@",NSStringFromClass(RKAliasClass)); 
}

RKAliasClass would be NULL if it hasn't loaded. Replace with the
requisite framework paths and then uhh, use the constants if the
class exists? As long as you compile on 10.2...

Would this work in your case?

Ack, at 11/7/02, Dan Wood said:

>I'm trying to add some AddressBook framework and NSAppleScript
>functionality to my app, but still allow for 10.1 compatibility.
>I'm making sure that no 10.2-specific methods get called in my code,
>and that's straightforward, but what is a problem is the constants
>(e.g. the Address Book constants in ABGlobals.h, or
>NSAppleScriptErrorMessage) are declared within the frameworks, that
>cause the bundle not to load in 10.1.
>
>I've found a workaround is to use my own string constants -- e.g.
>@"NSAppleScriptErrorMessage" instead of NSAppleScriptErrorMessage --
>but that seems like such a hack.  Is there a better way around this
>problem, like some sort of "weak linking" (for lack of a better
>term) that will cause the code not to complain that it can't find
>the string constants in the 10.1 frameworks, since the code will
>never be executed?


--


Sincerely,
Rosyna Keller
Technical Support/Holy Knight/Always needs a hug

Unsanity: Unsane Tools for Insanely Great People
---

Please include any previous correspondence in replies, it helps me
remember what we were talking about. Thanks.
_______________________________________________
cocoa-dev mailing list | <email_removed>
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.

Related mailsAuthorDate
ml"weak link" framework refs for 10.1 compatibility? Dan Wood Nov 7, 20:20
mlRe: "weak link" framework refs for 10.1 compatibility? Bill Cheeseman Nov 8, 11:17
mlRe: "weak link" framework refs for 10.1 compatibility? Dan Wood Nov 9, 16:02
mlRe: "weak link" framework refs for 10.1 compatibility? Ondra Cada Nov 9, 16:31
mlRe: "weak link" framework refs for 10.1 compatibility? Marco Scheurer Nov 9, 16:40
mlRe: "weak link" framework refs for 10.1 compatibility? Bill Cheeseman Nov 9, 19:35
mlRe: "weak link" framework refs for 10.1 compatibility? Bill Cheeseman Nov 9, 19:38
mlRe: "weak link" framework refs for 10.1 compatibility? Jonathan Hendry Nov 9, 20:55
mlRe: "weak link" framework refs for 10.1 compatibility? Nicholas Riley Nov 10, 03:17
mlRe: "weak link" framework refs for 10.1 compatibility? Rosyna Nov 10, 05:30
mlRe: "weak link" framework refs for 10.1 compatibility? Sam Griffith Nov 10, 06:56
mlRe: "weak link" framework refs for 10.1 compatibility? Rosyna Nov 10, 08:39
mlRe: "weak link" framework refs for 10.1 compatibility? Bill Cheeseman Nov 10, 11:10
mlRe: "weak link" framework refs for 10.1 compatibility? Finlay Dobbie Nov 10, 13:38
mlRe: "weak link" framework refs for 10.1 compatibility? Finlay Dobbie Nov 10, 16:30
mlRe: "weak link" framework refs for 10.1 compatibility? Piers Uso Walter Nov 10, 18:34
mlRe: "weak link" framework refs for 10.1 compatibility? Ondra Cada Nov 10, 20:21
mlRe: "weak link" framework refs for 10.1 compatibility? Ondra Cada Nov 10, 20:27
mlRe: "weak link" framework refs for 10.1 compatibility? Rosyna Nov 10, 20:47
mlRe: "weak link" framework refs for 10.1 compatibility? Sam Griffith Nov 10, 21:56
mlRe: "weak link" framework refs for 10.1 compatibility? Finlay Dobbie Nov 10, 22:12
mlRe: "weak link" framework refs for 10.1 compatibility? Ondra Cada Nov 10, 22:29
mlRe: "weak link" framework refs for 10.1 compatibility? Bill Cheeseman Nov 10, 23:45
mlRe: "weak link" framework refs for 10.1 compatibility? Ondra Cada Nov 11, 01:11
mlRe: "weak link" framework refs for 10.1 compatibility? Marco Scheurer Nov 11, 11:07
mlRe: "weak link" framework refs for 10.1 compatibility? Bill Cheeseman Nov 11, 12:23
mlRe: "weak link" framework refs for 10.1 compatibility? Ondra Cada Nov 11, 14:52
mlRe: "weak link" framework refs for 10.1 compatibility? Marco Scheurer Nov 11, 17:27
mlRe: "weak link" framework refs for 10.1 compatibility? Ondra Cada Nov 11, 18:11
mlRe: "weak link" framework refs for 10.1 compatibility? Bill Cheeseman Nov 11, 20:51
mlRe: "weak link" framework refs for 10.1 compatibility? Ondra Cada Nov 11, 22:14
mlRe: "weak link" framework refs for 10.1 compatibility? Bill Cheeseman Nov 12, 00:37
mlRe: "weak link" framework refs for 10.1 compatibility? Rosyna Nov 12, 01:40
mlRe: "weak link" framework refs for 10.1 compatibility? Rosyna Nov 12, 01:43
mlRe: "weak link" framework refs for 10.1 compatibility? Rosyna Nov 12, 01:45