How to create variables for use in Xcode build settings values? - xcode4

XCode has a number of built-in variables that are used for convenience in Build Settings, for example "$(PRODUCT_NAME)" or "$(CURRENT_ARCH)".
Can I define my own variables? How / where?

In XCode 5 this has changed slightly.
Select the project or target in the left side of the editor
Go to the Editor menu in the top menu bar
Select "Add Build Setting" and then "Add User-Defined Build Setting"

It's at the top of the build settings panel in Xcode 10.

Create a user-defined build setting. To create one in Xcode 4 select your project from the project navigator to open the project editor. Select your project or target from the left side of the editor. Click the Build Settings button at the top of the editor. Click the Add Build Setting button at the bottom of the editor and choose Add User-Defined Setting.

User-defined setting can be added in Xcode as specified below:
Xcode 4.x :
Select PROJECT / TARGETS -> “Add Build Setting” (option present in bottom-right corner of Xcode)
-> “Add User-Defined Setting”
Xcode 5.x :
Select PROJECT / TARGETS -> Editor menu -> “Add Build Setting“ -> “Add User-Defined Setting”
This will add User-defined setting. Enter key-value for setting.

Related

Change gps behaviour on build target compile file

If I use the GNAT Programming Studio (GPS) to build a single file (Build target Compile file), the editor jumps to the first location in the file with a build warning/error.
It is possible to disable this behaviour using a setting?
Yes. That's apparently an "Advanced" feature, and a bit harder to find than other settings...
Open the Preferences dialog (Edit -> Preferences).
Next to the search preference... box, there's a menu icon. Click on it, and tick off the Show advanced preferences option. An Advanced category has now been added to the list on the left. In there, you will find a Jump to first location option.

Atom Package Tree View?

I just started using Atom and can't figure out how to display files/folders that are included in .gitignore. I've seen posts that say to uncheck hide vcs ignored files in tree view but I can't even find tree view, haha!
There are three things you need to check:
1.) There is a option in the "View" menu to toggle the tree view:
2.) If it's still not visible, please check if the Core Package "tree-view" is enabled:
3.) Now to get Atom showing you VCS ignored files, you need to disable "Hide VCS Ignored Files" on the Settings pane of the "tree-view" package:

Can't see tasks in aptana

I wonder why I can't see my // TODO: descriptions in my Task View in Aptana.
When I rightclick at the line number and choose Add Task it works and I can see my task in the
Window > Show View > Tasks
But when I just write a comment like this //TODO: fix this line as soon as possible.
Then it doesn't show up in the Task list.
When I check my preferences Window > Preferences > Aptana Studio > Tasks, there's TODO, XXX and FIXME in that list, so it looks like it should work, but it doesn't.
The code I'm working at is an Aptana Project Aswell.
The problem were that I had to change the type of the project in aptana.
The project was a Web project first, and WEB projects doesn't support TODO's in default.
Change the project to a PHP project and it works.
Maybe you can fix this somehow to make Web projects support todo's but I fixed it by changing the project type.
My current project is web based and you can create comments like
/**
* TODO do some stuff here
*/
Aptana will recognize "TODO" keyword and will put colored rectangle(color is dependent on the editing theme set in preferences) on the right side of the screen next to the scrollbar.
To create task, right click on the line numbers vertical bar and context menu will appear. Click the Add task menu item. Once you do this it will appear in the tasks panel window.
Plus you can mark the task as completed or set priority, high, normal and low.
If you want to define your own task type, you must first add it in preferences Window > Preferences > Aptana Studio > Tasks, then you can add a new configuration on Configure content in task view.

Why is my Settings.bundle empty?

I'm teaching myself iOS programming and am trying to add a Settings Bundle Resource to my Hello World app, following instructions in the iOS Application Programming Guide. The Settings.bundle object is created in my project (with the disclosure triangle) but there are no files inside.
I expected a Root.plist and en.lproj/Root.strings
Am I missing something in my Xcode4 installation or Xcode setup?
Thanks!
If you click on it with the mouse, and choose "Show in Finder", and in Finder click on it and choose "Show Package Contents", you'll see that it's a directory.
(I found the answer at http://www.iphonedevsdk.com/forum/iphone-sdk-development/92361-settings-bundle-corrupted-newly-added-settings-bundle-also-bad-xcode-4-2-a.html )
[quote]
Click on the Settings.bundle file in the left window; from main menu choose View -> Utilities -> Show FileInspector. Then change fileType to "applicationBundle" -- the two missing files will show under Settings.bundle.
[/quote]
(FileInspector is the right column (to the right from the central view(s)), the tab with an icon showing a page with a paper-clip in the corner)
Just for completeness, this was fixed in a newer version of Xcode. I'll remember to include versions numbers next time.

How to highlight opened file in XCode 4 on the "Project Navigator" panel?

Since a project can have hundreds of files inside dozens of directories (filters) shown on the "Project Navigator" panel, sometimes it's getting difficult to seek the file which is currently opened in the Editor (for example, when I jump from file to file via "CMD + clicking", etc).
Is there a way to automatically select currently opened file on the "Project Navigator" panel? I.e., automatically expand the directories (filters) and select the file there as I would have clicked on it? Maybe there's a shortcut or something?
Thanks.
The keyboard shortcut is ⌘-shift-J
Right-click the file in the editor and choose Reveal in Project Navigator.
Another option is to Right click anywhere within the Editor pane (with the source code) -> Navigate -> Reveal in Project Navigator.

Resources