• 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: Developing for Tiger and Panther;
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Developing for Tiger and Panther;


  • Subject: Re: Developing for Tiger and Panther;
  • From: Sherm Pendley <email@hidden>
  • Date: Thu, 28 Jul 2005 11:53:39 -0400

On Jul 28, 2005, at 11:08 AM, Matt Budd (Madentec) wrote:

You're right, this is exactly how I did it at first and everything worked. The problem happens when instead of using NSAnimation directly I want to use a subclass of NSAnimation. As per your example:

if( system is less than tiger ) { //can actually test if (NSClassFromString(@"NSAnimation") == nil)
animationClassToUseAtRuntime = [YourAnimationClass class];
} else {
animationClassToUseAtRuntime = NSClassFromString (@"MyOtherAnimatoinClassThatIsNSAnimationSubclass");
}


Even though if I am running on Panther, I never execute the else- condition of that statement, the app still crashes because it have code for my "MyOtherAnimatoinClassThatIsNSAnimationSubclass" class that is a subclass of NSAnimation.

Compile your MyAnimationSubclass into a bundle, and dynamically load that bundle at runtime. Something like this:


... } else {
NSString *pluginPath = [[NSBundle mainBundle] builtInPlugInsPath];
NSString *bundlePath = [pluginPath stringByAppendingPathComponent:@"MyNSAnimationSubclass.bundle"];


    NSBundle *animClassBundle = [NSBundle bundleWithPath:bundlePath];
    Class animationClass = [animClassBundle principalClass];
}

sherm--

Cocoa programming in Perl: http://camelbones.sourceforge.net
Hire me! My resume: http://www.dot-app.org

_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


References: 
 >Re: Developing for Tiger and Panther; (From: Ben Dougall <email@hidden>)
 >Re: Developing for Tiger and Panther; (From: "Matt Budd (Madentec)" <email@hidden>)

  • Prev by Date: Re: Cocoa API Documentation
  • Next by Date: Re: Newbie Help understanding Core Data
  • Previous by thread: Re: Developing for Tiger and Panther;
  • Next by thread: Fwd: Developing for Tiger and Panther;
  • Index(es):
    • Date
    • Thread