framework with options

Discussion in 'Mac Programming' started by MrFusion, Mar 4, 2011.

  1. MrFusion macrumors 6502a

    Joined:
    Jun 8, 2005
    Location:
    West-Europe
    #1
    Dear Xcode gurus

    Is it possible for an app client to provide options to a framework?

    This is the situation I am faced with. The functionality of the framework is the same for each app, but the data it handles can not be shared between each app. That same data can also be copied and pasted, so I use a custom pasteboard identifier in the framework. Just a string that is defined in the .m file.
    Code:
    #define myPasteboardType com.domain.framework
    
    I now want to use a custom "myPasteboardType" for each type of data/set of apps. Is it possible to force the client to provide this at start up?

    Or, now that I think of it, should I just use a static class variable that can be changed by the client?

    Thanks for the advice!
     
  2. cqexbesd macrumors regular

    Joined:
    Jun 4, 2009
    #2
    IIUC all you would need to do is make the string a member variable of some class in your framework and make the client of the framework set it before using any of the facilities of your framework - either through a setter or a general initialisation call?
     

Share This Page