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
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
add a comment |
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
Where is TARGET_IOS being defined?
– Mobile Ben
Mar 21 at 22:53
@MobileBen It's being defined asTARGET_IOS=1
inPreprocessor Macros
for both Debug and Release configurations.
– Crystal
Mar 22 at 3:09
add a comment |
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
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
ios objective-c macos
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 asTARGET_IOS=1
inPreprocessor Macros
for both Debug and Release configurations.
– Crystal
Mar 22 at 3:09
add a comment |
Where is TARGET_IOS being defined?
– Mobile Ben
Mar 21 at 22:53
@MobileBen It's being defined asTARGET_IOS=1
inPreprocessor 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
add a comment |
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
);
);
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
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
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.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
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
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
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
Where is TARGET_IOS being defined?
– Mobile Ben
Mar 21 at 22:53
@MobileBen It's being defined as
TARGET_IOS=1
inPreprocessor Macros
for both Debug and Release configurations.– Crystal
Mar 22 at 3:09