xcode4.2

Crash/SIGABRT when I try to present a UIPopoverController

我的梦境 提交于 2019-11-30 02:45:43
问题 Hi I am at my wits end with what I am doing wrong here. I am using ios5 and nothing crashes if I do not call presentPopoverFromBarButtonItem. Has anyone experienced anything similar? I checked the apple developer forums, google, stack overflow and couldn't find anything. Running bt on gdb didn't reveal any hints either. UIViewController *viewTwo; viewTwo = [[ViewTwo alloc] initWithNibName:@"ViewTwo" bundle:nil]; UIPopoverController *popover; popover = [[UIPopoverController alloc]

How to properly set run paths, search paths, and install names?

本秂侑毒 提交于 2019-11-30 02:06:52
I have a collection of projects that I'm compiling as dynamic libraries. Each of these .dylibs depend on other various .dylibs that I would like to place in various other directories (i.e. some at the executable path, some at the loader path, some at a fixed path). When I run otool -L on the compiled libraries, I get a list of paths to those dependencies but I have know idea how those paths are being set/determined. They almost appear pseudo random. I've spent hours messing with the "Build Settings" in Xcode to try and change these paths (w/ @rpath, @executable_path, @loader_path, etc.) but I

NSTextField Vertical alignment

≯℡__Kan透↙ 提交于 2019-11-30 01:17:19
问题 I am creating cocoa app in which i created NSTextField programmatically like this, NSView *superView = [[NSView alloc] initWithFrame:NSMakeRect(0, 300, 1400, 500)]; NSTextField *myTextField = [[NSTextField alloc] initWithFrame:NSMakeRect(180, 100, 1000, 300)]; [myTextField setStringValue:myText]; [myTextField setEditable:NO]; [myTextField setBezeled:NO]; [myTextField setDrawsBackground:NO]; [myTextField setSelectable:NO]; [myTextField setFont:[NSFont fontWithName:@"Futura" size:22]];

ARC and ASIHTTPRequest

我怕爱的太早我们不能终老 提交于 2019-11-30 00:38:27
I have a strange problem. I use ASIHTTPRequest in a iOS 5 project with ARC enabled. Since ASIHTTPRequest does not support ARC I have disabled ARC on all individual ASIHTTPRequest files. However, when I'm trying to compile my project, xcode still believes that those files are ARC-enabled and it complains. Did I do anything wrong or is that a bug in xcode? Don't tell me to convert ASIHTTPRequest to ARC-compatible code with the refactor tool. I have tried to do that and xcode complains on that ARC is enabled on the project (?!?!). You typed -fno-ojbc-arc . The correct flag is -fno-objc-arc . I

how to get XCode to add build date & time to Info.plist file

本小妞迷上赌 提交于 2019-11-30 00:27:29
Finally... after a couple years of watching and a month of participating, I have a chance to ask you guys a question of my own. My boss doesn't trust me (or any process) to increment a build number, he also wants to have a build date & time baked into the app. I'd like to put this into the usual Info.plist file. I found this related question: Build information in iOS Application (date/time app was built) and based on the answers there, I went into the Scheme Editor and added the script below to the "Post-Action" section of the Build phase: infoplist="$BUILT_PRODUCTS_DIR/$INFOPLIST_PATH"

Save CUSTOM metadata in an image taken from AVFoundation in iOS

天涯浪子 提交于 2019-11-29 22:41:16
How do I save custom metadata in an image when i get the image using the AVFoundation framework ? I know I can access the properties weather it I have my image as UIImage or CIImage but the properties that these seem to have differ from each other (even if it is the same image). So far I access the dictionary like this: (Code taken from Caffeinated Cocoa blog) NSLog(@"about to request a capture from: %@", [self stillImageOutput]); [[self stillImageOutput] captureStillImageAsynchronouslyFromConnection:videoConnection completionHandler:^(CMSampleBufferRef imageSampleBuffer, NSError *error) {

Should i write sqlite database file to Documents directory or Library/Caches?

僤鯓⒐⒋嵵緔 提交于 2019-11-29 21:13:51
问题 I have read the Data Storage guidelines of Apple and am really confused as to where i should keep the sqlite database files i am creating in my app. I want to read from the sqlite files even when the app is in Offfline mode. I read that such files created should be kept in the Library/caches with the "do not backup" flag set. Please suggest me the right approach for doing the same. 回答1: The answer depends on how your database files are created: According to the Data Storage Guidelines page:

Xcode 4.2 (Snow Leopard) and iOS 5.1 [duplicate]

天大地大妈咪最大 提交于 2019-11-29 20:38:31
Possible Duplicate: ios 5.1 with xcode 4.2 for iOS development I updated my iPhone to iOS 5.1. My operating system is Snow Leopard. Now I need the sdk 5.1 to develop, with xcode 4.2. Where can I download it? Any suggest? Solution: Downgrade to ios5.0 or update to Lion You can't. You need to update to Mac OS 10.7 Lion in order to get the latest version of Xcode with the 5.1 SDK. The last installable version of Xcode on Snow Leopard will be 4.2. Apple really wants developers to keep up to date on everything, whether MacOS or iOS. Richard Groves To get Xcode 4.2 on Snow Leopard to run code on a

How is view initialized when loaded via a storyboard?

a 夏天 提交于 2019-11-29 20:33:29
When view is loaded manually, developer remains in control when it comes to initializations, we choose what initializer to call, what variables to set etc. When view is loaded from the storyboard segue ... what happens to that initializer? Where should variables be set i'd like to be available once view had been loaded? Please help me understand the sequence here. How is instance of the class created here, who creates it and how can we intervene and help set it up to our liking? Caleb When a view is loaded from a nib or storyboard, it's -initWithCoder: method is called. Like -initWithFrame: ,

Random number without repeating

时间秒杀一切 提交于 2019-11-29 17:39:26
I have NSMutableArray with 50 array elements. I need to generate randomly without any repetition. Can you suggest some sample codes. here is sample to get random int less than 1000. int y = arc4random() % 1000; to stay without duplicates, just check before inserting Create a local mutablearray copy of main array, and after getting random value, remove object available at random index from local array, process it till array count is 1. James Webster I have assumed you want to generate numbers. This is the answer I have used for generating M random numbers from N. Though it doesn't add them into