Generic Xcode usage questions
I have 3 general questions related to the usage of xCode. Any help would be greatly appreciated please:
- 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?
- 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.
- How do I set the default SDK?
Thanks.
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.
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.
Here's all I know:
- Not sure; I have seen this problem, too, and don't know of a workaround.
- As far as I know XCode doesn't handle regular-expression-based search/replace, which is what you'd need for this situation.
- 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.
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.
精彩评论