My project has an Objective-C class MockupModel
that provides mockup information to an iOS Xcode project to help with creating screen shots for the App store.
The project has two targets. The mockup target includes MockupModel.m
.
I want the main target (for the actual App) to not include MockupModel.m
so that there is no chance of it accidentally being linked in to the shipping App.
However, when I exclude the MockupModel.m
from the project using the file's attribute inspector, reasonably enough, the project fails to link. I get an error complaining that the functions of MockupModel
are missing.
Is there some way that I can declare MockupModel
as optional so that the linker doesn't worry if it is not implemented? At run time my code will check to see if it's available with NSClassFromString(@"MockupModel")
, or with [MockupModel class]
.