Cannot start preference panel application

I created a new Xcode Preferences panel project that I plan to launch in a System Preference application. I made one modification of the project build settings:

  • Changed the base SDK for Mac OS X 10.6 from 10.7 (since I want to maintain compatibility with Snow Leopard).

I have a nib file and a subclass of NSPreferencePane, but Xcode does not allow me to run the application (just create it, the Run option is disabled).

My environment specifications:

  • Macbook Pro 2010
  • Mac OS X Lion (10.7)
  • Xcode 4.2
+6
source share
1 answer

With Xcode schemas, you can do it very nicely. Edit the Run action of the circuit as follows:

  • Install the executable in System Preferences.app
  • Click the Arguments tab and pass the start argument: $USER_LIBRARY_DIR/PreferencePanes/$FULL_PRODUCT_NAME
  • Now expand the Run / Debug scheme and click "Pre-actions"
  • Add a preliminary script action with the following body: cp -a "$TARGET_BUILD_DIR/$FULL_PRODUCT_NAME" "$USER_LIBRARY_DIR/PreferencePanes/"

Bingo. Launch will now launch the system settings and go directly to your preliminary panel.

By default, the schemes are for each user and, therefore, you are likely to exclude them from your repository, and even if other users will not see them. Go to "Schema Management ..." and mark the prefPane schema as general if you want others to get these settings.

NB: For some reason, I seem to get random crashes when starting prefPane as an argument. Just disable the argument and manually run it once - from now on you can use the argument again ...

+14
source

Source: https://habr.com/ru/post/897066/


All Articles