Questions tagged [xcode]

Xcode is Apple's integrated development environment (IDE). USAGE NOTE: Use this tag only for questions about the Xcode IDE itself, and not for general Mac or iOS programming topics. Use [cocoa] for Mac programming questions, and [cocoa-touch] or [iOS] or [Swift] for iOS programming questions.

Xcode is Apple's integrated development environment (IDE) tool, which runs on . It is used for creating apps for macOS (), iOS (), iPadOS (),watchOS () and tvOS () platforms.

This tag should be used only for questions about the Xcode tool itself, not for programming questions for which you happen be using Xcode - if your question would stay the same if you used and for writing your program, avoid adding this tag.

  • For macOS programming questions, use the or tag.

  • For iOS programming questions, use the or tags.

  • For Apple Watch programming questions, use the , or tags.

  • For questions about the Objective-C language and its features, use the tag.

  • For questions about the Swift language and its features, use the tag.

Latest Versions:

  • Current stable version is Xcode 14.2 released on December 13, 2022
  • Beta version is Xcode 14.3 RC released on March 21, 2023

Release notes:

SDKs in Xcode 14

  • iOS 16
  • iPadOS 16
  • tvOS 16
  • watchOS 9
  • macOS 13

This tag covers:

  • Project organization
  • Source code editing
  • Build system
  • Unit testing
  • Xcode Instruments
  • Interface Builder (prior to Xcode 4, Interface Builder was a separate app, in which case you would use the tag)

More information:

Related:

Related tags for specific versions:

158769 questions
276
votes
4 answers

How to uninstall downloaded Xcode simulator?

How to uninstall one of the downloaded Xcode simulators? My iOS 7 Simulator won't boot (Unable to boot the iOS Simulator). I want to completely reinstall it. I tried: Deleting ~/Library/Caches/com.apple.dt.Xcode Deleting Xcode and downloading it…
Ricardo Sanchez-Saez
  • 9,466
  • 8
  • 53
  • 92
274
votes
12 answers

Changing text of UIButton programmatically swift

Simple question here. I have a UIButton, currencySelector, and I want to programmatically change the text. Here's what I have: currencySelector.text = "foobar" Xcode gives me the error "Expected Declaration". What am I doing wrong, and how can I…
rocket101
  • 7,369
  • 11
  • 45
  • 64
274
votes
32 answers

How to change the background color of a UIButton while it's highlighted?

At some point in my app I have a highlighted UIButton (for example when a user has his finger on the button) and I need to change the background color while the button is highlighted (so while the finger of the user is still on the button). I tried…
MartinMoizard
  • 6,600
  • 12
  • 45
  • 75
272
votes
45 answers

Undefined symbols for architecture arm64

I am getting a Apple Mach-O Linker Error everytime I import a file from CocoaPods. Undefined symbols for architecture arm64: "_OBJC_CLASS_$_FBSession", referenced from: someFile ld: symbol(s) not found for architecture arm64 I get about 12 of…
GangstaGraham
  • 8,865
  • 12
  • 42
  • 60
270
votes
8 answers

iPhone 6 Plus resolution confusion: Xcode or Apple's website? for development

Apple's website claims that the resolution is 1080p: 1920 x 1080 However, the launch screen required by Xcode (8.0 GM launched today) is 2208 x 1242. Who's right?
JasonGenX
  • 4,952
  • 27
  • 106
  • 198
270
votes
19 answers

How to run iPhone emulator WITHOUT starting Xcode?

On my old Mac running Snow Leopard, I could type "ios" into spotlight and it would start up the iPhone/iPad emulator by itself. I have since had to get a new machine running Lion. I have installed Xcode for Lion, I have installed the developer tool…
user796446
269
votes
18 answers

How to remove provisioning profiles from Xcode

Does anyone know how to remove previously installed provisioning profiles from Xcode? I have seen this link, but I am not able to find that location in my system. So I think there must be some other way to remove provisioning profiles.
vaibhav silar
  • 2,905
  • 2
  • 15
  • 18
269
votes
21 answers

Xcode Simulator: how to remove older unneeded devices?

I'm running Xcode 4.3.1 iOS-Simulator which originally only supports iOS 5.1. I need to test my code with iOS 4.3, so I used Xcode's "Install" feature to install it as described in "Installing Xcode with iOS 4.3 device simulator?" Now I'm finished…
David H
  • 40,852
  • 12
  • 92
  • 138
266
votes
24 answers

Xcode: issue "file xxx.png is missing from working copy" at project building

After deleting/adding some png files to project, i have got messages when building project. "file ProjectPath\aaa\xxx.png is missing from working copy." All these files are in the project, and the application is running. However, these messages are…
Iban
  • 2,851
  • 2
  • 12
  • 8
266
votes
8 answers

Why isn't ProjectName-Prefix.pch created automatically in Xcode 6?

Why isn't ProjectName-Prefix.pch created automatically in Xcode 6 ? Is the precompile header no longer needed ? Where should I write the code that was in ProjectName-Prefix.pch before ?
Wei
  • 3,492
  • 4
  • 18
  • 18
264
votes
32 answers

Execute action when back bar button of UINavigationController is pressed

I need to execute an action (emptying an array), when the back button of a UINavigationController is pressed, while the button still causes the previous ViewController on the stack to appear. How could I accomplish this using swift?
StevenZ
  • 6,983
  • 5
  • 16
  • 18
261
votes
15 answers

How to Empty Caches and Clean All Targets Xcode 4 and later

Jonathan suggest here: Xcode Includes .xib files that have been deleted! that cleaning all targets and empty the caches will fix the problem with Xcode including deleted .xib files but I cannot find a way to empty the cache in Xcode 4. How to do…
Tieme
  • 62,602
  • 20
  • 102
  • 156
261
votes
46 answers

"Unknown class in Interface Builder file" error at runtime

Even though Interface Builder is aware of a MyClass, I get an error when starting the application. This happens when MyClass is part of a library, and does not happen if I compile the class directly in the application target.
jhoule
  • 2,466
  • 3
  • 17
  • 12
258
votes
3 answers

What is "Constrain to margin" in Storyboard in Xcode 6

I am Working with autolayout and constraints and found there is a Constrain to margins option in Xcode 6 which was not present in Xcode 5 and is checked by default. I created a test project then I added a UITableView on a ViewController with the…
Bhumit Mehta
  • 16,278
  • 11
  • 50
  • 64
254
votes
18 answers

Make a VStack fill the width of the screen in SwiftUI

Given this code: import SwiftUI struct ContentView: View { var body: some View { VStack(alignment: .leading) { Text("Title") .font(.title) Text("Content") .lineLimit(nil) .font(.body) Spacer() …
ielyamani
  • 17,807
  • 10
  • 55
  • 90