General questions about using Xcode

I have 3 general questions related to using xCode. Any help would be greatly appreciated:

  • Whenever I open the documentation, the left content / index column is always small and I have to stretch its width. Is there a way to permanently set its size?
  • Is there a way to do a wildcard lookup and replace eg. 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 install the default SDK?

Thank.

+2


source to share


4 answers


To search for a pattern, use regular expressions and use \ n in the replacement text.

I'm using Xcode 3.2, but I think older versions use the same regex syntax. Use the Find ... command (cmd-F). Select Find and Replace from the pop-up menu. Select "Regular Expression" from the pop-up menu in the search text box. Enter "var (\ d +) Letter" for search text and "var \ 1letter" for alternative text.



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

+3


source


re # 2: Xcode can use regular expressions. You need to choose the type of regexp (usually it says text) and this will allow you to do search and replace. Xcode uses ICU regex syntax.



+4


source


Here's everything I know:

  • Not sure; I've seen this issue too and am not aware of a workaround.
  • As far as I know, Xcode does not handle regex based search / replace, which is what you need for this situation.
  • The setting you are looking for is a "base SDK" that can be customized for both per project and per target (which overrides the project setting) by right-clicking the project icon or target icon, respectively, and select Get Info. from the context menu. The basic SDK setup is one of the first on the Build tab.
+3


source


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

An alternative to this would be to edit the default Xcode project (the base template for the base application is located in Developer / Library / Xcode / Project Templates / Application / Cocoa Application / Cocoa Application / __ PROJECTNAME __. Xcodeprjo / project.pbxproj) and change the SDKROOT value.

+1


source







All Articles