Return to site

Xcode Download Dmgeverdirty

broken image
Admin March 20, 2017 December 22, 2020 1 Comment on Download Xcode: Download Xcode 12/11/10/9 xip Download links for Xcode 10.1, Xcode 10, Xcode 9, Xcode 8, XCode 7, XCode 6 are given below. The list is organized in newest first and a developer account login will be required. This page contains my notes about Xcode, the IDE used for writing applications for Mac OS X and iOS devices (iPhone, iPad). For the moment, there is also a section about Interface Builder (IB), the RAD tool to develop the GUI of Mac applications. Download Apple Xcode 10.1 for Mac Free. It is full Latest Version setup of Apple Xcode 10.1 Premium Pro DMG for Apple Macbook OS X. Brief Overview of Apple Xcode 10.1 for Mac OS X Apple Xcode 10.1. Checksums of Mac OSX installer DMGs. Contribute to notpeter/apple-installer-checksums development by creating an account on GitHub. All downloads are hosted by Apple. Links on this site take you directly to Apples download pages. This is not an official Apple website. Please consider donating to help maintain it.
Xcode is a complete developer toolset for creating apps for Mac, iPhone, iPad, Apple Watch, and Apple TV. Xcode brings user interface design, coding, testing, debugging, and submitting to the App Store all into a unified workflow. Downloading and updating Xcode
The current release of Xcode is available as a free download from the Mac App Store. The Mac App Store will notify you when an update is available or you can have macOS update automatically as it becomes available.
The latest beta version and previous versions of Xcode can be downloaded from the Downloads page. To download Xcode, simply sign in with your Apple ID. Apple Developer Program membership is not required. Using Xcode
Get step-by-step guidance on how to use Xcode to build, test, and submit apps to the App Store. Submitting apps to the App Store using Xcode
If youre an Apple Developer Program member, Xcode provides an integrated workflow to prepare and submit apps to App Store. You should use the latest version of Xcode available on the Mac App Store to submit your apps, or when available, the latest GM seed release from the Downloads page.
Do not submit apps built using beta software, as beta versions of Xcode, Operating Systems, and SDKs are for development and testing only. Learning about changes to Xcode
To learn about the latest features and capabilities in Xcode, see Whats New in Xcode. For update details in the latest released versions, including each beta release, see the Xcode Release Notes. Minimum requirements and supported SDKs Xcode Version Minimum OS Required SDK Architecture OS Simulator Swift Xcode 12.3 macOS Catalina 10.15.4 (Intel-based Mac) iOS 14.3
macOS 11.1
tvOS 14.3
watchOS 7.3
DriverKit 20.0 x86_64
armv7
armv7s
arm64
arm64e iOS 9.0-14.3
iPadOS 13.0-14.3
macOS 10.9-11.0
tvOS 9.0-14.3
watchOS 2.0-7.2 iOS 10.3.1-14.3
tvOS 10.2-14.3
watchOS 3.2-7.2 Swift 4
Swift 4.2
Swift 5.3 Xcode 12.2 macOS Catalina 10.15.4 (Intel-based Mac)
macOS Big Sur 11.0
(Apple silicon Mac) iOS 14.2
macOS 11
tvOS 14.2
watchOS 7.1
DriverKit 20.0 x86_64
armv7
armv7s
arm64
arm64e iOS 9.0-14.2
iPadOS 13.0-14.2
macOS 10.9-11.0
tvOS 9.0-14.2
watchOS 2.0-7.1 iOS 10.3.1-14.2
tvOS 10.2-14.2
watchOS 3.2-7.1 Swift 4
Swift 4.2
Swift 5.3 Xcode 12.1 macOS Catalina 10.15.4 (Intel-based Mac)
macOS Big Sur 11.0
(Apple silicon Mac) iOS 14.1
macOS 10.15.6
tvOS 14.0
watchOS 7.0
DriverKit 20.0 x86_64
armv7
armv7s
arm64
arm64e iOS 9.0-14.1
iPadOS 13.0-14.1
macOS 10.9-11.0
tvOS 9.0-14.0
watchOS 2.0-7.0 iOS 10.3.1-14.1
tvOS 10.2-14.0
watchOS 2.0-7.0 Swift 4
Swift 4.2
Swift 5.3 Xcode 12 macOS Catalina 10.15.4 (Intel-based Mac)
iOS 14
macOS 10.15.6
tvOS 14
watchOS 7.0
DriverKit 20.0 x86_64
armv7
armv7s
arm64
arm64e iOS 9.0-14.0
iPadOS 13.0-14.0
macOS 10.6-10.15.6
tvOS 9.0-14.0
watchOS 2.0-7.0 iOS 10.3.1-14.0
tvOS 10.2-14.0
watchOS 3.2-7.0 Swift 4
Swift 4.2
Swift 5.3 Xcode 11.7 macOS Catalina 10.15.2 iOS 13.7
macOS 10.15.6
tvOS 13.4
watchOS 6.2
DriverKit 19.0 x86_64
armv7
armv7s
arm64
arm64e iOS 8.0-13.7
iPadOS 13.0-13.7
macOS 10.6-10.15.6
tvOS 9.0-13.4
watchOS 2.0-6.2 iOS 10.3.1-13.7
tvOS 10.2-13.4
watchOS 3.2-6.2 Swift 4
Swift 4.2
Swift 5.2 Xcode 11.6 macOS Catalina 10.15.2 iOS 13.6
macOS 10.15.6
tvOS 13.4
watchOS 6.2
DriverKit 19.0 x86_64
armv7
armv7s
arm64
arm64e iOS 8.0-13.6
iPadOS 13.0-13.6
macOS 10.6-10.5.6
tvOS 9.0-13.4
watchOS 2.0-6.2 iOS 10.3.1-13.6
tvOS 10.2-13.4
watchOS 3.2-6.2 Swift 4
Swift 4.2
Swift 5.2 Xcode 11.5 macOS Catalina 10.15.2 iOS 13.5
macOS 10.15.4
tvOS 13.4
watchOS 6.2
DriverKit 19.0 x86_64
armv7
armv7s
arm64
arm64e iOS 8.0-13.5
iPadOS 13.0-13.5
macOS 10.6-10.15.4
tvOS 9.0-13.4
watchOS 2.0-6.2 iOS 10.3.1-13.5
tvOS 10.2-13.4
watchOS 3.2-6.2 Swift 4
Swift 4.2
Swift 5.2 Xcode 11.4.x macOS Catalina 10.15.2 iOS 13.4
macOS 10.15.4
tvOS 13.4
watchOS 6.2
DriverKit 19.0 x86_64
armv7
armv7s
arm64
arm64e iOS 8.0-13.4.x
iPadOS 13.0-13.4.x
macOS 10.6-10.15.4
tvOS 9.0-13.4
watchOS 2.0-6.2 iOS 10.3.1-13.4.x
tvOS 10.2-13.4
watchOS 3.2-6.2 Swift 4
Swift 4.2
Swift 5.2 Xcode 11.3.x macOS Mojave 10.14.4 iOS 13.3
macOS 10.15.2
tvOS 13.3
watchOS 6.1.1
DriverKit 19.0 x86_64
armv7
armv7s
arm64
arm64e iOS 8.0-13.3
iPadOS 13.0-13.3
macOS 10.6-10.15.2
tvOS 9.0-13.3
watchOS 2.0-6.1.1 iOS 10.3.1-13.3
tvOS 10.2-13.3
watchOS 3.2-6.1.1 Swift 4
Swift 4.2
Swift 5.1 Xcode 11.2.x macOS Mojave 10.14.4 iOS 13.2
macOS 10.15.1
tvOS 13.2
watchOS 6.1
DriverKit 19.0 x86_64
armv7
armv7s
arm64
arm64e iOS 8.0-13.2.x
iPadOS 13.0-13.2.x
macOS 10.6-10.15.1
tvOS 9.0-13.2
watchOS 2.0-6.1 iOS 10.3.1-13.2.x
tvOS 10.2-13.2
watchOS 3.2-6.1 Swift 4
Swift 4.2
Swift 5.1 Xcode 11.1 macOS Mojave 10.14.4 iOS 13.1
macOS 10.15
tvOS 13
watchOS 6.0
DriverKit 19.0 x86_64
armv7
armv7s
arm64
arm64e iOS 8.0-13.1
iPadOS 13.0-13.1
macOS 10.6-10.15
tvOS 9.0-13.0
watchOS 2.0-6.0 iOS 10.3.1-13.1
tvOS 10.2-13.0
watchOS 3.2-6.0 Swift 4
Swift 4.2
Swift 5.1 Xcode 11 macOS Mojave 10.14.4 iOS 13
macOS 10.15
tvOS 13
watchOS 6.0
DriverKit 19.0 x86_64
armv7
armv7s
arm64
arm64e iOS 8.0-13.0
iPadOS 13.0-13.0
macOS 10.6-10.15
tvOS 9.0-13.0
watchOS 2.0-6.0 iOS 10.3.1-13.0
tvOS 10.2-13.0
watchOS 3.2-6.0 Swift 4
Swift 4.2
Swift 5.1 Xcode 10.3 macOS Mojave 10.14.3 iOS 12.4
macOS 10.14.6
tvOS 12.4
watchOS 5.3 x86_64
armv7
armv7s
arm64
arm64e iOS 8.0-12.4
macOS 10.6-10.14.6
tvOS 9.0-12.4
watchOS 2.0-5.3 iOS 10.3.1-12.4
tvOS 10.2-12.4
watchOS 3.2-5.3 Swift 4
Swift 4.2
Swift 5 Xcode 10.2x macOS Mojave 10.14.3 iOS 12.2
macOS 10.14.4
tvOS 12.2
watchOS 5.2 x86_64
armv7
armv7s
arm64
arm64e iOS 8.0-12.2
macOS 10.6-10.14.4
tvOS 9.0-12.2
watchOS 2.0-5.2 iOS 8.1-12.2
tvOS 9.0-12.2
watchOS 2.0-5.2 Swift 4
Swift 4.2
Swift 5 Legend
Minimum OS Required: The version of macOS required to install this version of Xcode.
SDK: The version of SDKs included in this version of Xcode. Download Xcode Mac
Architecture: The architectures supported for development by this version of Xcode.
OS: The iOS, iPadOS, macOS, tvOS, and watchOS versions supported by this version of Xcode for developing, installing, and debugging applications.
Simulator: Versions of iOS, tvOS, and watchOS simulators supported for development by this version of Xcode.
Swift: Version of Swift supported for development by this version of Xcode. Providing feedback and reporting bugs
Your feedback goes a long way towards making Xcode even better. With Feedback Assistant, you can report issues or request enhancements to APIs and tools. Include detailed information about issues, including the system and developer tools version information, and any relevant crash logs or console messages. To ask questions and find answers by Apple engineers and other developers, visit the Apple Developer Forums. Invalid private key and certificate pairing
If you received an error message saying, 'Xcode could not find a valid private-key/certificate pair for this profile in your keychain.' This error message indicates that the Keychain Access application on your Mac is missing either the public or private key for the certificate you are using to sign your app.
This often happens when you are trying to sign and build your app from a different Mac than the one you originally used to request your code signing certificate. It can also happen if your certificate has expired or has been revoked. Ensure that your apps provisioning profile contains a valid code signing certificate, and that the Keychain Access application on your Mac contains that certificate, the private key originally used to generate that certificate, and the WWDR Intermediate Certificate.
For instructions on how to resolve this and other code signing errors, review the Code Signing Support page. Apple security updates
For information on the security content of Xcode updates, visit the Apple security updates page.
This page contains my notes about Xcode, the IDE used for writing applications for Mac OS X and iOS devices (iPhone, iPad). For the moment, there is also a section about Interface Builder (IB), the RAD tool to develop the GUI of Mac applications.
3 Xcode Preferences
4 Keyboard shortcuts
6 Workspaces, projects, build configurations, targets, schemes
10 Adding unit tests to a project
11 The Xcode build system
12 Customize new project
12.1 Change default project structure
13 Debugging with Xcode
14 Instruments Developer Tools
Since version 4.3, Xcode is distributed as a standalone app bundle. A number of additional developer tools that Apple now considers optional must be installed separately. Things I habitually install are
Command line tools: These are required for software builds outside of Xcode, such as Fink, or builds of third party software packages that I use for my own projects. The easiest way to install these is from within Xcode: Open the Preferences dialog, then go to Downloads Components, select the entry 'Command Line Tools' and click the install button.
iOS simulator applications for older versions of iOS: These can also be installed from within Xcode in the same way as the command line tools.
Graphics Tools for Xcode: One of the most useful applications in this tool suite is Pixie, which allows to inspect displayed graphics on a pixel level with a 'magnifying glass' effect. From within Xcode, select the menu entry 'Xcode Open Developer Tools More Developer Tools...'. This opens a browser window that shows all additional Xcode tool packages. The Graphics Tools package should be among these.
Audio Tools for Xcode: See 'Graphics Tools' for how to get at these tools.
Auxiliary Tools for Xcode: See 'Graphics Tools' for how to get at these tools.
Xcode plugins
Xcode plugins use the extension xcplugin . Installing a plugin is very simple, just drop it into
Create the directory if it does not exist yet. To install a plugin system-wide, on Mac OS X 10.6 it needs to be dropped into
Useful plugins
GTMXcodePlugin from the Google Toolbox for Mac: Provides an option to trim trailing whitespace when a file is saved. Note that this plugin is no longer necessary as newer versions of Xcode now have an official user preference for this.
Xcode Preferences Preferences dialog
These settings refer to the Preferences dialog as shown in Xcode 4.5.
Behaviors
Running completes
Hide debugger = true (default = if no output, hide)
Text Editing Editing
Line numbers = true
Show column position = true
Page guide = true, at column = 80
Automatically trim trailing whitespace = true
Including whitespace-only lines = true
Default text encoding = UTF-8
Default line endings = OS X / Unix (LF)
Convert existing files on save = false
Text Editing Indentation
Prefer indent using = Spaces
Tab width = 2
Indent with = 2
Tab key = Indents in leading whitespace
Line wrapping = false
Align consecutive // comments = true
Locations
See section Xcode paths
The 'Archives' location should be changed to something like /Users/foo/dev/Xcode Archives so that the archived builds are indexed by Spotlight. Without Spotlight indexing, symbolicating crash logs will probably fail. For details about symbolicating see the wiki page on Mac OS X Programming.
Snapshots
File Project Settings Snapshots Create snapshot of project before mass-editing operations = false
I don't see the use for snapshots when Ialso use version control
In the past this automatic-snapshot feature made it virtually impossible for me to use refactoring because the snapshot would include the entire project directory with all third party software builds inside (hundreds of MB)
Hidden preferences
Get rid of the warning message box when you undo after saving a document (note: this is probably no longer necessary for Xcode 4.5):
Keyboard shortcuts Useful shortcuts
These shortcuts are defaults in Xcode 4.5:
Close document = Ctrl + Command + W
Jump to next/previous counterpart = Ctrl + Command + Cursor Up/Down
Open quickly = Command + Shift + O
In the window that opens just start to type to incrementally filter possible documents to open
The word under the cursor is used for initial suggestions
Commit dialog = Alt + Command + C
Use selection for Find = Command + E
Unlike a similar function in Visual Studio (Ctrl+Tab) this does not immediately perform a search
To follow up with a 'search next', press Command + G
Changes to defaults
TODO
Xcode paths
Build results
By default these are stored in
This folder can be changed to a project-relative path under 'Preferences Locations Locations Derived Data'
Archives and Snapshots
By default these are stored in
These folders can be changed under 'Preferences Locations Locations'
Symbols downloaded from an iOS device
Workspaces, projects, build configurations, targets, schemes References
Information on workspaces, schemes etc., including interesting links to the underlying documentation from Apple: http://blog.carbonfive.com/2011/04/04/using-open-source-static-libraries-in-xcode-4/
Summary
A workspace is a container for one or more projects
A project contains
One or more build configurations
One or more targets
One or more schemes
The actual source code and resource files (obviously)
A build configuration is just a name. Typically there are two build configurations: Debug and Release.
A target is a collection of the following things:
For each configuration, a collection of build settings
For each configuration, a definition of which source code files need to be built
For each configuration, a definition of additional files that belong to the target/configuration, usually resource files
A scheme is a collection of the following things:
It contains one or more targets
It defines what happens for each of its targets when one of the actions in the 'Product' menu is executed: Build, Run, Test, Profile, Analyze, Archive
The definition for each action includes which build configuration to use
Additional notes:
A target is inactive until it is associated with at least one scheme
Workspace
A workspace's data is stored in a folder that has the extension
The Finder treats the folder as a bundle, i.e. for the user it appears a file that can be double clicked.
Example workspace content
Non-admin account requires group membership
If you are logged in as a normal (non-admin) user, when you select 'Build and debug' for the first time in Xcode you will be asked for the admin password. This happens once every login session. I am on Snow Leopard and use Xcode 3.2.5.
This is rather unexpected, but the Xcode release notes indeed mention that this is the case in the current seed of the developer tools, but that 'the security mechanisms and policy here are still under development for Snow Leopard, and may change further in later seed releases.'. In the same release notes, but on another note, the following explanation appears: 'All Xcode operations that operate between processes now require authenticated administrator privileges. In the optimal case, you will be asked to authorize developer privileges only once, and that authorization will be stored in your Keychain.'
The 'optimal case' certainly does not apply here, as the query appears every time I log out and log in again. It appears, though, that the problem can be circumvented by giving the non-admin user membership of a certain system group:
Precompiled Prefix Header
Information in this chapter is taken from the chapter 'Using a Precompiled Prefix Header', section 'Reducing Build Times', article 'Xcode Build System Guide' (located under ADC Home Reference Library Guides Tools Xcode).
A 'precompiled prefix header' is a header file that is
precompiled
included automatically at the beginning of each file of a target
there can be only one such file per target
but one file can be shared among multiple targets or projects
The header file can be shared among multiple targets, or even projects. Because of this, and because different targets/projects may contain source files written in different programming languages, it is recommended that the precompiled prefix header contain appropriate guard macros, such as this:
To configure Xcode to use a precompiled prefix header, change the following build settings of the appropriate target, or maybe even of the entire project:
GCC_PREFIX_HEADER (Prefix Header). Change the value of this build setting to the project-relative path of the prefix header file
GCC_PRECOMPILE_PREFIX_HEADER (Precompile Prefix Header). Make sure that this option is turned on.
Note: When the Xcode wizard creates a new project, it helpfully adds a precompiled prefix header to the project which imports Cocoa/Cocoa.h. Unfortunately the header is not used because the appropriate build settings are disabled.
Adding a doxygen target to a project
Documentation about managing targets can be found in 'ADC Home Reference Library Guides Tools Xcode Xcode Build System Guide'.
The following procedure adds Doxygen support to a project:
Prepare the project with these steps
Add a doxygen folder
Inside that folder, generate a template Doxygen configuration file (named Doxyfile ) like this:
Inside Xcode, add the Doxyfile to the project so that you can edit it conveniently in the Xcode editor
Manually modify the following options within the Doxyfile :
Create the new target in Xcode
Select 'Project Add Target' from the menu. This opens the 'New Target' wizard.
From the category 'other', select the target type 'Shell Script Target'
On the next page specify these properties:
Target name = doxygen
Add to project = the project
Click the 'Finish' button to create the target
Configure the target
Find the new target in the Group Tree pane, then expand the target
A build phase entry named 'Run Script' appears; open the Info window for the build phase entry
The actual shell script can be added on the 'General' tab. This is what I usually put in:
Adding unit tests to a project Overview
The xUnit unit testing suite has been ported to Objective-C by Sen:te, under the name of OCUnit. At some time in the past, Apple has started distributing OCUnit as an integral part of XCode.
Apple distinguishes two types of tests:
Logic tests: This is the traditional type of unit tests where 'only' specific classes are tested in a rather narrow environment. In iPhone development, logic tests are built using the iOS Simulator SDK, but they are run outside of the simulator, right after Xcode has finished building the unit test target.
Application tests: This type of unit test focuses on exercising the application as a whole. In iPhone development, application tests are built into a test bundle that is then embedded into the application bundle and executed on the device itself. This allows to run tests in a realistic production environment, including tests that exercise code that requires hardware capabilities of the device.
References
This article on mobileorchard.com has a short, slightly outdated, step-by-step introduction on how to add unit tests to an Xcode iPhone project
This article on developer.apple.com is more in-depth, and also focuses on iPhone development
Logic tests
Create a top-level folder named 'test' that will contain all test-related files. Add the following subfolders
src = contains unit test source code files
resource = contains resources required by unit tests
testdata = contains other test data files
Add new unit test target
Select Project New Target...
The target type is 'Unit Test Bundle' and can be found either under the category 'Cocoa Touch' or under the category 'Cocoa'
Select the category that matches the project type
Target name = 'Unit tests'
Modify the new target's build settings
Base SDK = Remove custom value so that the target inherits the project-wide setting
Header Search Path = ./src (since the test sources are completely separated from the normal application sources, we don't want to deal with relative path issues for each import statement; the application can be seen as third party software from the point of view of the unit test bundle)
Precompile prefix header = Yes
Prefix Header = src/Prefix.pch (or whatever file is the prefix header of the project)
Add all classes for which test cases are written to the unit test bundle
An alternative (and preferrable) approach would be to build the application as a static library, and then to link the unit test bundle against that library
Unfortunately this approach cannot be chosen because I have not yet found a way how to link the real application against the static library
Info.plist file
When the new target was created, Xcode automatically added an Info.plist file for that target to the project (e.g. Unit tests-Info.plist )
The file is located in the project's top-level folder, but we want to move it to test/resource
Update the build setting (under 'Packaging') that refers to the file (e.g. test/resource/Unit tests-Info.plist )
Make sure that the file is not copied
Add a test case file
Context menu for test/src Add New File... Cocoa Touch Class (or Cocoa Class) Objective-C test case class
File name = does not matter
Targets = 'Unit tests' ( not the project's main target!)
Test case characteristics
File and class name are irrelevant
Class must inherit from SenTestCase
Test method name must begin with test (lower case), the method must have no parameters and return void
Running tests
Building the target automatically runs the unit tests
The target has an additional 'Run Script' phase which invokes
Application tests
TODO
The Xcode build system Compiling projects from the command line
To build an Xcode project on the command line, you use the utility
Also see the man page. Some examples
Useful links:
Details about the build system
Useful links:
The Xcode build system is based on the concept of 'targets' - not exactly a surprising thing.
A target is composed of a series of build phases
Each build phase performs an action on one or more files that are part of the target
Example build phases for a simple 'Cocoa Application' target
Copy bundle resources
Compile sources
Link binary with libraries
The target type usually determines which build phases there are (e.g. a 'Shell Script' target has different phases than a 'Cocoa Application' target)
To modify the build behaviour, a large number of 'build settings' can be made, usually either on the project or the target level
Examples for build settings are compiler or linker flags, which architectures to build, etc.
List of sources of build settings, and their precedence
xcodebuild command-line flags
The target
The project
Xcode application preferences
Xcode's built in defaults
The user environment (e.g. /.MacOSX/environment.plist )
Build configurations (e.g. Debug, Release) are collections of build settings
Build configuration files
Build settings by default are stored in the Xcode project, but they can also be placed in one or more external files called 'build configuration files'
These files usually have the extension .xcconfig
One useful scenario for .xcconfig files is if multiple projects should share a set of common build settings
The settings in an .xcconfig file usually relate to a single build configuration
An .xcconfig file is a simple text file with property/value pairs; e.g.
The build configuration file must be added to a project in order to become available within the project
Once the file is part of the project, a build configuration (e.g. Debug) can be based on the file - this can be done inside the appropriate Info Inspector window
The snippet from the Xcode project's .pbxproj file looks like this: The string 65F688F1A6A7B5ADEF3706EA is merely a reference to the actual .xcconfig file that is defined elsewhere in the .pbxproj
Build rules
Every target has a set of associated build rules - refer to the target's Info Inspector window
Each rule tells the build system how to process a certain file type
For instance, the 'System C' rule defines that 'C source files' should be processed using 'GCC System Version'
Most of the time, a target will have only the built-in rules, but it is possible to define custom rules
File types in a custom rule are defined either by selecting from built-in file types, or via a file pattern (e.g. *.foo )
Processors in a custom rule are defined either by selecting from built-in processors, or via a custom command or script
In addition to file type and processor, the rule must also specify the output file(s) - presumably so that the build can check whether a target is up-to-date or needs processing
Useful build settings
ARCHS
Determines the architecture(s) of the build
$(NATIVE_ARCH) refers to the architecture of the machine that the build is taking place on
Other architectures are: i386, ppc, armv6, armv7
To make a universal build, specifiy ARCHS='ppc i386'
SDKROOT
Customize new project Change default project structure
When Xcode creates a new project, the project structure is not entirely to my liking. Changing things is not entirely straightforward, therefore this section documents a few things.
Xcode Dmg Download Regular sources
Regular sources (.h and .m files) can simply be re-added after they have been physically moved. Xcode will automatically add .m files to the build target, while .h files are automatically excluded.
Note: The file main.m counts as a regular source file.
Precompiled header
The project-specific precompiled header file Foobar_Prefix.pch can be simply re-added after it has been physically moved. It should not be added to the build target. In addition, the following references have to be updated:
Build target, all configurations: Under 'GCC 4.2 - Language', the property 'Prefix header' must be updated (to find references, you may want to search for 'prefix')
IB files
Interface Builder (IB) files (.xib files) can be simply re-added after it has been physically moved. They should be added to the build target.
Info.plist
The Info.plist file can be simply re-added after it has been physically moved. It should not be added to the build target. In addition, the following references have to be updated:
Build target, all configurations: Under 'Packaging', the property 'Info.plist' must be updated (to find references, you may want to search for 'Info.plist')
Debugging with Xcode How to debug EXC_BAD_ACCESS
The reason for getting an EXC_BAD_ACCESS error message usually is a message being sent to an object that is already deallocated. If the cause for the problem is not immediately apparent, the situation is often hard to debug since you can't inspect the object in question. The solution are 'zombies'.
When this feature is enabled in Xcode, a dummy object (a zombie) is kept at the memory location of a released object. Inspection of the dummy object often provides valuable clues as to what happened. Enabling of zombies in Xcode 4 is very easy:
Product Edit Scheme
Select the 'Run' action
On the 'Diagnostics' tab, check the 'Enable Zombie Objects' checkbox
Note: Don't forget to disable zombie support after you are done with debugging.
Instruments Overview
The easiest way to run Instruments is from within Xcode:
Select the menu item 'Product Profile'
When Instruments launches you are prompted with a selection of trace templates that are appropriate for the target you are profiling (e.g. you won't get iOS templates if you are profiling a Mac OS X application)
Leaks instrument
A useful option is 'Gather Leaked Memory Contents':
Select the 'Leaks' instrument
In the detail view a number of categories appear on the left-hand side
One of them is the category 'Leaks configuration'; below that category you will find a checkbox labelled 'Gather Leaked Memory Contents'
Click the checkbox
To actually see the memory content, select the menu item 'View Extended Detail'
When you select a leak you will now see a stack trace and a hex view of the memory content that was leaked
Leaks from the command line
Run the program from within Xcode
Execute the following command in Terminal.app
You will get a nice overview of all leaks
Most important: You will get an ASCII representation of the hexdump
Allocations instruments
Use this instrument to find memory that is 'lost' instead of leaked. Similar to leaks, lost memory is allocated but never freed, but the difference is that there is still a reference to the memory block hanging around somewhere. This is why the Leaks instrument won't find this type of problem. Possible sources for lost memory
Retain cycles where two objects reference each other, but nothing else refers to those two objects
Forgotten dictionary entries
Probably more, but the two examples above are what comes to mind immediately
Notes about using the Allocations instrument
It must be configured to use the 'Created Still Living' option
Bring the application into a stable state where no allocations are happening
Perform an operation
Undo the operation, or use some other means to bring the application back into the stable state from where you started
Possibly wait some time until your app activity has died down
Memory usage should now be exactly the same as when you started the initial operation
In addition the following might apply to the application
Apply a time filter to the Allocations track so that only allocations in the time between the start and the stop of your operations are taken into account
You should now see zero net values in the columns 'Live Bytes' and ' Living', i.e. all objects that were created in the filtered timespan have also been destroyed
Whether or not this works depends, of course, on how the application is implemented - if the application replaces existing objects with new objects, net values will not be zero and this type of examination will not provide useful results.
Interface Builder (IB)
This chapter contains various tidbits related to working with Interface Builder (short: IB). The main ressource for IB-related documentation is the 'Interface Builder User Guide' [1]
What is a .nib file?
nib = N eXT I nterface B uilder,
A .nib file contains an archived version of a set of GUI elements, and/or other non-visual elements (such as controllers) that are responsible for managing the GUI elements
The content of a .nib file is edited with the Interface Builder application
When a .nib file is loaded, its content is unarchived and the objects defined within the archive are re-created exactly as they were present when the file was last edited with Interface Builder
IB version 3 introduced a new file format, using the extension .xib, which is functionally identical to .nib, but stores its content in a flat file. This is much more suitable for storing the file in SCM systems, and makes it also easier to process the file with tools like diff .
What is the 'File's Owner'?
The 'File's Owner' object is the 'controller' object that is responsible for (the owner of) the contents of the .nib file
When the .nib file is loaded, the File's Owner object must already exist
All the other objects inside a .nib file are created at the time that the .nib file is loaded
When the .nib file is loaded, the nib loading code restores any outlet connections defined in the .nib file
The File's Owner object thus becomes the link between the .nib file and the rest of the application code
The File's Owner object of the application's main .nib file is the NSApplication object
What is an outlet?
Represents a member variable of the class that the outlet belongs to
An outlet has a type
An outlet is defined in the 'Classes' view, in the Info window - Attributes
In the 'Instances' view, control-drag from an instance A to a different instance B; this allows to connect an outlet within instance A to the instance B (if the outlet has a type that matches the type of instance B); when the .nib is loaded, the outlet's member variable of instance A will have a reference to instance B
What is an action?
Represents a method of the class that the action belongs to
The method signature must look like this: (void)myAction:(id)sender;
With Java, it is important that the name of the argument is 'sender'
An action is defined in the 'Classes' view, in the Info window - Attributes
In the 'Instances' view, control-drag from an instance A to a different instance B (possible only if A is a control); this allows to connect the control to one of the target's (instance B) action method
How to define a button that should react to the Enter, Escape or any other key being pressed:
Info window - Attributes - Equiv Xcode 8 Dmg
How to define the first element that should be active when a window is opened:
Select the NSWindow instance
Control-Drag from the instance to the element that should be active
Info window - Connections - Outlet - initialFirstResponder
Click the 'connect' button
How to define tabbing between two elements:
Select first element
Control-Drag to the second element
Info window - Connections - Outlet - nextKeyView
Click the 'connect' button
How to define the NSApplication delegate:
Select the 'File's Owner' instance in the main .nib; this is the NSApplication object
Connect the outlet delegate of the 'File's Owner' instance to the desired delegate instance
Some of the messages that the delegate receives are sent by NSApplication itself (e.g. applicationOpenFile ), others are sent by the application's default notification centre (the delegate is automatically registered with the default notification centre if it implements methods that correspond to the delegate messages)
The documentation for NSApplication lists the 20+ delegate methods
Xcode 11 Dmg References
Interface Builder User Guide Xcode 12 Dmg Retrieved from 'https://wiki.herzbube.ch/index.php?title=Xcodeoldid=6198'
broken image