Release code being run in debug mode

Discussion in 'Mac Programming' started by moonman239, Mar 28, 2016.

  1. moonman239, Mar 28, 2016
    Last edited: Mar 28, 2016

    moonman239 macrumors 68000

    Joined:
    Mar 27, 2009
    #1
    I have a header file that has a series of preprocessor directives that determine which of two files is to be imported, and which of two classes is to be used. The problem is, it seems that no matter what I do, my QueuePlayerClass instance ends up being of AVQueuePlayer type.

    Here are the directives:
    Code:
    #ifdef DEBUG
    
    #import "DebugClass.h"
    
    #define QueuePlayerClass DebugClass
    
    #else
    
    #import <AVFoundation/AVFoundation.h>
    
    #define QueuePlayerClass AVQueuePlayer
    
    #endif
    
    Xcode version is 7.2.1.

    Oops, the solution's come to mind. I need to use
    Code:
    [[QueuePlayerClass alloc] init]
    to create the player. And it works, now.
     

Share This Page