Troubleshooting Xcode by Magno Urbano

Troubleshooting Xcode by Magno Urbano

Author:Magno Urbano [Urbano, Magno]
Language: eng
Format: azw3, pdf
ISBN: 9781484215616
Publisher: Apress
Published: 2015-09-22T16:00:00+00:00


Figure 22. Embedding the whole interface elements into a view (before and after)

Detecting the Application Target Running

You have a project with independent iPhone and iPad targets and at some point in the code you want to know what target is running.

Using UI_USER_INTERFACE_IDIOM() is not an option because this method will just check if the target is running on iPhone or iPad, not the target itself.

One way to solve this problem involves adding a preprocessor macro and testing for the existence of that macro later in code, but compiler directives make the code clumsy and reduce readability.

However, there is a better way. The code shown next will read the bundle’s infoDictionary and discover which target is running.



Download



Copyright Disclaimer:
This site does not store any files on its server. We only index and link to content provided by other sites. Please contact the content providers to delete copyright contents if any and email us, we'll remove relevant links or contents immediately.