Questions tagged [xcode4]

Xcode 4, released in June 2011, is Apple's integrated development environment (IDE) for Mac OS X and iOS. This tag should only be used for questions about this specific version of Xcode, and not for general Mac or iOS programming topics. Use [cocoa] for Mac programming questions, or [cocoa-touch] for iOS (formerly iPhone OS) programming questions.

Xcode 4 is the successor to Xcode 3, the main development tool for developing software under Mac OS X, targeting Mac OS and iOS. It was introduced to the developer community at Apple WWDC 2010, and the final release was published in March 2011. It was replaced by Xcode 5 in September 2013.

References

See for more information.

5408 questions
59
votes
7 answers

How should I manage dependencies across projects in an Xcode workspace?

I'm working on an iOS app project, and add the json-framework project to the workspace. The project navigator on the left shows both projects, and the build scheme selector shows the schemes from both projects too. Now I want to add the libjson.a…
user23743
58
votes
2 answers

Replace parameter multiple times in Xcode code snippets

Can I create a custom snippet that takes a parameter that is replaced multiple times inside the code? I tried something like: <#class#> instanceOf<#class#>; but it doesn't replace both class placeholders when I insert the snippet and write over the…
lkraider
  • 4,111
  • 3
  • 28
  • 31
58
votes
2 answers

Xcode "move line" keyboard shortcut

In Xcode 4, I have been sucessfully able to add new custom keyboard shortcuts to move lines around or to duplicate a line: /Applications/Xcode.app/Contents/Frameworks/IDEKit.framework/Resources/IDETextKeyBindingSet.plist My Custom…
dbernard
  • 1,073
  • 1
  • 11
  • 21
57
votes
3 answers

Xcode-Increment build number only during ARCHIVE?

I have found a few other posts that show how to add a script to increment the build number with a script: Better way of incrementing build number? Xcode project's "Build number" Can Xcode insert the version number into a library's filename when…
jsherk
  • 6,128
  • 8
  • 51
  • 83
57
votes
4 answers

How to create variables for use in Xcode build settings values?

XCode has a number of built-in variables that are used for convenience in Build Settings, for example "$(PRODUCT_NAME)" or "$(CURRENT_ARCH)". Can I define my own variables? How / where?
Ben Flynn
  • 18,524
  • 20
  • 97
  • 142
56
votes
3 answers

How to set up file compare/diff in Xcode 4?

Am looking for how to set up file compare/diff in Xcode 4, but have run into brick wall. Anyone can tell me how to do it?
pdenlinger
  • 3,897
  • 10
  • 60
  • 92
55
votes
8 answers

Change the listing order of the view controllers in Xcode storyboard

I'm just starting my first application using storyboards. I'm using Xcode 4.5 and iOS 6 SDK. I want to know how to change the order in which the controllers are listed in the Document Outline (panel to the left of the storyboard).
Darren
  • 10,091
  • 18
  • 65
  • 108
53
votes
8 answers

Xcode 4 shortcut for swapping focus between editor and assistant editor

In Xcode, I am big fan of the assitant editor that shows me the corresponding .h or .m for the file that I am editing. Is there a shortcut that allows me to swap focus between this two windows? I frequently switch between the two and using the mouse…
Alec Gorge
  • 17,110
  • 10
  • 59
  • 71
53
votes
1 answer

Adding Framework in Xcode 4

Possible Duplicate: How to “add existing frameworks” in Xcode 4? How do I add a Framework in Xcode 4?
Ohad Regev
  • 5,641
  • 12
  • 60
  • 84
53
votes
1 answer

Xcode4 - Build for Archiving greyed out

Possible Duplicate: Xcode 4 - “Archive” is greyed out? I want to submit my iOS App via Xcode 4. The problem is that I cant do the Build for Archiving. Its Inactive and Gray (the Menu Item Product->Build For->Build For Archiving) and i dont know…
Hernd DerBeld
  • 563
  • 1
  • 5
  • 7
53
votes
8 answers

Xcode 4 and nested projects -- header files not found

I'm having a myriad of problems with Xcode 4 and nested projects that worked just well under Xcode 3.2. Here's a very basic one I cannot solve: I'm building a cocoa framework that requires another cocoa framework for which I have the source. So I…
Pascal
  • 16,846
  • 4
  • 60
  • 69
52
votes
2 answers

How to debug "message sent to deallocated instance" in Xcode 4?

I pressed alt+cmd+r and activated NSZombieEnabled in Arguments > Environment Variables. Additionally, I activated it in Diagnostics > Memory Management > Enable Zombie Objects. However, when I built and run, at some point my app crashes giving me…
dontWatchMyProfile
  • 45,440
  • 50
  • 177
  • 260
51
votes
16 answers

Xcode will run app on simulator but not on device

I receive the following error when trying to run the app on my device. error: failed to launch '/Users/michael/Library/Developer/Xcode/DerivedData/Build/Products/Debug-iphoneos/Word Processor.app/Word Processor' -- No such file or directory…
Rahul Iyer
  • 19,924
  • 21
  • 96
  • 190
51
votes
1 answer

Instruments 4.1 unresponsive to projects launched from Xcode 4.1 until pressing Cmd-Tab

If I open Instruments and select a standard application (e.g. Mail or MS Word) it has no issue. If I am in Xcode and I go to Product > Profile (or press Cmd + I), it launches Instruments, allows me to select a template, and loads the standard…
James Paul Mason
  • 1,051
  • 1
  • 13
  • 27
51
votes
5 answers

Link error while building a unit test target

I have a XCode4 / iOS project with a regular target and unit test target. Everything works fine, except when I try to #import one of my classes in my test class and try to use it. If I try to build the unit test target, I get the following link…
cfischer
  • 24,452
  • 37
  • 131
  • 214