Xcode 9.3: Core Animation Instrument Deprecated

April 25th, 2018

Filed under: Instruments, Xcode | Be the first to comment!

Apple deprecated the Core Animation instrument in Xcode 9.3. If you’re looking for the debug options the Core Animation instrument had, use Xcode’s view debugger. Choose Debug > View Debugging > Rendering to access the debug options.

Facebooktwittergoogle_plusredditmail

Version Control Book Released

April 17th, 2018

Filed under: Version Control | Be the first to comment!

I released my latest book, Version Control for iOS and Mac Developers. It’s a free download. Go to the book’s website to download it.

Facebooktwittergoogle_plusredditmail

Xcode Releases Site

April 13th, 2018

Filed under: Xcode | Be the first to comment!

A common question I see on Apple developer forums is what version of Xcode can be used with a particular version of macOS. The Xcode Releases site provides the answer to this question.

Xcode Releases lists every Xcode version Apple has ever released along with operating system requirements and download links. As you can see from the website:

  • Xcode 9.2 is the latest version for macOS 10.12.
  • Xcode 8.2.1 is the latest version for macOS 10.11.
  • Xcode 7.2.1 is the latest version for macOS 10.10.
  • Xcode 6.2 is the latest version for macOS 10.9.
Facebooktwittergoogle_plusredditmail

Git Detached Head

March 27th, 2018

Filed under: Version Control | Be the first to comment!

I’ve recently seen multiple questions online from people having problems committing to git because the git repository had a detached head. This article answers the most common questions about detached heads.

What Is a Detached Head?

A detached head in a git repository occurs when the repository has no current branch.

Why Is a Detached Head Bad?

A detached head isn’t a problem until you commit some changes. If you commit changes with a detached head, the new commit exists, but it will not appear in any branch’s commit history. The only way to access a commit from a detached head is to memorize the commit number. Git commit numbers are long, random hexadecimal numbers, making them difficult to remember.

What Causes a Detached Head?

Checking out a specific commit is the most common way to detach the head from a git repository.

How Do You Fix a Detached Head?

Check out a local branch. The branch you check out will become the current branch, the attached head of the repository.

To checkout a local branch in Xcode, open the source control navigator by choosing View > Navigators > Show Source Control Navigator.

SourceControlNavigatorDetachedHead

Notice the long hexadecimal number number next to the SpriteKitGitDemo folder in the screenshot. That number is the commit number. The fact that there’s a commit number instead of a branch name next to the folder means the repository has a detached head.

The local branches are inside the Branches folder. Click the disclosure triangle to show them.

Select a branch, right-click, and choose Checkout to check out the branch.

Learn More About Version Control

Facebooktwittergoogle_plusredditmail

Going Back to a Previous Git Commit in Xcode

March 12th, 2018

Filed under: Version Control, Xcode | Be the first to comment!

Something that can happen to you when using version control is you commit a change to the version control repository, realize you made a mistake, and want to go back to an earlier commit. How do you do this in Xcode?

Xcode provides no direct way to go back to an earlier commit. What you have to do is create a branch off the earlier commit and work off that branch.

Open the source control navigator by choosing View > Navigators > Show Source Control Navigator. Select the current branch from the source control navigator. The Xcode editor shows all the commits for that branch.

XcodeCommitList

Select the commit you want to use, right-click, and choose Branch from CommitNumber. The commit number is a long hexadecimal number. Name the branch and click the Create button. Now you’re working from the earlier commit.

Learn More About Version Control

Facebooktwittergoogle_plusredditmail