views:

416

answers:

4

I have 3 general questions related to the usage of xCode. Any help would be greatly appreciated please:

  1. Whenever I open documentation, the left content/index column is always small and I have to drag it wider. Is there a way to permanently set its size?
  2. Is there a way to perform a wildcard search and replace e.g. I have 3 lines: var1Letter = @"A"; var2Letter = @"A"; var3Letter = @"A";

In the above I would like to replace var?letter in 1 go.

  1. How do I set the default SDK?

Thanks.

+3  A: 

Here's all I know:

  1. Not sure; I have seen this problem, too, and don't know of a workaround.
  2. As far as I know XCode doesn't handle regular-expression-based search/replace, which is what you'd need for this situation.
  3. The setting you're looking for is "Base SDK", which can be configured both per-project and per-target (which overrides the project setting) by right-clicking on the project icon or the target icon, respectively, and choosing "Get Info" from the context menu. The Base SDK setting is one of the first under the Build tab.
fbrereto
Peter Hosey
+3  A: 

re #2: Xcode can use regular expressions. You need to select the regular expression type though (it usually says textual) and that will let you do a search and replace. Xcode uses the ICU regex syntax.

Elfred
thanks, but I have no idea what that means
Run Loop
http://www.noodlesoft.com/blog/2007/01/27/search-and-replace-in-xcode/ has some good info. If you are on snow leopard, you need to click on the magnifying glass of the find field to use regular expressions.
Elfred
+2  A: 

To do the wildcard search, use regular expressions and use \*n* in the replacement text.

I'm using Xcode 3.2, but I think that older versions use the same regular expression syntax. Use the Find… (cmd-F) command. Choose "Find & Replace" from the pop-up menu. Choose "Regular Expression" mode from the pop-up menu in the search text field. Enter "var(\d+)Letter" for the search text, and "var\1letter" for the replacement text.

The "\d+" syntax matches any sequence of one or more digits. The "\1" is replaced by the text matched by the first set of parentheses in the search text.

Derek Ledbetter
+1  A: 

For #3, There's no way to set new default SDK for all new projects that you create. The easiest way that I've found is to create an .xcconfig file that gets imported to every new project that I make.

An alternative to this would be to edit the default Xcode project (The base template for a base application is found at Developer/Library/Xcode/Project Templates/Application/Cocoa Application/Cocoa Application/__PROJECTNAME__.xcodeprjo/project.pbxproj) and change the SDKROOT value.

zadr