preprocessor macro for universal framework in header fileGit ignore file for Xcode projectsHow can I Remove .DS_Store files from a Git repository?Differences between Framework and non-Framework builds of Python on Mac OS XLinker Error in Hybrid Mac / iPhone ProjectHow can I disable ARC for a single file in a project?LLVM 6 : Prefix Header vs Preprocessor Macros Not Used in Precompiled HeadersSwift: Using Preprocessor MacrosUmbrella Header Not Found When Changing Target Name or Product Name of FrameworkXcode picks wrong version of header file with same nameUse native framework inside Unity in standalone build

How to show a landlord what we have in savings?

How would I stat a creature to be immune to everything but the Magic Missile spell? (just for fun)

Is "remove commented out code" correct English?

How seriously should I take size and weight limits of hand luggage?

What mechanic is there to disable a threat instead of killing it?

What about the virus in 12 Monkeys?

How to tell a function to use the default argument values?

Could the museum Saturn V's be refitted for one more flight?

What does “the session was packed” mean in this context?

What method can I use to design a dungeon difficult enough that the PCs can't make it through without killing them?

Personal Teleportation: From Rags to Riches

Would Slavery Reparations be considered Bills of Attainder and hence Illegal?

Am I breaking OOP practice with this architecture?

How could indestructible materials be used in power generation?

Why is this clock signal connected to a capacitor to gnd?

What is a romance in Latin?

Detention in 1997

Forgetting the musical notes while performing in concert

What does the expression "A Mann!" means

GFCI outlets - can they be repaired? Are they really needed at the end of a circuit?

Expand and Contract

Avoiding the "not like other girls" trope?

Why didn't Boeing produce its own regional jet?

Why can't we play rap on piano?



preprocessor macro for universal framework in header file


Git ignore file for Xcode projectsHow can I Remove .DS_Store files from a Git repository?Differences between Framework and non-Framework builds of Python on Mac OS XLinker Error in Hybrid Mac / iPhone ProjectHow can I disable ARC for a single file in a project?LLVM 6 : Prefix Header vs Preprocessor Macros Not Used in Precompiled HeadersSwift: Using Preprocessor MacrosUmbrella Header Not Found When Changing Target Name or Product Name of FrameworkXcode picks wrong version of header file with same nameUse native framework inside Unity in standalone build













0















I'm on a legacy project and there's one codebase to build different frameworks for iOS, macOS, etc. In one of the public header files that is copied into the framework product, there is a preprocessor macro like this



 // MyObject.h
#ifdef TARGET_IOS
@import UIKit;
#endif


In the same header file, if I try to do



#ifdef TARGET_IOS
@property (nonatomic, strong) UIView *containerView;
#endif


The framework builds fine. However when I try to test out the framework in a separate app project, the compiler doesn't know what type containerView is on the type MyObject.



But of course if I just do



@property (nonatomic, strong) UIView *containerView;


without the preprocessor macro, in the separate app, it knows what type containerView is. Why is that? I thought that you tell the compiler on what to build with preprocessor macros. And then since that framework is built with that property containerView defined, it would work. But maybe I'm misunderstanding something?



Edited:
TARGET_IOS=1 in Preprocessor Macros of Build Settings for Debug and Release configurations.










share|improve this question
























  • Where is TARGET_IOS being defined?

    – Mobile Ben
    Mar 21 at 22:53











  • @MobileBen It's being defined as TARGET_IOS=1 in Preprocessor Macros for both Debug and Release configurations.

    – Crystal
    Mar 22 at 3:09















0















I'm on a legacy project and there's one codebase to build different frameworks for iOS, macOS, etc. In one of the public header files that is copied into the framework product, there is a preprocessor macro like this



 // MyObject.h
#ifdef TARGET_IOS
@import UIKit;
#endif


In the same header file, if I try to do



#ifdef TARGET_IOS
@property (nonatomic, strong) UIView *containerView;
#endif


The framework builds fine. However when I try to test out the framework in a separate app project, the compiler doesn't know what type containerView is on the type MyObject.



But of course if I just do



@property (nonatomic, strong) UIView *containerView;


without the preprocessor macro, in the separate app, it knows what type containerView is. Why is that? I thought that you tell the compiler on what to build with preprocessor macros. And then since that framework is built with that property containerView defined, it would work. But maybe I'm misunderstanding something?



Edited:
TARGET_IOS=1 in Preprocessor Macros of Build Settings for Debug and Release configurations.










share|improve this question
























  • Where is TARGET_IOS being defined?

    – Mobile Ben
    Mar 21 at 22:53











  • @MobileBen It's being defined as TARGET_IOS=1 in Preprocessor Macros for both Debug and Release configurations.

    – Crystal
    Mar 22 at 3:09













0












0








0








I'm on a legacy project and there's one codebase to build different frameworks for iOS, macOS, etc. In one of the public header files that is copied into the framework product, there is a preprocessor macro like this



 // MyObject.h
#ifdef TARGET_IOS
@import UIKit;
#endif


In the same header file, if I try to do



#ifdef TARGET_IOS
@property (nonatomic, strong) UIView *containerView;
#endif


The framework builds fine. However when I try to test out the framework in a separate app project, the compiler doesn't know what type containerView is on the type MyObject.



But of course if I just do



@property (nonatomic, strong) UIView *containerView;


without the preprocessor macro, in the separate app, it knows what type containerView is. Why is that? I thought that you tell the compiler on what to build with preprocessor macros. And then since that framework is built with that property containerView defined, it would work. But maybe I'm misunderstanding something?



Edited:
TARGET_IOS=1 in Preprocessor Macros of Build Settings for Debug and Release configurations.










share|improve this question
















I'm on a legacy project and there's one codebase to build different frameworks for iOS, macOS, etc. In one of the public header files that is copied into the framework product, there is a preprocessor macro like this



 // MyObject.h
#ifdef TARGET_IOS
@import UIKit;
#endif


In the same header file, if I try to do



#ifdef TARGET_IOS
@property (nonatomic, strong) UIView *containerView;
#endif


The framework builds fine. However when I try to test out the framework in a separate app project, the compiler doesn't know what type containerView is on the type MyObject.



But of course if I just do



@property (nonatomic, strong) UIView *containerView;


without the preprocessor macro, in the separate app, it knows what type containerView is. Why is that? I thought that you tell the compiler on what to build with preprocessor macros. And then since that framework is built with that property containerView defined, it would work. But maybe I'm misunderstanding something?



Edited:
TARGET_IOS=1 in Preprocessor Macros of Build Settings for Debug and Release configurations.







ios objective-c macos






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Mar 22 at 3:09







Crystal

















asked Mar 21 at 21:10









CrystalCrystal

11.2k45180343




11.2k45180343












  • Where is TARGET_IOS being defined?

    – Mobile Ben
    Mar 21 at 22:53











  • @MobileBen It's being defined as TARGET_IOS=1 in Preprocessor Macros for both Debug and Release configurations.

    – Crystal
    Mar 22 at 3:09

















  • Where is TARGET_IOS being defined?

    – Mobile Ben
    Mar 21 at 22:53











  • @MobileBen It's being defined as TARGET_IOS=1 in Preprocessor Macros for both Debug and Release configurations.

    – Crystal
    Mar 22 at 3:09
















Where is TARGET_IOS being defined?

– Mobile Ben
Mar 21 at 22:53





Where is TARGET_IOS being defined?

– Mobile Ben
Mar 21 at 22:53













@MobileBen It's being defined as TARGET_IOS=1 in Preprocessor Macros for both Debug and Release configurations.

– Crystal
Mar 22 at 3:09





@MobileBen It's being defined as TARGET_IOS=1 in Preprocessor Macros for both Debug and Release configurations.

– Crystal
Mar 22 at 3:09












0






active

oldest

votes












Your Answer






StackExchange.ifUsing("editor", function ()
StackExchange.using("externalEditor", function ()
StackExchange.using("snippets", function ()
StackExchange.snippets.init();
);
);
, "code-snippets");

StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "1"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);

else
createEditor();

);

function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);



);













draft saved

draft discarded


















StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55289305%2fpreprocessor-macro-for-universal-framework-in-header-file%23new-answer', 'question_page');

);

Post as a guest















Required, but never shown

























0






active

oldest

votes








0






active

oldest

votes









active

oldest

votes






active

oldest

votes















draft saved

draft discarded
















































Thanks for contributing an answer to Stack Overflow!


  • Please be sure to answer the question. Provide details and share your research!

But avoid


  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.

To learn more, see our tips on writing great answers.




draft saved


draft discarded














StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55289305%2fpreprocessor-macro-for-universal-framework-in-header-file%23new-answer', 'question_page');

);

Post as a guest















Required, but never shown





















































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown

































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown







Popular posts from this blog

Kamusi Yaliyomo Aina za kamusi | Muundo wa kamusi | Faida za kamusi | Dhima ya picha katika kamusi | Marejeo | Tazama pia | Viungo vya nje | UrambazajiKuhusu kamusiGo-SwahiliWiki-KamusiKamusi ya Kiswahili na Kiingerezakuihariri na kuongeza habari

Swift 4 - func physicsWorld not invoked on collision? The Next CEO of Stack OverflowHow to call Objective-C code from Swift#ifdef replacement in the Swift language@selector() in Swift?#pragma mark in Swift?Swift for loop: for index, element in array?dispatch_after - GCD in Swift?Swift Beta performance: sorting arraysSplit a String into an array in Swift?The use of Swift 3 @objc inference in Swift 4 mode is deprecated?How to optimize UITableViewCell, because my UITableView lags

Access current req object everywhere in Node.js ExpressWhy are global variables considered bad practice? (node.js)Using req & res across functionsHow do I get the path to the current script with Node.js?What is Node.js' Connect, Express and “middleware”?Node.js w/ express error handling in callbackHow to access the GET parameters after “?” in Express?Modify Node.js req object parametersAccess “app” variable inside of ExpressJS/ConnectJS middleware?Node.js Express app - request objectAngular Http Module considered middleware?Session variables in ExpressJSAdd properties to the req object in expressjs with Typescript