ios-simulator

Simulated low memory warning not working

走远了吗. 提交于 2019-11-30 20:56:51
问题 I have a UIWebView in a UIViewController . I am trying to push this view controller to an existing UINavigationController , that has another view controller which also has a UIWebView in it. After pushing the first view controller I try to simulate a memory warning, and then I hit "back" to go to the previous view controller, but now this webview is empty/blank. Any idea on how to go around this? This is only happening on the iPad 1, running iOS 5. 回答1: Under a low memory condition under iOS

How to download large files using objective c on iphone

点点圈 提交于 2019-11-30 20:01:21
问题 I ve written an app that downloads files from a sever via http. The users will always be on WLAN when using my app. It downloads files of <10MB without any issues but the application just hangs for larger files. Is there a best practice way to download large files or do i need to implement some form of chunking? Any code samples would be much appreciated. Many thanks Tony 回答1: I would recommend using ASIHTTPRequest library. It can download files on the background without blocking your app,

Programmatically setting iphone simulator location

梦想的初衷 提交于 2019-11-30 19:04:39
I've just updated to XCode 4.2 and I see a cool feature that allows me to manually set the device location. Does anyone know of a way to accomplish the same thing programmatically? I'd like to set the location in some unit tests. Mike Akers The following AppleScript will let you set the location of the iOS Simulator. It should be possible to integrate this kind of script into a unit test script, or have your script generate the equivalent AppleEvents. tell application "iOS Simulator" activate end tell tell application "System Events" tell process "iOS Simulator" tell menu bar 1 tell menu bar

Can we use UI Automation tools with the iPhone Simulator?

▼魔方 西西 提交于 2019-11-30 18:50:44
问题 I’ve been using the new UI automation tools with Instruments and the iPhone SDK 4.0, but so far I haven’t been able to get it to run under the iPhone Simulator. I’ve tried setting the target to every location possible—my build folder, the app folder in ~/Library/Application Support/iPhone Simulator, etc.—but I get an error message when I try to run it: Unexpected error in -[UIATarget_0x5a1e3b0 frontMostApp], /SourceCache/UIAutomation_Sim/UIAutomation-37/Framework/UIATargetElements.m line 437,

iOS Simulator devices listed twice in Xcode run destinations list

假装没事ソ 提交于 2019-11-30 18:33:45
Xcode is showing duplicate entries in the run destinations list for each iOS Simulator device. Screenshot of the run destinations: Screenshot from Devices menu: I tried to completely closing and opening Xcode, and it did not solve the problem. Rebooting also did not solve the problem. I added iOS 7.1 SDK to the Xcode.app's bundle. I suspect the issue will go away if you restart the service: Quit Xcode, Instruments, and the iOS Simulator and then run this in Terminal.app: killall -9 com.apple.CoreSimulator.CoreSimulatorService I have not seen an issue like this before where the device itself

Forcing landscape and autorotate in iOS 7

不打扰是莪最后的温柔 提交于 2019-11-30 18:20:41
My app is supposed to be landscape only, and I had no problem with this when building for iOS 6 and earlier. Now with iOS 7, It won't rotate at all. In my app settings, I have it set to landscape left/right only. In my view controller, i'm using the following: - (NSUInteger)supportedInterfaceOrientations { return UIInterfaceOrientationLandscapeLeft | UIInterfaceOrientationLandscapeRight; } I also used to use this, which is now deprecated: - (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)orientation { return UIInterfaceOrientationIsLandscape(orientation); } The new one

Xcode cannot run using the selected device

生来就可爱ヽ(ⅴ<●) 提交于 2019-11-30 18:19:58
I am receiving the following error when I try to run my Xcode iOS project: Xcode cannot run using the selected device. Choose a destination with a supported architecture in order to run on this device. I have had this error for a while now. I was able to get around it by using an actual device instead of a simulator, but now that doesn't work either. I haven't changed a single setting in the project since creating it, all that I have changed is the code itself. This has also happened before and the only way I fixed it was to create a new project and start from scratch and now it is happening

Simulator iPhone Retina has wrong screen resolution

爱⌒轻易说出口 提交于 2019-11-30 18:14:49
问题 I'm trying to write a Universal Application. The display should be slightly different for different screen resolutions. But when I code like this: - (void)viewDidLoad { SCREEN_WIDTH=[[UIScreen mainScreen] applicationFrame].size.width; SCREEN_HEIGHT=[[UIScreen mainScreen] applicationFrame].size.height; NSLog(@"w:%f h:%f",SCREEN_WIDTH,SCREEN_HEIGHT); ... } I get output: w:320.000000 h:480.000000 even when the simulator is set to Hardware->Device->iPhone (Retina) Furthermore, images with this

how to launch ios simulator from phonegap

孤人 提交于 2019-11-30 17:54:31
when i try to launch ios simulator from command line by using $ phonegap run ios i get the below error Error: ios-sim was not found. Please download, build and install version 1.5 or greater from https://github.com/phonegap/ios-sim into your path. Or 'brew install ios-sim' using homebrew: http://mxcl.github.com/homebrew/ i even tried copying the above ios-sim folder into my path. still getting an error. Best Solution: Make sure you have XCode and its command line tools installed and accepted the license agreements Download and install Homebrew by executing following command in terminal: ruby

Seeing a guid as part of the simulator choices

非 Y 不嫁゛ 提交于 2019-11-30 17:51:28
问题 When i got to choose a simulator to run my app on in Xcode 6.1.1. I see a guid next to the simulator name. For example the choices I see are: iPad 2 (062B5AD7-65CD-4079-B06E-182A6D110DB4) iPAD 2 (49DA9317-4493-4664-9c25-172A97CEFA41) iPad 2 (FCF2A5C#-9460-4C22-A948-3633C876FC35) How do i get rid of these guids? 回答1: The problem is that you've created too many iPad 2 simulators (and similarly for the others that look that same way). The interface needs some way to distinguish them so it adds