Search results for

NSCocoaErrorDomain

1,063 results found

Post

Replies

Boosts

Views

Activity

Reply to CoreDataCloudKitDemo fails when creating a new Tag
Actual Error: Context saving error: Error Domain=NSCocoaErrorDomain Code=134040 Save operation could not be completed. UserInfo={NSAffectedStoresErrorKey=( (URL: file:///var/mobile/Containers/Data/Application/1505976C-354D-4B4F-A1DE-E6A312F01E99/Library/Application%20Support/private.sqlite), ( (URL: file:///var/mobile/Containers/Data/Application/1505976C-354D-4B4F-A1DE-E6A312F01E99/Library/Application%20Support/private.sqlite), (URL: file:///var/mobile/Containers/Data/Application/1505976C-354D-4B4F-A1DE-E6A312F01E99/Library/Application%20Support/shared.sqlite) ) ), NSUnderlyingException= threw while encoding a value.}
Jun ’21
Core Data: Error Domain=NSCocoaErrorDomain Code=257
I am trying to access data stored in Core Data in a previous release of an app for a bundle ID with a new app which I'm trying to get to access this data and send to an external API over the internet. The persistent container in the old app is set up like this: private lazy var persistentContainer: NSPersistentContainer = { let url = Bundle(for: ModelManager.self).url(forResource: GIRC, withExtension: momd) let model = NSManagedObjectModel(contentsOf: url!) let retval = NSPersistentContainer(name: GIRC, managedObjectModel: model!) let desc = NSPersistentStoreDescription() desc.url = NSPersistentContainer.defaultDirectoryURL().appendingPathComponent(GIRC.sqlite) desc.type = NSSQLiteStoreType desc.shouldAddStoreAsynchronously = false retval.persistentStoreDescriptions = [desc] retval.loadPersistentStores { (desc, error) in if error == nil { var values = URLResourceValues() values.isExcludedFromBackup = true try? desc.url?.setResourceValues(values) } } return retval }() so in the new app, I use this code to acce
2
0
1.7k
Jun ’21
Reply to Error JSONSerialization
I am facing similar issue.... Error: underlyingError: Optional(Error Domain=NSCocoaErrorDomain Code=3840 Invalid value around character 0. UserInfo={NSDebugDescription=Invalid value around character 0.} Question I know that using using JSONDecoder we can convert the downloaded JSON data into class/struct object. Is there a way to do the same for raw data(NSData)/octect. Since downloaded is not a json, I am getting error. I have class like this Code public struct FileData: Codable{ public var data: Data? public init (data: Data? = nil){ self.data = data } } Is there a way to assign the downloaded data to FileData().data via decoding extension Data { func decode() -> Result where T: Codable { do { let decoder = JSONDecoder() let object: T = try decoder.decode(T.self, from: self) return Result.success(object) } catch { return Result.failure(error) } } Expectation: Here T is FileData. I using REST Get api to download(octet stream) a file data and want to set it to FileData().data. It seems like raw da
Topic: Programming Languages SubTopic: Swift Tags:
Jun ’21
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
Jun ’21
Can't make Siri Shortcuts work in macCatalyst app
Hi I'm trying to port my iOS app to Mac using macCatalyst, and I'm having problem with Siri Shortcuts. The code complies and runs, but when I try to add shortcut using INUIAddVoiceShortcutViewController I'm seeing 'Shortcuts unavailable.' Using INVoiceShortcutCenter.shared.getAllVoiceShortcuts returns error [Intents] -[INVoiceShortcutCenter getAllVoiceShortcutsWithCompletion:]_block_invoke Error from -getVoiceShortcutsWithCompletion: Error Domain=NSCocoaErrorDomain Code=4099 Couldn’t communicate with a helper application. Any ideas what's I'm doing wrong? Same code works perfectly fine on iOS.
4
0
3.3k
Jun ’21
Reply to SKAdnetwork 2.2
I am able to get SKAdnetwork 2.2 for fidelity-type 1 but [SKAdNetwork startImpression:self.impression completionHandler:^(NSError * _Nullable error) { NSLog(@Start SKAdImpression with error: %@, error); }]; Always failing with below error 2021-05-25 17:49:16.120256+0530 SKAdNetworkApp[2409:704536] SKAdNetwork: Error in remote proxy while starting view-through impression: Error Domain=NSCocoaErrorDomain Code=4097 connection to service on pid 0 named com.apple.storekitservice UserInfo={NSDebugDescription=connection to service on pid 0 named com.apple.storekitservice} iOS console logs NSXPCConnection: 0x100978be0 connection on mach service named com.apple.storekitservice from pid 2409: Exception caught during decoding of received selector startAdImpressionWithConfig:completionHandler:, dropping incoming message. Exception: Exception while decoding argument 0 (#2 of invocation): Exception: +[NSNumber enumerateObjectsUsingBlock:]: unrecognized selector sent to class 0x1e613e768 Any idea? Thanks in advance
Topic: App & System Services SubTopic: General Tags:
May ’21
Reply to Got a serious NSURLSession background session bug
Based from response, the file is temporarily downloaded in file:///var/mobile/Library/Caches/com.apple.nsurlsessiond/Downloads/xxxxx/CFNetworkDownload_qb9hwG.tmp I cannot copy this file to my download location since I am encountering an error: (NSError) error = 0x00000002818928e0 Error Domain=NSCocoaErrorDomain Code=257 The file CFNetworkDownload_qb9hwG.tmp could not be opened because you do not have permission to view it. UserInfo = {NSFilePath = /var/mobile/Library/Caches/com.apple.nsurlsessiond/Downloads/xxxxx/CFNetworkDownload_qb9hwG.tmp, NSUnderlyingError = 0x2818927c0 {Error Domain = NSPOSIXErrorDomain Code = 1 Operation not permitted}} I am assuming the temporary file should be saved in my App Folder. Additional info: My app is registered with the Microsoft Identity platform
May ’21
iOS Notification extension error without description
After I integrated a notification extension using Xcode 8 and iOS10, I have the following error and I can't find a solution for this yet.Basically I send a push notification with mutable-content, but the extensions is not loaded, I see the following error when the OS tries to use the extension. Apple is not providing any description about what is failing really.Any help would be great, from someone having this feature working already.Dec 31 21:00:00 iPhone SpringBoard(libextension.dylib)[51] <Notice>: calling plugIn beginUsing: Dec 31 21:00:57 iPhone pkd[86] <Notice>: assigning plug-in com.test.app.NotificationWithAttachmentExtension(1.0) to plugin sandbox Dec 31 21:03:57 iPhone pkd[86] <Notice>: enabling pid=51 for plug-in com.test.app.NotificationWithAttachmentExtension(1.0) 38BB5FF1-2597-42E0-B950-169DBFA80573 /private/var/containers/Bundle/Application/A8C47706-C0EC-4FB1-ABA7-0118372F6900/testapp.app/PlugIns/NotificationWithAttachmentExtension.appex Dec 31 21:00:53 iPhone SpringBoard(Plug
3
0
5.3k
May ’21
Reply to My sandboxed AUv3 plugin cannot access user selected samples
My sandboxed application still has access to my Application Support folder without problem. Which Application Support folder? Consider this: let u = try! FileManager.default.url(for: .applicationSupportDirectory, in: .userDomainMask, appropriateFor: nil, create: true) print(u.path) which prints this: /Users/quinn/Library/Containers/com.example.apple-samplecode.Test679409/Data/Library/Application Support So, you normally end up referencing the Application Support folder in your app’s container, and you obviously have access to that. Now imagine you have a file in your ‘real’ Application Support folder: % cat /Users/quinn/Library/Application Support/tmp.txt Hello Cruel World! This code: let u2 = URL(fileURLWithPath: /Users/quinn/Library/Application Support/tmp.txt) do { _ = try Data(contentsOf: u2) } catch { print(error) } prints this: Error Domain=NSCocoaErrorDomain Code=257 The file “tmp.txt” couldn’t be opened because you don’t have permission to view it. UserInfo={NSFilePath=/Users/quinn/Library/Ap
Topic: App & System Services SubTopic: Core OS Tags:
May ’21
Problem starting a macOS file provider extension
Hi, I'm trying to get to the point when the code of my file provider extension gets executed. As there is no Xcode template for macOS file provider extension target, I've created a FinderSync extension and updated its Info.plist NSExtension entry manually: NSExtension NSExtensionFileProviderDocumentGroup $(TeamIdentifierPrefix)group.xxxx.test-placeholders NSExtensionFileProviderEnabledByDefault NSExtensionFileProviderSupportsEnumeration NSExtensionPointIdentifier com.apple.fileprovider-nonui NSExtensionPrincipalClass FakeProvider I use my main app to bootstrap the provider (i.e. to register a domain for file provider and trigger enumeration), i.e.: let domainID = NSFileProviderDomainIdentifier(rawValue: blahblahblah) let domain = NSFileProviderDomain(identifier: domainID, displayName: My Secret Files) NSFileProviderManager.add(domain) { (err) in tif let err = err { tt/* handle error */ t} else { tt let mgr = NSFileProviderManager(for: domain) tt mgr?.signalEnumerator(for: .rootContainer) { ttt err in ttt
4
0
4.3k
May ’21
[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
May ’21
FileManager contentsOfDirectory fails with error 256
There is a macFUSE bug that can result in an Input/output error - https://github.com/osxfuse/osxfuse/issues/45 when listing a directory. In most cases this doesn't cause any major issues, just a ls: mount: Input/output error message when running ls. The problem is that the contentsOfDirectory(at:includingPropertiesForKeys:options:) now does not work, however, the contentsOfDirectory(atPath:) method does. There appears to be a difference in how these methods handle errors, although the documentation doesn't seem to suggest this. The following code returns an array of strings without an error: FileManager.default.contentsOfDirectory(atPath: /Users/user) The following code results in an error: FileManager.default.contentsOfDirectory(at: URL.init(fileURLWithPath:/Users/user), includingPropertiesForKeys: nil) REPL: $E3: NSError = domain: NSCocoaErrorDomain - code: 256 { _userInfo = 3 key/value pairs { [0] = { key = NSURL value = file:///Users/user/mount } [1] = { key = NSFilePath value = /Users/user/mount
6
0
2.6k
May ’21
"SKDownload encountered a sandboxing error" under iOS 14 only
Hi there, We're tracking an issue both in the sandbox environment and in production whereby download of App Store hosted in-app purchase content is not working properly. This is something that only happens on iOS 14 - all beta versions up to and including beta 3 - and has occurred with no change in our in-app purchase code. Either there is a bug in iOS 14 StoreKit, or something changed which breaks our implementation. In production our logs show that in-app purchase SKPaymentTransaction object flow occurs nominally, with purchased and restored transactions presented and handled as expected. Ultimately we provide content by calling [[SKPaymentQueue defaultQueue] startDownloads:transaction.downloads] with a non-nil transaction whose first downloads array object is non-nil and in the 'Waiting' SKDownload state. Ultimately a 'Finished' download object is returned via updatedDownloads:, but on processing the (supposedly) completed download NSFileManager fails to move the content files into the app directory. Inves
23
0
5.2k
Apr ’21
Reply to FileManager contentsOfDirectory fails with error 256
You need to trigger the Input/output error - https://github.com/osxfuse/osxfuse/issues/45 first. This can be achieved with ifuse - https://github.com/libimobiledevice/ifuse and connecting an iOS device: brew install ifuse mkdir iphone ifuse iphone Now disconnecting the iOS device will result in the Input/output error. This is the output when running the above code in Xcode 12.4: content directory contents error Error Domain=NSCocoaErrorDomain Code=256 The file “mount” couldn’t be opened. UserInfo={NSURL=file:///Users/user/mount, NSFilePath=/Users/user/mount, NSUnderlyingError=0x600002b69d10 {Error Domain=NSPOSIXErrorDomain Code=5 Input/output error}} error Error Domain=NSCocoaErrorDomain Code=256 The file “mount” couldn’t be opened. UserInfo={NSURL=file:///Users/user/mount, NSFilePath=/Users/user/mount, NSUnderlyingError=0x600002b6e0a0 {Error Domain=NSPOSIXErrorDomain Code=5 Input/output error}}
Topic: Programming Languages SubTopic: Swift Tags:
Apr ’21
Error during video loading with PHPickerViewController
We are using the PHPickerViewController to load photos and videos into our app. When an item was picked we load it using the loadFileRepresentation() method of NSItemProvider. In its callback we get the following error sometimes: Error copying file type public.movie. Error: Error Domain=NSItemProviderErrorDomain Code=-1000 Cannot load representation of type public.movie UserInfo={NSLocalizedDescription=Cannot load representation of type public.movie, NSUnderlyingError=0x281a87a50 {Error Domain=NSCocoaErrorDomain Code=4101 Couldn’t communicate with a helper application. UserInfo={NSUnderlyingError=0x281a85e30 {Error Domain=PHAssetExportRequestErrorDomain Code=0 (null) UserInfo={NSUnderlyingError=0x281a85620 {Error Domain=PFSharingRemakerErrorDomain Code=2 Underlying operation encountered an error UserInfo=0x280018500 (not displayed)}}}}}} The error seems to occur randomly when picking arbitrary videos. What does the error mean and how do we make the item provider load more reliably here?
1
0
1.2k
Apr ’21