Search results for

DTiPhoneSimulatorErrorDomain Code 2

158,648 results found

Post

Replies

Boosts

Views

Activity

WKWebsiteDataStore
Hi, I'm playing around with WKWebsiteDataStore, and throwing an exception each time I attempt to ask for the default store using:[WKWebsiteDataStore WKWebsiteDataStore];Stack Trace:2015-06-10 14:26:35.264 iOS9Sample[34994:293382] +[WKWebsiteDataStore WKWebsiteDataStore]: unrecognized selector sent to class 0x2447458 2015-06-10 14:26:35.266 iOS9Sample[34994:293382] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '+[WKWebsiteDataStore WKWebsiteDataStore]: unrecognized selector sent to class 0x2447458' *** First throw call stack: ( 0 CoreFoundation 0x00aa4c54 __exceptionPreprocess + 180 1 libobjc.A.dylib 0x00564e26 objc_exception_throw + 50 2 CoreFoundation 0x00aadaa3 +[NSObject(NSObject) doesNotRecognizeSelector:] + 275 3 CoreFoundation 0x009eb32d ___forwarding___ + 1037 4 CoreFoundation 0x009eaefe _CF_forwarding_prep_0 + 14 5 iOS9Sample 0x0009aee1 -[ViewController webView:didFinishNavigation:] + 113 6 WebKit 0x021bb1fd _ZN6WebKit15NavigationState16NavigationClient19
1
0
770
Jun ’15
Xcode 7 crashes on startup
I've downloaded the .dmg, copied to Applications, waited for the verification - said 'open' once the verification is done then Xcode crashes. I'm running 10.10.3 which I think should work. I've tried uninstalling, re-downloading and re-doing the process with not luck. Has anyone else encountered this problem? Thanks.This is the error:Process: Xcode [396]Path: /Applications/Xcode-beta.app/Contents/MacOS/XcodeIdentifier: com.apple.dt.XcodeVersion: 7.0 (8123.26)Build Info: IDEFrameworks-8123026000000000~7Code Type: X86-64 (Native)Parent Process: ??? [1]Responsible: Xcode [396]User ID: 501Date/Time: 2015-06-10 17:25:29.684 -0400OS Version: Mac OS X 10.10.3 (14D136)Report Version: 11Anonymous UUID: A4A041F0-414B-EB94-4B70-43B0C8715464Time Awake Since Boot: 320 secondsCrashed Thread: 0 Dispatch queue: com.apple.main-threadException Type: EXC_CRASH (SIGABRT)Exception Codes: 0x0000000000000000, 0x0000000000000000Application Specific Information:ProductBuildVersion: 7A120fASSERTION FAILURE in /Library/Caches/
6
0
2k
Jun ’15
Reply to WCSession sendMessage returning errors (simulator)
WCErrorDomain error 7004 is WCErrorCodeSessionNotActivated, so you are probably not doing the WCSession setup in the WatchKit extension like you are in the iOS app. Both side need to individually set up and activate their WCSession.Also, you might want to move the setup of the WCSession in your iOS app to a part of the code that gets called when your app gets launched in the background.
Topic: App & System Services SubTopic: Core OS Tags:
Jun ’15
IOS App Install Fail Over The Air
Hi, I'm using Xcode6 and created a test app for ipad. It compiles and runs fine in simulator. My next step is to distribute it using adhoc distribution mechanism. Here is what I've done1. Using Keychain Access to create a public/private key pair.2. Load it up into Developer Center to create a certificate, then download it.3. Add my ipad UUID under Devices.4. Create a adhoc provisioning profile by including my ipad in it, I only have one device in Member Center. Let's call the provision MyProv.5. Run the .cer file by double clicking it.6. Download the .mobileprovision file from Member Center to desktop. Then double click it.Now, in Xcode, under Build Setting, I change Provisioning Profile Debug and Release entry to point to MyProv, then run Product->Archive. When archiving the app, Xcode as me if I want to use my key created in step 1 above to sign the bundle. I allow it. I also choose to Save for ad hoc distribution when asked. In the summary page, I can see the Provisioning Profile column shows '
2
0
1.7k
Jun ’15
Reply to Strong reference cycle in a closure
If you add a bit of code and run it in a playground (Xcode 7 beta):class C { var m: () -> () = {} let identity: String init?(_ name: String) { identity = name print(init (identity)) } deinit { self.m() print(deinit (identity)) } } var ci = C(a) ci!.m = { var text = reference = (ci!.identity) print(text) } ci = C(b)when ci.m is run in deinit, it actually prints out reference = b even though it is deallocating a.The closure is actually capturing a reference to the local variable c1, not a reference to the instance that c1 is pointing to at the time. So no strong reference cycle is created.
Topic: Programming Languages SubTopic: Swift Tags:
Jun ’15
ErrorType
Hello!I'm curious about the best ways to handle errors that occur in asynchronous callbacks in Swift 2. It seems that returning an NSError (or ErrorType) via a callback argument is still a workable option, but this does not jive well with the new try/throw/catch/ErrorType syntax.What is the correct way to throw an asyncronous error with the new syntax?Here's a complete example to demonstrate:MyPlayground.playgroundimport Foundation import XCPlayground enum Either<L,R> { case Left(L); case Right(R) } enum MyError : ErrorType { case Failure } let succeed = arc4random_uniform(2) > 0 func performWorkSync_happy() throws -> String { // This is great! print(Sync start) if !succeed { throw MyError.Failure } return Hello, World! } func performWorkAsync_sad(callback : Either<String, MyError> / throws */ -> Void) -> Void { print(Async start) dispatch_async(dispatch_get_main_queue()) { () -> Void in // TODO: This isn't quite right.... /* if !succeed { throw Example.Failed } el
3
0
2.7k
Jun ’15
Any way to combine try with as?
I had some 1.2 code that got converted to 2.0 today. However, it appears I need to add more indention to handle it. Not sure if there is a better way:do { let orders = try NSJSONSerialization.JSONObjectWithData(d, options: NSJSONReadingOptions()) if let orders = orders as? [[String: AnyObject]] { ...I use to have a single if let ... statement here where I combined asking for the jsonObject with as? [[String: AnyObject]]Is there a better way to do this or is what I have here the right way to do it?
3
0
438
Jun ’15
How to ignore errors?
First of all, let me just go out and say that this new error handling system in Swift is a huge, huge improvement. However, this is one case that I'm unsure about, which is when you legitimately care about errors. However, sometimes you don't care about the specific error, but you just want to know if something succeeds or not. A good example is checking the availability of a file, where you just want to know if it's reachable and don't want to bomb out if it's not. In Objective-C, this would be done with one line of code, simply by passing NULL for the error parameter:BOOL isReachable = [someURL.checkResourceIsReachableAndReturnError: NULL];However, in Swift 2, the best way I can see to do this is:let someURL = ... let isReachable: Bool do { try someURL.checkResourceIsReachableAndReturnError() isReachable = true } catch { isReachable = false }This seems somewhat verbose and awkward. Is there any more elegant way just to check if a file is reachable without treating the result as an error?
7
0
3.8k
Jun ’15
Unable to Generate call on Watch OS 2
NSString *phoneNumberString = @tel:1234567891;NSURL *phoneURL = [NSURL URLWithString:phoneNumberString];[[WKExtension sharedExtension]openSystemURL:phoneURL];This is the code I'm using to try to generate a phone call on the watch. I am unable to debug when using the device and It's not possible to generate a call on the simulator, but I do hit the breakpoint on the simulator. I don't see what is wrong. Can anyone see a problem or help? Thanks.
3
0
819
Jun ’15
Reply to How to ignore errors?
In the Swift 2 Prerelease for the Swift book, it states:“There are some cases in which you know a throwing function or method won’t, in fact, throw an error at run time. In these cases, you can call the throwing function or method in a forced-try expression, written, try!, instead of a regular try expression.Calling a throwing function or method with try! disables error propagation and wraps the call in a run-time assertion that no error will be thrown. If an error actually is thrown, you’ll get a runtime error.”https://developer.apple.com/library/prerelease/ios/documentation/Swift/Conceptual/Swift_Programming_Language/ErrorHandling.html#//apple_ref/doc/uid/TP40014097-CH42-ID508(there is no way to deep-link to the relevant section but it's the second from last, Disabling Error Propagation.)If you have a chance to watch the video posted on the developer site from the What's new in Swift session, it's well worth it. I think that's where I saw this.
Topic: Programming Languages SubTopic: Swift Tags:
Jun ’15