xcode4

How do I create a custom UITableViewCell with nib in Xcode 4?

风格不统一 提交于 2019-12-05 11:28:04
In Xcode 3, I could elect to make a nib when creating a table view cell subclass. In Xcode 4, it only makes the h / m files. How do I make the subclass with a xib file? Edit: see screen shots below: EDIT: Additionally, is there any way to create the UITableViewCell nib automatically, along with the h and m files, all pre-wired and ready to edit? VikingoS says Reinstate Monica This blog post describes, how to add it manually. in iOS4+, the line NSArray *nib = [[NSBundle mainBundle] loadNibNamed:@”CustomCell” owner:self options:nil]; can be replaced by a more efficient nib handling via UINib .

Xcode4 with Mac OS X 10.4 SDK

こ雲淡風輕ζ 提交于 2019-12-05 11:27:45
In the latest iteration of Xcode, Xcode 4.0, the 10.4 SDK is no longer included. However, I still need to support 10.4 and PowerPC builds. I have installed latest Xcode 3.2.6 which still includes 10.4 support. Then I installed Xcode4. Has anyone found a simple way to "cheat" and get Xcode4 to use 3.2.6's SDKs? Mecki Yes, I did :) See here . XCode 4.0 supports deploying to Mac OS X 10.4 right out of the box, so you shouldn't have to do anything special. For example, I created a project then selected the project and right there, there is a field called "Deployment Target" where you can select 10

How to send UIImage in JSON format, by filling a NSDictionary

萝らか妹 提交于 2019-12-05 11:18:10
I'm trying to send data to a server with JSON. I am able to create my NSDictionary with my objects and key parameters. But I want to send my picture, and the picture is UIImage. NSDictionary* mainJSON = [NSDictionary dictionaryWithObjectsAndKeys: @"John", @"First_Name", @"McCintosh", @"Last_name", <HERE I WANT PICTURE>, @"Profile_picture", nil]; // Here I convert to NSDATA NSData * jsonData = [NSJSONSerialization dataWithJSONObject:mainJSON options:NSJSONWritingPrettyPrinted error:&error]; // Sending operation : dispatch_async(kBgQueue, ^ { NSData * data = [NSData dataWithContentsOfURL:@

Xcode 4 target build setting “Skip install”. What is it?

…衆ロ難τιáo~ 提交于 2019-12-05 11:10:29
问题 The tile basically says it all. I'm developing a mac app which has the normal app target, but also has two more command-line tool targets whose products are copied to the app when building. I remember seeing somewhere that the "Skip install" was important in these cases, but I remember nothing of what I read, so this might be incorrect. Anyway, I just wanted to know what this option affects. 回答1: I believe this only matters when you're developing for the App Store. If you archive your app

How do I use the ios 4.2 base sdk using Xcode 4.2?

孤者浪人 提交于 2019-12-05 10:53:51
How do I use the ios 4.2 base sdk using Xcode 4.2? I own a iPhone 4s and an iTouch which has has ios 4.2 on it. After upgrading Xcode to 4.2 to work with my iPhone 4s, I can't use Xcode with my iTouch anymore. How do I setup Xcode to work my iTouch on 4.2 and my iPhone on ios5? Also I tried setting the base sdk by selecting other but there is nothing else in the list, all I get is a dialog window that I can manually type in. Do I need to add an option there? Thanks. Xcode 4.2 comes with device support for iOS 4.2+ already installed. You don't want to change the base SDK, you need to change the

Include/exclude resources depending on scheme

拈花ヽ惹草 提交于 2019-12-05 10:49:34
I have some large resources that I only need for my simulator runs—I'd like to have them automatically excluded from all device builds. Is there any way to do this with Xcode 4 short of custom build scripts that copy the resources? I went with a Run Script phase with the following: if [ ${PLATFORM_NAME} != "iphonesimulator" ]; then echo "device build -- removing resources..." rm "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/test_a.mp3" rm "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/test_b.mp3" # reveal the binary in the Finder /usr/bin/open --reveal "${TARGET_BUILD

Centering Placeholder Text in Subclass of UITextField

我与影子孤独终老i 提交于 2019-12-05 10:24:42
So first, I needed to set the placeholder text color, so I subclassed the UITextfield as shown in several stack overflow posts. This works fine. Here is an example post of this: How do I subclass UITextField and override drawPlaceholderInRect to change Placeholder color . But, when I try to use searchNameField.textAlignment = UITextAlignmentCenter; It is no longer centering the placeholder. The input text is still centered fine. So then, assuming that the centering is not working because of the subclassing, what do I have to add to my UITextField subclass in order to have the placeholder text

How do I debug XPC Services in XCode 4?

心不动则不痛 提交于 2019-12-05 09:22:48
I added an XPC Service to my project and I would like to set breakpoints and inspect variable contents in the debug area in XCode. Breakpoints that I set in the service's code are not recognized (obviously, the debugger is attached to the main apps process. How and I attach the debugger (manually or automatically) to the XPC Service process after my main app launches it? Is there some way to run the service alone and send it messages without it being launched from the main app? Khakionion Debug -> Attach To Process -> By Process Identifier (PID) or Name... Type in your XPC service process name

Why doesn't UIScrollview have an accessibility area in the Interface Builder?

元气小坏坏 提交于 2019-12-05 08:59:04
I've noticed that a UIScrollView doesn't have mentioned accessibility area where I can set accessibility label or accessibility. This seems to apply for activity indicators too. Why does UIVIews, UIButtons and more have this area and not UIScrollView and UIActivityIndicatorView? Good question - the reason for a scroll view is that Apple don't consider it to be an accessible element. If you look at the UIAccessibility documentation, you'll find Apple have the following to say on what counts as an 'accessible element': The only exception to this [a view being accessible] is a view that merely

Xcode 4 : Can I get a path to the currently active file via AppleScript?

眉间皱痕 提交于 2019-12-05 07:14:24
I am trying to write a custom xcode4 behavior to check out the current active file with Perforce. I know I can write a custom behavior to run when hit a key (e.g., F1 ) I'd like that custom behavior to launch an AppleScript (or any kind of script for that matter) that discerns the currently "active" source document in Xcode, get its path, and attempt to check it out via Perforce. As far as I can tell AppleScript is the best way to get to the target document as it can navigate the Xcode DOM easily. Given that, the DOM itself is a maze. Can this be done? Yes. tell application "Xcode" set