xcode4

Xcode4, iOS: Copied a target, why can't I change the identifier?

China☆狼群 提交于 2019-12-07 03:05:35
问题 This is diving me crazy - I've copied a target for my iOS project in Xcode4 - however, the Target Identifier field under "iOS Application Target" on the Summary page for my target is uneditable. How do I change the target's identifier? 回答1: It gets the identifier from the product name. Go into build settings, then scroll down to the Packaging section. Change the product name and the identifier will change accordingly. 来源: https://stackoverflow.com/questions/5725075/xcode4-ios-copied-a-target

Remove copyright in Xcode generated source code

时光怂恿深爱的人放手 提交于 2019-12-07 02:27:00
问题 Is there any way to completely remove the comment with the copyright notice when creating a new source code file with Xcode 4? Insted of: // // MainView.h // ProjectName // // Created by First Last Name on 1/2/34. // Copyright (c) 2012 Company Name. All rights reserved. // #import <UIKit/UIKit.h> @interface MainView : UIView @end I'd like to have: #import <UIKit/UIKit.h> @interface MainView : UIView @end 回答1: The safest way to do what you want is to create a custom file template. Make a copy

Accessing NSArray's items with subscript

喜欢而已 提交于 2019-12-07 01:38:40
问题 Is it possible to access NSArray's objects using [idx]? I have a standard library that uses [] style indexing and I don't want to rewrite the whole library to suit ObjC's objectAtIndex: method. As in, NSArray *obj = [NSArray ...]; id item = obj[0]; 回答1: The accepted answer (whilst true at the time) is now out of date. As of Xcode 4.5, you can now set and get NSArray elements using: id object = array[5]; // equivalent to [array objectAtIndex:5]; mutableArray[5] = object; // equivalent to

Find & Replace with a wildcard in Xcode 4

自古美人都是妖i 提交于 2019-12-07 00:28:11
问题 I'm trying to find all instances of text inside "" marks with a semi-colon directly after them, and replace the text inside the "" marks. So, for example: "FirstKey" = "First value"; "SecondKey" = "Second value"; "ThirdKey" = "Third value"; Would find only those values after the equals signs, and could replace them all (with a single string) at once, like so: "FirstKey" = "BLAH"; "SecondKey" = "BLAH"; "ThirdKey" = "BLAH"; How can I do this? I found some stuff referring to regular expressions

Old code gives “Unused parameter” error but never has before now

与世无争的帅哥 提交于 2019-12-06 23:55:28
问题 I've opened up some old iOS code and when I try to build it I get an "unused parameter" error for code like this: - (void)searchBarTextDidBeginEditing:(UISearchBar *)searchBar { NSLog(@"Search Bar isn't used in this function"); } This is the first time I've ever seen an Objective-C compiler spit out errors (not warnings) for this. Since a lot of iOS calls don't necessarily use the passing arguments (examples being a lot of callbacks), I need help in getting rid of this. 回答1: Solution # 1) In

Adding an OpenGL framework in Xcode 4

泄露秘密 提交于 2019-12-06 22:48:29
问题 I'm using Xcode 4 for my C++ programming. I want to add a framework, specifically an OpenGL framework, and I'm not quite used to where things are yet. It says in the help documentation that I should select the target, and from there I get the summery pane where I can add a linked framework/library. When I do that, the summery pane doesn't show up. It does show up when my target is a cocoa application, but since I'm programming in C++, I choose the command line tool, and select the language

Generate code for core data attributes in xcode 4

筅森魡賤 提交于 2019-12-06 20:02:48
问题 In xcode 3 there was a helpful feature in the data model builder where you could highlight some attributes/relationships in an entity, right-click, and choose to copy method and property declarations to the clipboard. (You could choose if you wanted objective-c 2.0 property declarations also). Then you could paste them into your NSManagedObject subclass. I see how you can still generate the entire class file; but this isn't helpful if you are adding attributes to an existing entity. Have they

What should I do about xcuserdata directories with my old username?

此生再无相见时 提交于 2019-12-06 19:26:58
问题 (I have a mac running Mountain Lion with Xcode 4.5.2) I changed my username a while ago, and Xcode has started recreating xcuserdata directories with the new username at $path_to_.xcodeproj/xcuserdata/blackl.xcuserdatad . I've been working with it like that since, and I can't remember if anything seemed to have reset after the change, so whatever was in there must not have been too important… What does Xcode store in xcuserdata and what should I do about the old ones? There are some old

How do you create a Shell Script target in Xcode 4.2?

不想你离开。 提交于 2019-12-06 19:04:36
问题 I was wondering if anyone knew with XCode 4.1 how to create a shell script. The option for that doesn't exist, but it might be called something else in the latest version. Ta 回答1: Select your project in the navigator Click "Add Target" - Choose "Aggregate" for an empty Target Add Build Phase -> Add Run Script Click Build Phases and edit the Run Script Phase 来源: https://stackoverflow.com/questions/9088985/how-do-you-create-a-shell-script-target-in-xcode-4-2

Warning is not displayed in Xcode Issue Navigator

狂风中的少年 提交于 2019-12-06 18:23:10
问题 My project builds with a warning, but it is not displayed in the "Issue Navigator". How can I get to this warning so I can resolve it? I've tried clicking on the warning on the top of the window but that does nothing. I'm using Xcode 4.3. 回答1: I met the same problem, and I found it simply because there are some thing wrong with the below filter input. You can solve the problem by typing something in the below filter input and then clear it. 回答2: Building on Yingpei Zeng's answer, the buttons