This article focuses on LearningXcodeTo learn and understandXcode4 topicThe details of the style operations are detailed, And the bonus is similar to the implementation of the whole process.Xcode4OfTopicStyle. For details, refer to the details in this article.
1. Download and install Xcode4
Because Xcode4 and earlier versions need to coexist, select another installation path when installing Xcode4. After the installation is successful, change the name of Xcode under the xcode4 installation directory. the app is Xcode4.app to differentiate the old version. Find an xcodeproj file, right-click Get Info, select Xcode4 in Open with, and click Change All to set file type association.
2. Familiar with the interface
Open Xcode, and probably view the changes in the lower bound. Click here to see what it is, and view the Xcode menu again. If you are free, you can refer to the source code Management Section in the help document. Create a HelloWorld project and operate on the IB link.
3. Configure the Fonts and Colors of the Code Editor)
I prefer to write code with a black background, and my eyes are quite comfortable. In the past, the old ColorTheme file was not used, and the storage path of ColorTheme changed ~ /Library/Application Support/Xcode/Color Themes, Xcode4 IN ~ /Library/Developer/Xcode/UserData/FontAndColorThemes, and the file format has changed, but most projects are the same. You can reconfigure the color font or manually modify the configuration file.
After Google, aktowns has written a conversion Script: https://gist.github.com/793006
The usage is very simple:
1. Download dvtcolorconvert. rb. If you put it on the desktop, copy the old Theme file to the desktop.
- //dvtcolorconvert.rb
-
- #!/usr/bin/env ruby
- # This script converts xccolorthemes to dtvcolorthemes for porting xcode 3.x themes to xcode 4.x
- # created by ashley towns <ashleyis@me.com>
- # Public domain.
- # ./dvtcolorconvert <inputfile>
- # spits out a .dtvcolortheme file
-
- require 'rubygems'
- require 'plist'
- raise "Error: need a source file #{__FILE__} [file.xccolortheme]" if ARGV.length == 0
-
- def alpha inc, alpha=1
- "#{inc} #{alpha}"
- end
- def convert infile
- hash = Plist::parse_xml infile
- out_hash = {}
- out_hash[:DVTSourceTextSyntaxFonts] = {}
- out_hash[:DVTSourceTextSyntaxColors] = {}
- hash.each do |name, node|
- node.each do |child_name, child|
- puts "[on] node:#{name} child:#{child_name}(#{child})"
- if name == "Colors"
- case child_name
- when /Background/
- out_hash[:DVTSourceTextBackground] = alpha child
- out_hash[:DVTConsoleTextBackgroundColor] = alpha child
- out_hash[:DVTSourceTextInvisiblesColor] = alpha child
- out_hash[:DVTSourceTextBlockDimBackgroundColor] = alpha child
- when /InsertionPoint/
- out_hash[:DVTSourceTextInsertionPointColor] = alpha child
- out_hash[:DVTConsoleTextInsertionPointColor] = alpha child
- out_hash[:DVTDebuggerInsutrctionPointerColor] = alpha child
- out_hash[:DVTConsoleDebuggerInputTextColor] = alpha child
- out_hash[:DVTConsoleDebuggerOutputTextColor] = alpha child
- out_hash[:DVTConsoleExectuableInputTextColor] = alpha child
- out_hash[:DVTConsoleExecutableOutputTextColor] = alpha child
- when /Selection/
- out_hash[:DVTSourceTextSelectionColor] = alpha child
- out_hash[:DVTConsoleTextSelectionColor] = alpha child
- out_hash[:DVTDebuggerPromptTextColor] = alpha child
- else
- out_hash[:DVTSourceTextSyntaxColors][child_name] = alpha child
- end
- elsif name == "Fonts"
- case child_name
- when /xcode.syntax.plain/
- child = "Inconsolata - 14pt"
- out_hash[:DVTConsoleDebuggerInputTextFont] = child
- out_hash[:DVTConsoleDebuggerOutputTextFont] = child
- out_hash[:DVTConsoleDebuggerPromptTextFont] = child
- out_hash[:DVTConsoleExecutableInputTextFont] = child
- out_hash[:DVTConsoleExecutableOutputTextFont] = child
- out_hash[:DVTSourceTextSyntaxFonts]['xcode.syntax.plain'] = child
- else
- out_hash[:DVTSourceTextSyntaxFonts][child_name] = "Inconsolata - 14pt" #child
- end
- else
- raise "I don't know what #{name} is."
- end
- end
- end
- puts "Saving #{infile.gsub(/xccolortheme/,'dvtcolortheme')}"
- fp = File.open(infile.gsub(/xccolortheme/,'dvtcolortheme'),'w')
- fp.write out_hash.to_plist
- fp.close
- end
-
- convert ARGV[0]
- #Dir['*.xccolortheme'].each do |file|
- # convert file
- #end
2. install "plist" ruby gem: $ sudo gem install plist
3. Execute conversion: $ ruby dvtcolorconvert. rb ElfDart. xccolortheme is generated on the desktop, and put it in ~ Restart Xcode4 in/Library/Developer/Xcode/UserData/FontAndColorThemes and enable the topic in Fonts & Colors in Preferences.
The converted topic file,
If you like, you can download to: http://code.google.com/p/elf-ios-resource/downloads/detail? Name = ElfDark. dvtcolortheme
Https://github.com/Sundae/Cocoa-Utilities
4. Preferences/Text Editing)
Summary:XcodeLearning documents:Xcode4 topicThe style content has been introduced. I hope this article will help you!