xcode4

Getting iPhone Documents Directory in TestCases

左心房为你撑大大i 提交于 2020-01-06 07:15:46
问题 I'm running test cases which uses sqlite database to test my code on iPhone simulator using default SenTestingkit, when i try to get the home directory using either of the following ways NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES); NSString *docsPath = [paths objectAtIndex:0]; or NSString *home = NSHomeDirectory(); i got a wrong path that points to the following bath /Users/{user}/Library/Application Support/iPhone Simulator/5.1 and i

why do I get this error building a static library for my iPhone project using XCode 4?

依然范特西╮ 提交于 2020-01-06 05:02:31
问题 I have an existing iPhone application, and I just wanted to make a static library out of the code, so that I can use it by a separate test application (within the workspace). The application compiles fine, but when I try to compile the library version (which has the same code files) I get the following error: Lexical or Preprocessor Issue - "MyClass.h" file not found However, the application still runs, even through there is this error. In fact when I compile the application (which uses the

Is it proper to archive/unarchive NSWindowController?

☆樱花仙子☆ 提交于 2020-01-06 05:01:40
问题 I'm having a difficult time understanding what's going wrong. I have an NSWindowController with a NSWindow and a NSTextView. I want to archive that NSWindowController and NSWindow (along with all of its controls) to a file. Then, I want to unarchive that same NSWindowController and the NSWindow and all views from the file. But Apple docs say: Note: Although the NSWindow class inherits the NSCoding protocol from NSResponder, the class does not support coding. Legacy support for archivers

Xcode iOS Simulator does not load new project

不羁岁月 提交于 2020-01-06 02:22:24
问题 I was working on an iOS app in xCode and I was perfectly using the simulator. Yesterday I had to create a new project and after putting some code I found out that when clicking Run, the app compiles, links, but then the simulator never starts. And stop is disabled. I tried with both iOS sim on and off. Opening the old project back shows the simulator but after switching to the new one, nothing happens. Any ideas on how to fix this? I am using a Single-View app. 回答1: We switch between apps all

Xcode 4 Document Types and Exported UTIs

孤人 提交于 2020-01-05 09:34:56
问题 I have an other problem with Xcode 4. I really like the new IDE but there are a few things I didn't get to work yet. One thing is to register Document Types with Xcode 4. I tried it with the old way through the plist file, but it didn't work. (Means I couldn't open a file with my app) But I don't now how to set it up with the interface of Xcode 4. My latest try looks like this: (Copied the entry made from Xcode in the info.plist) <key>UTExportedTypeDeclarations</key> <array> <dict> <key

SetText is Deprecated

℡╲_俬逩灬. 提交于 2020-01-05 08:09:20
问题 Hi I am working out Xcode and Obj-C and I am getting this warning: Deprecations: 'setText:' is deprecated I am wondering what the new method is This is my code: [cell setText:[NSString stringWithFormat:@"I am cell %d", indexPath.row]]; 回答1: setText is indeed deprecated. Use textLabel setText instead: cell.textLabel.text = [NSString stringWithFormat:@"I am cell %d", indexPath.row]; 回答2: When you get a deprecated warning, just alt+click on the method or property that triggered it and you will

SetText is Deprecated

故事扮演 提交于 2020-01-05 08:08:11
问题 Hi I am working out Xcode and Obj-C and I am getting this warning: Deprecations: 'setText:' is deprecated I am wondering what the new method is This is my code: [cell setText:[NSString stringWithFormat:@"I am cell %d", indexPath.row]]; 回答1: setText is indeed deprecated. Use textLabel setText instead: cell.textLabel.text = [NSString stringWithFormat:@"I am cell %d", indexPath.row]; 回答2: When you get a deprecated warning, just alt+click on the method or property that triggered it and you will

Why not use Interface Builder [closed]

爱⌒轻易说出口 提交于 2020-01-04 14:34:18
问题 As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance. Closed 9 years ago . I have seen some people who refuse to use Interface Builder and prefer to make everything using code. Isn't this a bit tedious and

Why not use Interface Builder [closed]

怎甘沉沦 提交于 2020-01-04 14:34:09
问题 As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance. Closed 9 years ago . I have seen some people who refuse to use Interface Builder and prefer to make everything using code. Isn't this a bit tedious and

Where has “window-based” project gone?

徘徊边缘 提交于 2020-01-04 06:23:30
问题 I've recently bought two books about MonoTouch so that I can start learning to build iPhone applications. Both books in their tutorials refer to creating a "Window-based" project to start learning with, however that just doesn't seem to be there in the new project options. Instead MonoDevelop shows the following as the available project types: Empty Project Utility Application Master-Detail Application Single View Application Tabbed Application OpenGL Application I'm using the MonoDevelop 2.8