ios4

Can i use NSTimer in background?

隐身守侯 提交于 2019-12-25 01:39:33
问题 I use NSString *urlStr=[NSString stringWithFormat: @"http://xxx.xxx.xxx.xxx:8080/fft/getautodisplaydelay"]; NSURL *url = [NSURL URLWithString:urlStr]; NSURLRequest *request = [[[NSURLRequest alloc] initWithURL:url cachePolicy : NSURLRequestReloadIgnoringCacheData timeoutInterval : 60.0 ] autorelease ]; NSHTTPURLResponse* urlResponse = nil; NSError *error = [[NSError alloc] init]; NSData *responseData = [NSURLConnection sendSynchronousRequest:request returningResponse:&urlResponse error:&error

How to set my own ViewController class as the first screen (root view)

妖精的绣舞 提交于 2019-12-25 01:38:00
问题 I have created a windows based project in XCode using IPhone as target platform and then I added a ViewController Sub Class. Now I want to make my newly added class to be shown at first screen. What is the proper way to achieve it? Regards. 回答1: Modify your appdelegate, you'll find something like this: [window addSubview:myView]; [window makeKeyAndVisible]; Change my view to the view you want to show first. 回答2: That is the correct way i found first declare your view controller in appdelegate

Adding custom fonts to my iphone application

眉间皱痕 提交于 2019-12-25 01:25:59
问题 I want to use a custom font in my iPhone app. After doing some research I found that you can add a custom font to your package. So I copied the font, which is digreadout2.ttf to my app folder and added a key in the .plist file. using the exact filename including the extension. I then create the UIFont object and assign it to the font property of my UILabel . Now the problem is that when I run my app it gives me an error saying <Error>: FT_Open_Face failed: error 2. If anyone has any

How do I add the iPhone SDK 3 to the latest version of Xcode?

烈酒焚心 提交于 2019-12-25 01:25:25
问题 I just upgraded Xcode, but now I don't have any 3.x SDK for Simulator. How do I add it for testing purposes? 回答1: You can try using old versions of XCode (with previous simulators) but the most reliable one is using a device. The iPhone1's latest OS version is 3.1.3. I'm sure you can pick one pretty cheap on eBay or similar. You will also need to make sure that you drop the minimum OS version to 3.0. 回答2: You can goto Project->Edit Project Settings, and from there edit the "Base SDK" to what

Is there a tool in xcode that allows me to look at the data in my xcdatamodel file

穿精又带淫゛_ 提交于 2019-12-25 01:08:19
问题 Is there a GUI tool in xcode that will allow me to preview the data in my xcdatamodel file? 回答1: Unfortunately, no. There are several SQLite database viewers though. I prefer MesaSQLite: http://download.cnet.com/MesaSQLite/3000-2065_4-166835.html 来源: https://stackoverflow.com/questions/4140478/is-there-a-tool-in-xcode-that-allows-me-to-look-at-the-data-in-my-xcdatamodel-fi

How to access one UIViewControllers properties from another UIViewController?

爷,独闯天下 提交于 2019-12-25 00:33:25
问题 I have one single MainViewController which has of course it's one main UIView. I have this main view comprised of many different subviews. Some of these subviews have their very own ViewController. Lets say the MAIN view (whose delegate is primarily MainViewController) has a container which loads another UIView that uses a separate UIViewController- SecondaryViewController as the delegate for most it's actions. This container view is of course loaded in MainViewController via

Iphone create a custom UIobject

你说的曾经没有我的故事 提交于 2019-12-25 00:28:56
问题 Regarding on negative comments here I simplfy my question in small steps; I have a view based application which communicates with a web service and recives xml, parse xml and map its contens an appropriate view component (e.g if thats a date show the question with datepicker, if question has 2 values show it with a segmented control, if more with a pickerview..etc) so its a dynamic questionary with many pages. 1-App Receive XML 2-Parse XML and get the latest un-answered questions (there can

How can i pass data back to parent view controller. am using addSubView method to show child view

隐身守侯 提交于 2019-12-25 00:14:49
问题 How can i pass data back to parent view controller. im using addSubView method to show child view. addFields = [[AddFields alloc] initWithNibName:@"AddFields" bundle:nil]; [self.view addSubview:addFields.view]; Now i want to sent data from "AddFields" view to my parent controller. How can i do that. Can anyone help me.. 回答1: One simple way to do is using NSNotificationCenter see this example Post you notification from your AddFields when you want to send the object [[NSNotificationCenter

sampling sensors on IPhone 4 during standby

被刻印的时光 ゝ 提交于 2019-12-25 00:04:42
问题 I would like to be able to write an app that samples some sensor (not GPS) on IPhone 4, even when the phone is on standby mode What are my options? 回答1: Read up on EAAccessory and EASession . You’re supposed to be able to get updates from accessories even when in the background. 来源: https://stackoverflow.com/questions/8692465/sampling-sensors-on-iphone-4-during-standby

Facebook SDK for iOS , on iOS 4.0 device

隐身守侯 提交于 2019-12-24 22:16:08
问题 Facebook SDK documents indicates that this SDK will work on iOS 4.0 and later. Then I tested their Scrumptions sample on a iPhone 3GS iOS 4.0 device. But it seems this application doesn't work. It keeps showing me the login screen although I logged in. Then I debugged and noticed FBSessionState always returns FBSessionStateClosedLoginFailed . It never returns FBSessionStateOpen . What could be the reason? However when I run this in iOS 5.1 emulator it works fine. Is it because SDK doesn't