Search results for

NSCocoaErrorDomain

1,063 results found

Post

Replies

Boosts

Views

Activity

Parser Json with Single Quote
Hi. I am having issues with json parsing. all my source data use double quote except for one. here is the sample do { let json = [['16772', 'Cebu', 'Philippines']] if let jsonArray = try JSONSerialization.jsonObject(with: Data(json.utf8), options: []) as? [[Any]] { print(Hello World) } } catch { print(error) } if the json string is let json = [[16772, Cebu, Philippines]] it works ok. but if it is single quote, then it gives out the error message Error Domain=NSCocoaErrorDomain Code=3840 Invalid value around line 1, column 2. UserInfo={NSDebugDescription=Invalid value around line 1, column 2., NSJSONSerializationErrorIndex=2} What am i missing to enable parsing single quote normally? Thoughts?
2
0
1.9k
Dec ’22
Starting with iOS 13, opening a file in iCloud fails with: Code=256 "The file couldn’t be opened."
Starting with iOS 13 I'm receiving error reports from users that cannot open their iCloud documents anymore. The error is each time: Error Domain=NSCocoaErrorDomain Code=256 The file “Untitled.txt” couldn’t be opened. UserInfo={NSURL=file:///private/var/mobile/Library/Mobile%20Documents/iCloud~com~myapp/Documents/Untitled.txt}Code 256 means: NSFileReadUnknownErrorRestarting the device solves the problem each time, but I get a lot of error reports. My app does check the availability of iCloud documents (it uses file coordination and UIDocument). This used to work fine before iOS 13.Has anybody seen a similar issue? What could be causing this and how could I collect more useful debug information to get to the bottom of this?
2
0
2.5k
Dec ’19
Hundreds of StoreKit2 Errors: 4097
So I ran a promo for my app that got me 30k downloads or so. The app was free for a day and so it got lots of purchases. There were two errors from StoreKit2 that I can't explain (I'll detail the other one in another post) This one: StoreKit.StoreKitError.systemError(Error Domain=NSCocoaErrorDomain Code=4097 connection to service with pid 19497 named com.apple.storekitd UserInfo={NSDebugDescription=connection to service with pid 19497 named com.apple.storekitd} There are various theories online that the display name of the purchase could be an issue. Another was that this indicates that this indicates that a helper process has crashed. Generally my guidance was to restart the device and that seemed to resolve it for most if not everyone. But not everyone reached out and it rained bad reviews and I was accused of a bait and switch and so on. Is there any way to mitigate this? Any way to address it? It doesn't happen for everyone but it happens very frequently still.
3
0
778
Dec ’24
Why does it not exist via @AppStorage
2 versions 1 works 1 doesn't. UIViewRepresentable to show a PDF @AppStorage(DefaultsKey.userActiveBook.rawValue) var activeBook : URL = Bundle.main.url(forResource: BookPlaceHolder, withExtension: pdf)! func makeUIView(context: Context) -> PDFView { do { let pdfData = try Data(contentsOf: activeBook) pdfView.document = PDFDocument(data: pdfData) //<---- is nil ... } catch let Error { print(Error) } } fails with Error Domain=NSCocoaErrorDomain Code=260 The file “BookPlaceHolder.pdf” couldn’t be opened because there is no such file. func makeUIView(context: Context) -> PDFView { do { let pdfData = try Data(contentsOf: Bundle.main.url(forResource: BookPlaceHolder, withExtension: pdf)!) pdfView.document = PDFDocument(data: pdfData) ... } catch let Error { print(Error) } } Works perfectly. What is it with using @AppStorage to access the exact same URL causing the discrepancies ?
2
0
832
Nov ’23
CloudKit integration seeding, conflicted objects log
Hello,I have an issue in an app which is yet unreleased.The app uses Core Data, and I recently added CloudKit integration.Whenever I start the app data get automatically downloaded by CloudKit and I get this log: <NSCloudKitMirroringDelegate: 0x600001da61b0> - Never successfully initialized and cannot execute request '<NSCloudKitMirroringImportRequest: 0x6000024c88a0> D3FB21AB-94ED-40B7-859B-6CBEE6149473' due to error: Error Domain=NSCocoaErrorDomain Code=134404 (null) UserInfo={NSDetailedErrors=( Error Domain=NSCocoaErrorDomain Code=133021 (null) UserInfo={NSExceptionOmitCallstacks=true, conflictList=(n NSConstraintConflict (0x600003f40e00) for constraint (n namen): database: 0x8143748c0004e8e1 <x-coredata://272191BB-7D10-41DD-8E4B-56F4ECE4AB9F/Ingredient/p195>, conflictedObjects: (n 0x8143748c181ce8e1 <x-coredata://272191BB-7D10-41DD-8E4B-56F4ECE4AB9F/Ingredient/p1733>n),n NSConstraintConflict (0x600003f42fc0) for constraint (n namen): database: 0x8143748c029ce8e1 &
3
0
1.4k
Mar ’20
DeviceActivityMonitor startMonitoring error
I created my Device Activity Monitor extension, and then attempted to start monitoring using the code example from the video: let schedule = DeviceActivitySchedule( intervalStart: DateComponents(hour: 0, minute: 0), intervalEnd: DateComponents(hour: 23, minute: 59), repeats: true ) let center = DeviceActivityCenter() do { try center.startMonitoring(.daily, during: schedule) } catch { print(error) } The startMonitoring call always fails for me with the same error: [monitor] Failed to create UsageTrackingAgent proxy: Error Domain=NSCocoaErrorDomain Code=4099 The connection to service on pid 0 named com.apple.UsageTrackingAgent was invalidated. UserInfo={NSDebugDescription=The connection to service on pid 0 named com.apple.UsageTrackingAgent was invalidated.} Setting up the extension is a very manual process, so I likely missed a step somewhere, but any ideas on what this error might be indicating?
2
0
1.8k
Jul ’21
macOS: accessing /var/log/jamf.log with sandboxed app
I'm trying to parse /var/log/jamf.log (line by line), while having a sandboxed application.My entitlements file: <dict> <key>com.apple.security.app-sandbox</key> <true/> <key>com.apple.security.temporary-exception.files.absolute-path.read-write</key> <array> <string>/var/log/jamf.log</string> </array> </dict>(I also tried with .read-only)Running code: do { self.logFileHandle = try FileHandle(forReadingFrom: URL(fileURLWithPath: /var/log/jamf.log, isDirectory: false)) } catch { dump(error) self.logFileHandle = nil }With this, I get the following error:> Error Domain=NSCocoaErrorDomain Code=1 (null)> UserInfo={NSFilePath=/var/log/jamf.log}Anyone has an idea? Is it possible that / corresponds to the root of the sandbox?Thanks!FrançoisPS: Also asked on http://stackoverflow.com/questions/42585294/accessing-var-log-jamf-log-with-sandboxed
0
0
1.4k
Mar ’17
Non-Sandboxed App built with Xcode could read directory in Big Sur not Monterey
Error Domain=NSCocoaErrorDomain Code=257 The file “ReceiptScans” couldn’t be opened because you don’t have permission to view it. UserInfo={NSURL=file:///Users//Documents/ReceiptScans, NSFilePath=/Users//Documents/ReceiptScans, NSUnderlyingError=0x60000178e280 {Error Domain=NSPOSIXErrorDomain Code=1 Operation not permitted}} I turned off sandboxing to make this work in Big Sur with Xcode 13.1 beta, but when I upgraded to Monterey and Xcode 13.1 I started getting the error again. let files: [URL] = try FileManager.default.contentsOfDirectory(at: path, includingPropertiesForKeys: nil, options: [FileManager.DirectoryEnumerationOptions.skipsHiddenFiles]) I checked and sandboxing is still turned off. I cleaned the build directory and recompiled. Can't make it work. Have the permissions been changed? Have some API's been changed? Because sandboxing is turned off I don't think I should have to use any special entitlements.
3
0
1.4k
Nov ’21
Issues loading file for iOS Content Blocker
I'm trying to load a file I've save for my iOS Content blocker but I keep getting this log and it won't work. This is my code and log I'm getting, can someone please help me find the issue?ThanksOptional(Error Domain=NSCocoaErrorDomain Code=4097 connection to service named com.apple.SafariServices.ContentBlockerLoader UserInfo={NSDebugDescription=connection to service named com.apple.SafariServices.ContentBlockerLoader})import UIKitimport MobileCoreServicesclass ActionRequestHandler: NSObject, NSExtensionRequestHandling { func beginRequestWithExtensionContext(context: NSExtensionContext) { let attachment = NSItemProvider(contentsOfURL: NSBundle.mainBundle().URLForResource(blockerList, withExtension: json))! let item = NSExtensionItem() item.attachments = [attachment] if let urlToFile = BlackListManager.sharedInstance.urlToFile(), userFile = NSItemProvider(contentsOfURL: urlToFile) { item.attachments = [userFile] } print(item.attachments) context.completeRequestReturningItems([item], completionHandler
3
0
3.1k
May ’16
The file “App Name” couldn’t be opened because you don’t have permission to view it.
I didn't get any idea, Xcode doesn't show any error when I build the app to simulator get permission error, please anybody know this kind of error. Details The file “App name” couldn’t be opened because you don’t have permission to view it. Domain: NSCocoaErrorDomain Code: 257 Failure Reason: You don’t have permission. Recovery Suggestion: To view or change permissions, select the item in the Finder and choose File > Get Info. User Info: { NSFilePath = local path/Build/Products/Debug-iphonesimulator/Appname.app; } - The operation couldn’t be completed. Permission denied Domain: NSPOSIXErrorDomain Code: 13 Failure Reason: Permission denied - System Information macOS Version 10.15.7 (Build 19H2) Xcode 12.0.1 (17220)
5
0
1.2k
Oct ’20
SwiftUI VideoPlayer added AVURLAssetHTTPHeaderFieldsKey not working
let asset = AVURLAsset(url: url, options: [AVURLAssetHTTPHeaderFieldsKey: [key: value]]) let playerItem = AVPlayerItem(asset: asset) let player = AVPlayer(playerItem: playerItem) VideoPlayer(player: player).onAppear(perform: { player.play() }) I have used the same code to prepare the AVPlayer object on an iOS app and using AVPlayerViewController everything worked properly... but right now on a SwiftUI app I'm using VideoPlayer and it's not playing the video. Is there an issue with VideoPlayer not recognizing AVURLAssetHTTPHeaderFieldsKey?? This is the error I see in the debugger sendMessageWithDictionary: Failed to get remote object proxy: Error Domain=NSCocoaErrorDomain Code=4097 connection to service on pid 0 named com.apple.rtcreportingd UserInfo={NSDebugDescription=connection to service on pid 0 named com.apple.rtcreportingd}
0
0
1.5k
Feb ’21
Issue with AVAsset access in iOS 18 beta
NSString *filePath = @/var/mobile/Media/DCIM/100APPLE/IMG_0800.MP4; NSURL *fileURL = [NSURL fileURLWithPath:filePath]; AVURLAsset *asset = [[AVURLAsset alloc] initWithURL:fileURL options:nil]; Before iOS 18, you could access AVAsset using the method mentioned above, but starting from the iOS 18 beta version, the following error appears Error Domain=NSCocoaErrorDomain Code=257 未能打开文件“IMG_0800.MP4”,因为你没有查看它的权限。 UserInfo={NSURL=file:///var/mobile/Media/DCIM/100APPLE/IMG_0800.MP4, AVErrorFailedDependenciesKey=( assetProperty_AssetType ), NSUnderlyingError=0x30c497f60 {Error Domain=NSOSStatusErrorDomain Code=-12203 (null)}}
7
0
2.3k
Jul ’24
iCloud sync issues using NSPersistentCloudKitContainer for Core Data + CloudKit sync.
I have tried to set up iCloud sync. Despite fully isolating and resetting my development environment, the app fails with: NSCocoaErrorDomain Code=134060 (PersistentStoreIncompatibleVersionHashError) What I’ve done: Created a brand new CloudKit container Created a new bundle ID and app target Renamed the Core Data model file itself Set a new model version Used a new .sqlite store path Created a new .entitlements file with the correct container ID Verified that the CloudKit dashboard shows no records Deleted and reinstalled the app on a real device Also tested with “Automatically manage signing” and without Despite this, the error persists. I am very inexperienced and am not sure what my next step is to even attempt to fix this. Any guidance is apprecitated.
1
0
189
May ’25
What is com.apple.TextInput.rdt?
Hello, community, I'm using an HTML editor in a .NET MAUI application running on macOS, and I'm encountering some unexpected behavior during text editing: Double-click text selection disappears after approximately one second. Styles randomly revert or are applied to the wrong text unexpectedly. It appears to be related to macOS spell checking. When using editable elements (, or with contenteditable), the system enables spell checking by default. During this, MAUI attempts to communicate with a system process: com.apple.TextInput.rdt, which is not running, leading to repeated errors like: Error Domain=NSCocoaErrorDomain Code=4099 The connection to service named com.apple.TextInput.rdt was invalidated: failed at lookup with error 3 - No such process. Question: What is com.apple.TextInput.rdt, and why might it not be running? Thank you for any help!
2
0
153
Mar ’25
Proper way to save and retrieve URL bookmark data
I'm having difficult saving and, more importantly, retrieving URL bookmark data. I'm following the docs here https://developer.apple.com/library/archive/documentation/FileManagement/Conceptual/FileSystemProgrammingGuide/AccessingFilesandDirectories/AccessingFilesandDirectories.html#//apple_ref/doc/uid/TP40010672-CH3-SW10 The resulting file written to my app's sandbox is a MacOS Alias file. which is what I expect as per the docs : If you write the persistent bookmark data to disk using the writeBookmarkData:toURL:options:error: method of NSURL, what the system creates on disk is an alias file. The result when performing my get call is always Error Domain=NSCocoaErrorDomain Code=259 The file couldn’t be opened because it isn’t in the correct format. which leads me to believe I'm not initializing my Data object correctly before calling resolvingBookmarkData. I'm also lead to believe my Data initialization is the problem as I use the same code but instead of writing data to disk with try URL.writeBookmar
3
0
2.1k
Oct ’21