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.

SDKs in Xcode 11.3

  • iOS 13.3
  • iPadOS 13.3
  • tvOS 13.3
  • watchOS 6.1
  • macOS 10.15.2.

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:

Release notes:

Xcode 11.3 Release notes

Related:

Related tags for specific versions:

150193 questions
42
votes
3 answers

Xcode - Test class File is part of module, ignoring import

So I have an iOS project with tests and everything was working properly. I felt the need to change the project name. I did as indicated at apple's docs, selected the project and changed its name. After a while of updating things for this to finally…
Nuno Gonçalves
  • 5,127
  • 6
  • 39
  • 58
42
votes
4 answers

Unable to profile app on device with iOS 9.0.1 using Xcode 7, 7.0.1 or 7.1 beta

I have been trying unsuccessfully to profile my device (via Instruments) using the latest version of Xcode 7.0.1 (7A1001 released 9/28), as well as the previous version of Xcode 7 (7A218), as well as Xcode 7.1 Beta 2 (7B75). My device is an iPhone…
Derek Lee
  • 2,852
  • 3
  • 24
  • 32
42
votes
9 answers

UIApplication.sharedApplication().setStatusBarStyle() deprecated in iOS 9

I have been using UIApplication.sharedApplication().setStatusBarStyle() In my appDelegate and it has worked fine, but since iOS 9, this method is deprecated and I can't find an alternative. I want to change the statusbar style to .LightContent for…
Rick
  • 3,037
  • 2
  • 15
  • 16
42
votes
7 answers

CGContextSaveGState: invalid context 0x0 (Xcode 7 GM)

I have this problem after I compiled my code with Xcode 7 GM. According to Apple this is a bug, but it still seems to be an issue. Everything works fine, but is it possible to get rid of these errors? : CGContextSaveGState: invalid context 0x0. If…
Beto
  • 3,343
  • 5
  • 27
  • 37
42
votes
4 answers

Which conditional compile to use to switch between Mac and iPhone specific code?

I am working on a project that includes a Mac application and an iPad application that share code. How can I use conditional compile switches to exclude Mac-specific code from the iPhone project and vice-versa? I've noticed that TARGET_OS_IPHONE…
Jose Ibanez
  • 3,255
  • 3
  • 25
  • 33
42
votes
34 answers

Command failed due to signal: Abort trap: 6

Since Xcode 7 and Swift 2.0, I get the error above, like in the screenshot shown here: I have no idea where this is coming from, cleaning and deleting derived data didn't work. Anyone else experiencing this problem? Project settings: Target…
swalkner
  • 15,150
  • 25
  • 107
  • 195
42
votes
9 answers

Removing objects from an array based on another array

I have two arrays like this: var arrayA = ["Mike", "James", "Stacey", "Steve"] var arrayB = ["Steve", "Gemma", "James", "Lucy"] As you can see, James and Steve match and I want to be able to remove them from arrayA. How would I write this?
Henry Brown
  • 2,079
  • 6
  • 26
  • 45
42
votes
17 answers

How can I make a countdown with NSTimer?

How can I make a countdown with an NSTimer using Swift?
Giovanie Rodz
  • 1,333
  • 2
  • 10
  • 7
42
votes
8 answers

ionic Failed to load webpage with error: Could not connect to the server

I'm having an issue with Ionic projects after updating to Xcode 6 and iOS 8. When trying to run projects I get the following error in Xcode: Failed to load webpage with error: Could not connect to the server. The full log is: 2014-10-11…
BarakChamo
  • 2,819
  • 5
  • 28
  • 37
42
votes
5 answers

Only ONE VIEW landscape mode

I finished my iOS app but I need to set only ONE view to landscape mode, the rest of the views can only be seen in portrait mode. I'm using Xcode 5.1 and I created all of my Views by dropping in my storyboard View Controllers from the right panel,…
maeq
  • 1,023
  • 1
  • 12
  • 19
42
votes
4 answers

Can Swift playgrounds see other source files in the same project?

I created the most simple custom class in a separate Swift file in my project: class Foo { init() { println("I made a foo.") } } Then, in a playground within the same project, I tried var x = Foo() Xcode didn't seem to like…
Maxwell Collard
  • 2,029
  • 3
  • 14
  • 12
42
votes
5 answers

On mac, g++ (clang) fails to search /usr/local/include and /usr/local/lib by default

I'm on a mac and I used homebrew to install gmp. Kyumins-iMac:gcjlib math4tots$ g++ main.cpp -lgmp -lgmpxx In file included from main.cpp:2: ./gcjlib.hpp:4:10: fatal error: 'gmpxx.h' file not found #include ^ 1 error…
math4tots
  • 7,575
  • 11
  • 49
  • 89
42
votes
5 answers

Testing the Keychain - OSStatus error -34018

I'm trying to test code that reads and alters the keychain using the basic SenTest framework on Xcode. The code works fine on device, but when I start the test I get these errors every time I want to touch the keychain with…
Andrew
  • 2,058
  • 1
  • 19
  • 42
42
votes
4 answers

How to change the size of a view controller on the storyboard for editing purpose?

I have a simple question and I have spent countless hours trying to figure this out. How can I change the size of a view controller in an Xcode Storyboard for editing purposes? I have a large form/questionnaire I would like to place on my view…
AyBayBay
  • 1,558
  • 2
  • 17
  • 35
42
votes
5 answers

Navigation bar disappeared from my storyboard items

From one day to another the navigation bar disappeared from my storyboard items in XCode 4.6.2. I can't restore them (cleaning, rebuilding, closing, reopening etc) When running my app on my device or in simulator, everything works ok, the navigation…
Tom
  • 3,349
  • 20
  • 73
  • 131
1 2 3
99
100