Search results for

NSCocoaErrorDomain

1,063 results found

Post

Replies

Boosts

Views

Activity

Unable to get file handle when running code within Xcode
Hi All, I have the following code in swift to read and print a file's content: import Foundation let a = try String(contentsOfFile: /Users/humza/Desktop/test.txt) print(a) I am able to run the code in an Xcode playground. However, when I make a command line project in Xcode 11.4.1, I get the following error when running the project: Fatal error: Error raised at top level: Error Domain=NSCocoaErrorDomain Code=257 The file “test.txt” couldn’t be opened because you don’t have permission to view it. Note the build is successful and I can run the executable from terminal. What is preventing this from running within Xcode? I do not have a sandboxing capability added to my project. I have tried clearing the project's build folder. I have also given Xcode full disk access. I have also given my file full 777 permissions to help debug.
0
0
440
Jul ’20
[PHPicker] Permission error followed by "no such file" error
I have a naive implementation of the new PHPicker in SwiftUI (code below). When running on a separate device (iPhone 6s, iOS 14.0), I am able to load some images, but not others. The images that do not load seem to encounter a permissions error: // [...] indicates redacted content for brevity [...] [default] [ERROR] Could not create a bookmark: NSError: Cocoa 257 The file couldn’t be opened because you don’t have permission to view it. } [...] [claims] Upload preparation for claim [...] completed with error: Error Domain=NSCocoaErrorDomain Code=260 The file “[...].jpeg” couldn’t be opened because there is no such file. UserInfo={NSURL=[...]{Error Domain=NSPOSIXErrorDomain Code=2 No such file or directory}} I'm a little confused because I thought a core value proposition of the new PHPicker was that it automatically allowed access to selected photos. When I try selecting an image using Simulator, I just get the second error (does not exist), but not the first. I'm also noticing that the main photos gr
14
0
8.7k
Jul ’20
Image fails to open via Drag and Drop on iOS
I've got a SwiftUI app with the onDrop method on my View like this: .onDrop(of: [.image], delegate: myController) In an extension of my controller I conform to the DropDelegate and implement performDrop(info:) Here's my implementation: guard info.hasItemsConforming(to: [.image]) else { return false } let items: [NSItemProvider] = info.itemProviders(for: [.image]) guard let item: NSItemProvider = items.first else { return false } guard item.canLoadObject(ofClass: MPImage.self) else { return false } item.loadObject(ofClass: MPImage.self) { (reading, error) in guard error == nil else { return } guard let image: MPImage = reading as? MPImage else { return } self.didLoad(image: image) } The code compiles fine on iOS (tho not on macOS, see link) https://developer.apple.com/forums/thread/653934 So when I run the app on iOS, and drag an image from Photos and drop it on my app I get the following error: MyApp perform drop failed: Error Domain=NSItemProviderErrorDomain Code=-1000 Cannot load representation of type publ
2
0
5.3k
Jul ’20
Reply to Preview Crashes when using @FetchRequest
Looking at the diagnostics generated by Preview gives me the following message Error Domain=NSCocoaErrorDomain Code=516 “ChildProfile+CoreDataClass.swift” couldn’t be linked to “Intermediates” because an item with the same name already exists. UserInfo={NSSourceFilePathErrorKey=/Users/james/Library/Developer/Xcode/DerivedData/BedtimeClock-hehxrojiiepyadgitseedusiyozd/Build/Intermediates.noindex/Previews/Bedtime Clock/Intermediates.noindex/Bedtime Clock.build/Debug-iphonesimulator/Bedtime Clock.build/DerivedSources/CoreDataGenerated/Model/ChildProfile+CoreDataClass.swift, NSUserStringVariant=( Link ), NSDestinationFilePath=/var/folders/dp/hztzhf572q26jwx6vb9nqpw0000gn/T/previews-diagnostics-20200713-200707/Intermediates/ChildProfile+CoreDataClass.swift, NSFilePath=/Users/james/Library/Developer/Xcode/DerivedData/Bedtime_Clock-hehxrojiiepyadgitseedusiyozd/Build/Intermediates.noindex/Previews/Bedtime Clock/Intermediates.noindex/Bedtime Clock.build/Debug-iphonesimulator/Bedtime Clock.build/DerivedSources
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Jul ’20
Is Network Extension -- XPC --> launchd daemon possible?
I want/need/would like the Network Extension to send a XPC message to a XPC listener of a launchd daemon. So far, what I'm observing is: the NE is apparently able to obtain a remote proxy object for the XPC service name defined by the launchd daemon. when the proxy invokes one of the methods of the remote interface, it does nothing: the completion handler of the method is not called in the Network Extension. the proxy error handler is not called either. In Console, I'm seeing: com.xxxxxxxxx.extension Error Domain=NSCocoaErrorDomain Code=4099 The connection to service on pid 0 named com.xxxxxxx.logListener was invalidated. UserInfo={NSDebugDescription=The connection to service on pid 0 named com.xxxxxxx.logListener was invalidated.} This is a bit mysterious considering that the pid for the listener is not 0 (i.e. the kernel_task). Questions: Is it possible to send XPC messages from a Network Extension to a launchd daemon? Maybe this requires to use some specific service names too or specific bundle id
4
0
1.3k
Jul ’20
AVAudioPlayer can't play remote file
I'm trying to play an audio file in my SwiftUI app and first through something was wrong with the URL or file. But even with this URL, it still gives me the following error: Error Domain=NSCocoaErrorDomain Code=262 The file couldn’t be opened because the specified URL type isn’t supported. What am I missing. This is in a playground on Xcode 11.6 import UIKit import AVKit ifttlet url = URL(string:https://audio-ssl.itunes.apple.com/apple-assets-us-std-000001/AudioPreview18/v4/9c/db/54/9cdb54b3-5c52-3063-b1ad-abe42955edb5/mzaf_520282131402737225.plus.aac.p.m4a) { ttvar audioPlayer:AVAudioPlayer? ttdo { ttttlet isReachable = try url.checkResourceIsReachable() ttttprint(isReachable) ttttaudioPlayer = try AVAudioPlayer(contentsOf: url) tt} ttcatch tt{ ttttprint(error) ttttaudioPlayer = nil tt} }
1
0
3.7k
Jul ’20
VPN (PacketTunnelProvider extension) won't connect after App Store upgrade
Some users are unable to connect our PacketTunnelProvider-based VPN after upgrading our app from the Mac App Store. It might be related to whether or not you're connected at the time of the upgrade (or if our extension is loaded). Without TestFlight on the Mac it's tough to repro - we only get one shot per machine. After the upgrade our app launches, but hitting the connect button doesn't do anything, and it generates neagent and nesessionmanager console errors. We've found that killing our extension process fixes the issue in at least some cases, as does rebooting the Mac (which would also kill the process). I see appstoreagent killing our app, and it looks like nehelper is getting the message that the VPN profiles are now associated with the new app: default 14:28:32.154902-0700 nehelper App for configuration 65.154.227.166 (com.netmotionwireless.MobilityOSX) changed After the app restarts and the user tries to connect there are errors: error 14:28:39.323170-0700 neagent [u 7A49BFF0-7089-4B8D-BD2E-397E65517
1
0
829
Jul ’20
Code=513 couldn’t be copied because you don’t have permission to access “Group Containers”."
I am working on a macOS application in sandbox mode. I have enabled App groups and I can see the app group folder gets created. I am attempting to move a file from the app directory to the shared group but im see a permission error. Error moving files Error Domain=NSCocoaErrorDomain Code=513 “Container_1595437210.503603.txt” couldn’t be copied because you don’t have permission to access “Group Containers”. Any ideas?
1
0
1.3k
Jul ’20
NSCloudKitMirroringDelegate "Never successfully initialised" error
After single attempt to fetch context on persistentContainer right after internet was restored (NWPathMonitor update handler), CoreData+CloudKit mirroring stuck and messaging that no internet, and cannot initialise. All CloudKit requests work perfect, but CloudKitMirroring cannot do sync, only app restart helps. Have no idea how simple fetch can kill CoreData mirroring... It happens each time I fetch on internet restore (I have to do that, to upload parent records to CloudKit manually as Apple did not implemented that in NSPersistentCloudKitContainer, all my records must have parents in order to share them). 2020-07-24 19:36:25.309059+0300 Grocery List[1045:148713] [error] error: CoreData+CloudKit: -[NSCloudKitMirroringDelegate requestAbortedNotInitialized:]1379: <NSCloudKitMirroringDelegate: 0x281e048f0> - Never successfully initialized and cannot execute request '<NSCloudKitMirroringDelegateSerializationRequest: 0x283c6cec0> B20F9DB7-9600-4456-B682-056F4849FE4D resultType: Records resultType: Re
2
0
1.4k
Jul ’20
Reply to [PHPicker] Permission error followed by "no such file" error
Beta 3 have same issue. PHPicker Demo throughs same error with Xcode beta 3 and iOS beta 3. [ERROR] Could not create a bookmark: NSError: Cocoa 257 The file couldn’t be opened because you don’t have permission to view it. } [claims] Upload preparation for claim 5C062BA9-85BE-458E-8DDC-0CBB1FDE4E4F completed with error: Error Domain=NSCocoaErrorDomain Code=260 The file “D843997F-8362-4A9A-ADAC-7F4DFC889C41.jpeg” couldn’t be opened because there is no such file. UserInfo={NSURL=file:///private/var/mobile/Containers/Shared/AppGroup/26E08B60-0C4E-45B5-85B9-87F4D5F0DDB0/File%20Provider%20Storage/D843997F-8362-4A9A-ADAC-7F4DFC889C41.jpeg, NSFilePath=/private/var/mobile/Containers/Shared/AppGroup/26E08B60-0C4E-45B5-85B9-87F4D5F0DDB0/File Provider Storage/D843997F-8362-4A9A-ADAC-7F4DFC889C41.jpeg, NSUnderlyingError=0x2834f2610 {Error Domain=NSPOSIXErrorDomain Code=2 No such file or directory}}
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Jul ’20
Inconsistent crash-on-launch while calling MLModel.compileModel(at: url)
Okay here's a strange one. I have a project in which I compile a couple .mlmodel files on first launch of the app. For the vast majority of our users this is working just fine. However, for a few users the app is crashing on every launch at the point where I call MLModel.compileModel(at: newFileURL). The error that's getting thrown is: Error during compilation of model: Error Domain=NSCocoaErrorDomain Code=512 The file couldn’t be saved. Once a user's device begins crashing here it will continue crashing here until a complete delete-reinstall of the app. A simple build-and-run will not cause the issue to go away (which makes it debuggable to an extent). The crashing issue even persists between app updates installed through the App Store. I've tried doing this compilation on different threads, changing the name of the model, etc. Nothing seems to resolve it except a complete delete and reinstall of the app. So the open questions are: Why would this method fail to write the file? Why are only some user
6
0
1.3k
Jul ’20
URL init from bookmark throws with file doesn't exist.
I just created a url bookmark (to be saved to db) and immediately read the bookmark afterwards. This line throws an error Error Domain=NSCocoaErrorDomain Code=4 The file doesn’t exist. let url = try URL( resolvingBookmarkData: bookmark, options: .withoutUI, bookmarkDataIsStale: &isStale ) This works perfectly fine in iOS 13, but the error throws in 14b3, did something change, or is this a beta bug?
3
0
2k
Jul ’20
Reply to NSCloudKitMirroringExportRequest issues
I am also having same issue not using SwiftUI. Simple swift app with CoreData and CloudKit auto syncing option turn on. <NSCloudKitMirroringResult: 0x600000268fa0> success: 0 madeChanges: 0 error: Error Domain=NSCocoaErrorDomain Code=134417 Request '<NSCloudKitMirroringImportRequest: 0x600000cc10e0> 1A57C80D-0BAE-4E9A-BF8C-41F695ECE8A1' was cancelled because there is already a pending request of type 'NSCloudKitMirroringImportRequest'. UserInfo={NSLocalizedFailureReason=Request '<NSCloudKitMirroringImportRequest: 0x600000cc10e0> 1A57C80D-0BAE-4E9A-BF8C-41F695ECE8A1' was cancelled because there is already a pending request of type 'NSCloudKitMirroringImportRequest'.}
Jul ’20
Debug a frozen app / view hierarchy
Hi i'm stuck on my react native development. on Xcode i'm getting the error below. Unfortunately, its a random crash and it also dosen't really tell me where (especially which view) the error is. Terminating app due to uncaught exception 'UIViewControllerHierarchyInconsistency', reason: 'A view can only be associated with at most one view controller at a time! View <RCTView: 0x7f91cdeab480; reactTag: 259; frame = (0 0; 414 896); layer = is associated with <UIViewController: 0x7f91d01ca240>. Clear this association before associating this view with <UIViewController: 0x7f91cdc998b0>.' I know on xcode i can check the UI hierarchy. But apparantely after the app crashes, i am unable to click on it because i get the 2nd error (below) DebugHierarchyRequest - Failed to unarchive request data with error: Error Domain=NSCocoaErrorDomain Code=3840 JSON text did not start with array or object and option to allow fragments not set. UserInfo={NSDebugDescription=JSON text did not start with array or
0
0
1.5k
Aug ’20