Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

ElRojito

macrumors 6502
Original poster
May 6, 2012
329
585
Hey all,

I'm probably doing this the hard way but I'm still interested in finding a correct answer. I have a project that will run in 10.10 using NSVisualEffectView but, obviously, it crashes when opened in anything earlier because of the lack of said view.

I'm trying to get my script to check and see if the NSVisualEffectView is available and if so load one Nib, if not, load another. So far I am thinking that this would be the best way, but I'm not sure how to use initWithNibName correctly as I'm extremely ignorant when it comes to Objective-C. Haven't gotten that far yet.

My two nib files are transp.xib and MainMenu.xib.
Code:
 on applicationWillFinishLaunching_(aNotification)
        if ([NSVisualEffectView class])
        {
       - (instancetype)initWithNibName:(NSString *)nibName
                         bundle:(NSBundle *)nibBundle
        }
        else
        {
      - (instancetype)initWithNibName:(NSString *)nibName
                         bundle:(NSBundle *)nibBundle
        }
       
       
    end applicationWillFinishLaunching_

Any help is much appreciated. Thank you!
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.