ios-simulator

Xcode error connecting to simulator “Software caused connection abort”

旧时模样 提交于 2020-01-30 13:52:11
问题 When I try to run my project through the Xcode simulator, it keeps giving me the error "Software caused connection abort". Tried restarting the simulator & Xcode, and I recently deleted the DerivedData folder as suggested in this post about broken playgrounds so that also didn't help. 回答1: QUICK FIX This is happening because you have multiple versions of Xcode installed. MacOS unfortunately only supports running one version of Xcode at a time, and it needs to know the location of the

Xcode error connecting to simulator “Software caused connection abort”

孤者浪人 提交于 2020-01-30 13:50:46
问题 When I try to run my project through the Xcode simulator, it keeps giving me the error "Software caused connection abort". Tried restarting the simulator & Xcode, and I recently deleted the DerivedData folder as suggested in this post about broken playgrounds so that also didn't help. 回答1: QUICK FIX This is happening because you have multiple versions of Xcode installed. MacOS unfortunately only supports running one version of Xcode at a time, and it needs to know the location of the

NSDateFormatter - 1 day incorrect?

主宰稳场 提交于 2020-01-30 05:08:12
问题 I am importing a CSV file with a date format of month/day/year (e.g. 21/01/2007). I am looping through the CSV some are working but some are coming out with the date 1 day previous with a time of 23:00? One of the dates that are not working would look like this: NSDateFormatter *dateFormatter = [[NSDateFormatter alloc] init]; [dateFormatter setDateFormat:@"M/d/yyyy"]; NSDate *date = [dateFormatter dateFromString:@"10/7/2007"]; but when I output the date in an NSLog it has this: NSLog(@"Date:

NSDateFormatter - 1 day incorrect?

拈花ヽ惹草 提交于 2020-01-30 05:07:19
问题 I am importing a CSV file with a date format of month/day/year (e.g. 21/01/2007). I am looping through the CSV some are working but some are coming out with the date 1 day previous with a time of 23:00? One of the dates that are not working would look like this: NSDateFormatter *dateFormatter = [[NSDateFormatter alloc] init]; [dateFormatter setDateFormat:@"M/d/yyyy"]; NSDate *date = [dateFormatter dateFromString:@"10/7/2007"]; but when I output the date in an NSLog it has this: NSLog(@"Date:

objc_setAssociatedObject unavailable in iPhone simulator

空扰寡人 提交于 2020-01-28 06:39:48
问题 In the 3.1 SDk, Apple added support for associated objects. However, the simulator will not compile code that includes references to objc_setAssociatedObject, objc_getAssociatedObject, et al. (Undeclared errors) Is there away around this? Can I make the iPhone simulator compile this code? I would hate to have to do all testing on the device. Update Bug Filed: rdar://7477326 回答1: A quick and dirty workaround (largely untested, may be buggy): #if TARGET_IPHONE_SIMULATOR #import <objc/runtime.h>

How to monitor network calls made from iOS Simulator

最后都变了- 提交于 2020-01-27 08:51:31
问题 I am trying to monitor calls from an app to my server just like Firebug does. I could not find a way to see that in iOS Simulator or in xCode. Is there a way to do that without sniffing all the traffic? If no, what tool would you suggest? 回答1: Personally, I use Charles for that kind of stuff. When enabled, it will monitor every network request, displaying extended request details, including support for SSL and various request/reponse format, like JSON, etc... You can also configure it to

Xcode Simulators Missing After Installing Beta?

守給你的承諾、 提交于 2020-01-25 21:24:09
问题 I installed xcode beta as I wanted to push an app to my iphone on 10.1 beta, so needed xcode beta. The xcode beta is being super flakey and I wanted to go back to xcode 8 current build. However now all the emulators have vanished from the list near the play button. If i go to Window - Devices, they are all still listed as you would expect... So i cant see why theyve hidden themselves from view/use, but I cant get them back! Cheers for any help here 回答1: Check your iOS deployment target. It

Internet Connection : NURLConnection didFailWithError method not called

流过昼夜 提交于 2020-01-25 12:31:07
问题 I face a problem when develop an Iphone application and test it through Iphone Simulator. In my Iphone application, there exist a button. When I click on this button, the code will check whether the Iphone is connected to internet or not. If is connected, then it will start load data from server and then insert data to my application's local database. And show a view which display the loaded data. If internet is not connected, the didFailWithError method will called and pop up a alert to

Internet Connection : NURLConnection didFailWithError method not called

六月ゝ 毕业季﹏ 提交于 2020-01-25 12:29:21
问题 I face a problem when develop an Iphone application and test it through Iphone Simulator. In my Iphone application, there exist a button. When I click on this button, the code will check whether the Iphone is connected to internet or not. If is connected, then it will start load data from server and then insert data to my application's local database. And show a view which display the loaded data. If internet is not connected, the didFailWithError method will called and pop up a alert to

how to read a file from documents directory

我们两清 提交于 2020-01-25 09:53:06
问题 i hav to read the file with name myname.plist from documents directory .....i want to store the content of the file to string.... 回答1: Something like this should do: /* Find the documents directory. */ NSArray *paths = NSSearchPathForDirectoriesInDomains( NSDocumentsDirectory, NSUserDomainMask, YES/*expand tilde*/); NSAssert([paths count] > 0, @"%s: No user document directory found!", __func__); NSString *documentsDir = [paths objectAtIndex:0U]; /* Build the file path. */ NSString *name = [@