xcode3.2

Compile Error with: switch, “expected expression before”

梦想与她 提交于 2019-12-17 17:33:57
问题 Cut to the chase I have recreated my problem as it is fairly self explanatory. this complies without error: switch (n) { case 1: NSLog(@""); NSString *aStr; break; default: break; } this compiles with error and it's only missing the NSLog(): switch (n) { case 1: NSString *aStr; break; default: break; } it throws an error at compile " Expected expression before 'NSString' " Am I missing something here? 回答1: In normal C you'd have to enclose this in brackets in both cases. I suspect this may

XCode 3.2 - make emulator to open in iPhone mode

空扰寡人 提交于 2019-12-14 04:07:36
问题 I've installed XCode 3.2 on top of Snow Leopard 10.6.2. When trying to "build and run" an application created from XCode template, the emulator is always opened in iPad mode. When choosing "iPhone" from the emulator menu, it changes its look but next time it is opened as iPad again. How to cause the emulator to run in iPhone mode ? 回答1: It seems that it was answered here Setting Xcode's target to iPhone NOT iPad 回答2: The XCode 3.2.3 comes with SDK 4.0, which is the only choice for building

XCode debugger hangs on breakpoints

旧时模样 提交于 2019-12-13 04:31:46
问题 I'm debugging a project for iOS 4.0 (simulator) in XCode 3.2.3, and all of a sudden the debugger just stopped working on me. It will hit the first breakpoint and freeze. It will not respond to single stepping, continuing, pausing, etc. I know I'm not the first person to complain about the XCode debugger, so does anyone have any sort of clue as to why this happens, or any sort of workaround? It has completely prevented me from getting anything done. 回答1: I found that switching to build active

Xcode 3.2: Build & Analyze never finds any issues

我只是一个虾纸丫 提交于 2019-12-12 17:02:22
问题 I've used the Clang Static Analyzer from the command line before. I wanted to try Xcode's built-in version via Build & Analyze. I never get any negative results even though i specially prepared my code with very obvious issues Clang was always able to point out: // over-releasing an object: [label release]; [label release]; // uninitialized vars, allocating but not freeing an object NSString* str; int number; CCLabel* newLabel = [[CCLabel alloc] initWithString:str fontName:str fontSize:number

UIPickerview in iphone

冷暖自知 提交于 2019-12-12 05:23:55
问题 How to place UIPickerView programmatically in a subView with out using Interface Builder? 回答1: Hey! U can make UIPickerView programmatically.... In- viewController.m file - (void)viewDidLoad { [super viewDidLoad]; UIPickerView *pickerView = [[UIPickerView alloc] initWithFrame:CGRectMake(0,100,320, 500)]; [self.view addSubview:pickerView]; [pickerView setDelegate:self]; [pickerView release]; } - (NSInteger)numberOfComponentsInPickerView:(UIPickerView *)thePickerView { return ; //give

warning: comparison is always true due to limited range of data type causes crash

有些话、适合烂在心里 提交于 2019-12-11 12:26:30
问题 I have a warning that I am unable to find the cause of. I am following instructional code in a text on Cocoa programming that implements a document based image slide show. This warning causes a while loop to be executed more than the correct number of times which causes the program to crash. The code downloaded from the author's website does not have this problem. I assumed it was a simple matter of a typo in my version but carefully reading both versions of code I was unable to come across

What is an instance of an NSObject

冷暖自知 提交于 2019-12-11 08:19:37
问题 I am a newbie, and I am wondering what an instance of NSObject is. I am working on Xcode 3.2 and want to know what the instance is. I've heard this term often and am confused by it. 回答1: From Wikipedia on Objects in OOP Objects in "object-oriented programming" basically are data structures combined with the associated processing routines. For instance, a file is an object: a collection of data and the associated read and write routines. Objects are considered instantiations of classes. In

iPhone Xcode Settings.bundle Plist

老子叫甜甜 提交于 2019-12-10 11:04:42
问题 I followed the tutorial: http://useyourloaf.com/blog/2010/5/18/adding-a-settings-bundle-to-an-iphone-app.html And the Toggle Switch (that I just created based on the tutorial) was not in the Settings App. Every time I did an NSLog on the state of the switch, it would return "(null)". Please help as I need to create, and access a Toggle Switch created in the .plist file. I am new to iPhone Programming. Here's the code I'm using to set the user preference switch: // Set the application defaults

xcode 3.2.2 and objective-c 2.0 and debug: where are my object's property/instance variable values in debug?

空扰寡人 提交于 2019-12-08 16:57:05
问题 working on a mac os project (meaning not iPhone) requiring 10.6 and is 64bit, allows me to use properties to generate both accessor methods and instance variables in the header file. but, during debug, i'm not seeing how to look at the object's properties values after they have been populated. is there some build setting that needs to be turned on? if i am declaring an object's instance variables (between {} in the header), then i can see those values (when they are used) during debug either

Xcode Wildcard characters?

回眸只為那壹抹淺笑 提交于 2019-12-08 06:52:57
问题 I have a whole list of data that I need to replace some data with. Each line starts with: <select value="12345"> (where 12345 is different on each line) and I want to replace it with: @" How do I do this, I can find the right find and replace algorithm to do this? It would really save me hours. 回答1: You want to do this change in your source code in an Xcode project ? Or you want to write a program using Xcode to do this ? Assuming it's the former then you can just do Edit -> Find in Project,