tvOS framework & iOS framework in the same project

I've created an empty xCode project, and added 2 targets. 1 is a tvOS framework, and the other is an iOS framework. In order to build either target - I need to go to the project build settings and select the appropriate "Base SDK".

I shouldn't need to change this every time I want to build either target. Aren't the target settings supposed to override the project settings?


This is a problem when I do this....


Create a workspace

Add an iOS Application project to the workspace

Add a tvOS application project to the workspace

Add the "framework" project which contains the 2 targets mentioned above to the work space

Add the tv framework to the tvOS application "linked frameworks and binaries"

Add the iOS framework to the iOS application "linked frameworks and binaries"


I can now run both apps in the simulator without any problems. But, running either app on a device gives error...


dyld: Library not loaded: @rpath/...................

Reason: image not found


This error happens if I don't have the framework's project settings "base sdk" set to the device I'm running on. The target is set properly, and this should override the project settings.


Also - I can't add the framework to the application's "embedded binaries" section unless the project setting is set for the application I want to build.

tvOS framework & iOS framework in the same project
 
 
Q