Note that there are some explanatory texts on larger screens.

plurals
  1. POCMake xib to nib compilation for iOS target
    primarykey
    data
    text
    <p>I'm targeting iOS (device and simulator) and setting up CMake to add the different resources needed in the bundle. The "xib" file is giving me some problems. If I take no further action, the iPhone/iPad simulator run fails with the error:</p> <pre><code>Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'Could not load NIB in bundle: 'NSBundle &lt;/Users/danieldekkers/Library/Application Support/iPhone Simulator/4.3.2/Applications/1C29638B-7593-4311-8F94-C8051AF90AD7/Discs.app&gt; (loaded)' with name 'MainWindow'' </code></pre> <p>A missing NIB file in the bundle. An example (http://www.vtk.org/Wiki/CMake:OSX_InterfaceBuilderFiles) shows that for OSX, you have to compile the xib files into nib files and add these to the bundle as a post-build step. So my guess would be that something similar holds for iOS as well. But my question is,... where do i add the compiled nib files?</p> <p>I now do this in the CMakeLists.txt:</p> <pre><code># We need to compile the interface builder *.xib files to *.nib files to add to the bundle # Make sure we can find the 'ibtool' program. If we can NOT find it we skip generation of this project FIND_PROGRAM( IBTOOL ibtool HINTS "/usr/bin" "${OSX_DEVELOPER_ROOT}/usr/bin" ) if ( ${IBTOOL} STREQUAL "IBTOOL-NOTFOUND" ) MESSAGE( SEND_ERROR "ibtool can not be found" ) ENDIF() # Compile the .xib files using the 'ibtool' program with the destination being the app package FOREACH( xib ${RSRC_IOS_XIB_FILES} ) ADD_CUSTOM_COMMAND( TARGET ${RT_APP_NAME} POST_BUILD COMMAND ${IBTOOL} --errors --warnings --notices --output-format human-readable-text --compile ${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}/${RT_APP_NAME}.app/Contents/Resources/${xib}.nib ${RT_APP_ROOT}/rsrc/apple/ios/${xib}.xib COMMENT "Compiling ${RT_APP_ROOT}/rsrc/apple/ios/${xib}.xib") ENDFOREACH() </code></pre> <p>But iI don't really trust the "destination" of the compilation step, especially for the simulator.</p> <p>Has anyone got this working or see what it is that I'm doing wrong?</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload