xcode4

How can I find a line number in Xcode?

不打扰是莪最后的温柔 提交于 2019-12-20 10:32:41
问题 I have a function in my *.m file - (void)myFunction {} How can I find the line number this function? 回答1: You can go to: Xcode > Preferences > Text Editing then tick "Line numbers". Go to your method and you'll see the appropriate line number shown in the left-hand border of the text editor. 回答2: Go to Xcode Preferences > Text Editing > Show: Line numbers to show the line numbers on the editor. 回答3: This can also be done through code when your implementation file grows. I have found this very

Xcode 4 no code completion

社会主义新天地 提交于 2019-12-20 10:29:56
问题 I have been using Xcode 4 for 2 weeks and I noticed that I don't get code completion macros for if-else and switch statements. Like this article describes: http://macdevelopertips.com/xcode/xcode-code-completion-macros.html I had it working in the beginning, but it suddenly stopped. 回答1: Have you tried deleting the project's derived data (which contains the project index used by Code Sense)? To do so, open the organizer (Window -> Organizer), then the Projects tab. Select your project then

How to use sudo inside of a Run Script build phase in Xcode 4?

戏子无情 提交于 2019-12-20 10:29:53
问题 I need use execute a command inside of a script in a Run Script build phase in Xcode 4 using sudo. However, the compiler complains: sudo: no tty present and no askpass program specified Anyone have a clever solution for this problem? 回答1: One solution is to place the sudo password in an executable shell script like the following: #!/bin/bash echo thesudopassword This shell script might be called password.sh Then, setup the environment variable SUDO_ASKPASS=password.sh Once this is setup, the

The workspace with the iOS project and related a static library project

◇◆丶佛笑我妖孽 提交于 2019-12-20 09:54:07
问题 I am fighting with Xcode 4 workspaces. Currently Xcode 4 wins. Thus, my situation: I have the workspace with the iOS app project. There is also static library project iOS app depends on in the this workspace. Solution #1 I try to configure like this: the app project: add to target's Build Phases > Link Binary With Library a product ( libmystaticlib.a ); set USER_HEADER_SEARCH_PATHS to $(TARGET_BUILD_DIR)/usr/local/include $(DSTROOT)/usr/local/include ; the static library project: add some

Xcode 4.2: Error 0xC002 when trying to use a jailbroken iPhone 3G for development

不问归期 提交于 2019-12-20 09:49:28
问题 I have this jailbroken iPhone 3G with iOS version 4.2.1 (the latest supported version). When I connect it to Xcode 4.2, Xcode starts copying the debug symbols. It stops copying towards the end of the process, and shows the following error: Xcode has encountered an unexpected error (0xC002) No such file or directory, at ‘/SourceCache/DTDeviceKit/DTDeviceKit-867/DTDeviceKit/DTDeviceKit_Utilities.m:864’ Anybody experiencing anything similar? I know I should try and restore the phone, but I'm

How to build a free version from a paid version without duplicating the Xcode 4 project?

走远了吗. 提交于 2019-12-20 09:45:10
问题 I've heard rumors that it is possible to build different variations of an app without duplicating Xcode projects, by using targets and conditional compilation instructions like IF !FREE_VERSION [self loadGreatFeature]; ELSE [self loadBoringFeature]; So: How to set Xcode 4 up to be able to distinguish between building / archiving a free or paid version of the project? How to tell Xcode 4 to include a certain set of images and other resources in the paid version, but not in the free version

Replace parameter multiple times in Xcode code snippets

倾然丶 夕夏残阳落幕 提交于 2019-12-20 09:14:17
问题 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 first parameter. 回答1: This is not possible in Xcode 4.x at the time of writing (Sept. 2011). If you want this feature back in Xcode 4.x, please go to bugreport.apple.com and report a duplicate for this rdar that I just preported: Summary: Xcode 4

Archive with Xcode's command line build tool (xcodebuild archive)

丶灬走出姿态 提交于 2019-12-20 08:49:12
问题 The command line tool to build Xcode projects, xcodebuild, has a new build action available in Xcode 4: archive . From man xcodebuild : archive Archive a scheme from the build root (SYMROOT). This requires specifying a workspace and scheme. Unfortunately, when I try to use it I get an error: $ xcodebuild archive -workspace SimpleTestApp.xcworkspace -scheme SimpleTestApp xcodebuild: error: Failed to build workspace SimpleTestApp with scheme SimpleTestApp. Reason: The selected run destination

Which version of Xcode does xcodebuild use?

纵然是瞬间 提交于 2019-12-20 08:28:52
问题 I have installed both Xcode 3.2 and Xcode 4.0.2 on the same machine, which uses Hudson for automated CI (continuous integration) builds. When I say that both were installed, what I mean by that is that I can use both Xcode 3 and Xcode 4 simultaneously or interchangeably. They both exist on the machine, as I did a custom install for Xcode 4 without overwriting Xcode 3 (supposedly). Do command line calls to 'xcodebuild' invoke Xcode 3 or Xcode 4? Does that question even make sense? Someone who

Short and useful Objective-C snippets?

[亡魂溺海] 提交于 2019-12-20 08:10:52
问题 Since XCode 4, there is now a Code Snippets section which offers the snippets via auto-complete when typing. I'd be very interested in snippets you all have stored in there. What snippets save you the most time (and why)? Please only post actual snippets (meaning no snarky "don't need no stinkin' snippets", and no "i love snippets that do <XYZ>"), and only snippets that are short and sweet (i.e. no more than ~20 lines at the most...). If a snippet is not obviously useful, also explain why you