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
Search results for
NSCocoaErrorDomain
1,063 results found
Selecting any option will automatically load the page
Post
Replies
Boosts
Views
Activity
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:
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:
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
Topic:
App & System Services
SubTopic:
Networking
Tags:
I am trying to crop a video file before uploading to FireStore. The code I am using is as below: func fileOutput(_ output: AVCaptureFileOutput, didFinishRecordingTo outputFileURL: URL, from connections: [AVCaptureConnection], error: Error?) { // Note: Because we use a unique file path for each recording, a new recording won't overwrite a recording mid-save. isRecording = false let exportPath = NSTemporaryDirectory().appendingFormat((randomString(length: 5)).MOV) let exportURL = URL(fileURLWithPath: exportPath) let asset = AVAsset(url: outputFileURL) let clipVideoTrack = asset.tracks( withMediaType: AVMediaType.video ).first! as AVAssetTrack let rect = CGRect(x: 0, y: 0, width: clipVideoTrack.naturalSize.height, height: clipVideoTrack.naturalSize.height) asset.cropVideoTrack(at: 0, cropRect: rect, outputURL: exportURL) { result in switch result { case .success(): self.videoURL = exportURL self.postPicture(postURL: exportURL) self.isTaken = true var success = true ...... And this is how I crop the video: https:
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:
Using the ARKit functionality I have gathered the data for an ARWorldMap on my LIDAR equipped physical device. I then migrate that serialized (NSKeyedArchiver) data to a different project that I would like to run in a simulator, doing development on analysis and processing code without having to constantly deploy and launch on a physical device. When I try to deserialize the ARWorldMap in this iOS 14.5, simulated iPhone 12 Pro I am met with- Error Domain=NSCocoaErrorDomain Code=4864 Class 'ARWorldMap' disallows secure coding. It must return YES from supportsSecureCoding. UserInfo={NSDebugDescription=Class 'ARWorldMap' disallows secure coding. It must return YES from supportsSecureCoding.} The identical project deployed on my physical iPhone 12 Pro works as expected. Again, my goal in deserializing the object graph isn't to perform any LIDAR work or anything hardware coupled, but purely to use the framework containers as convenient geometry holders for efficient workflow. After I've polished the proce
Hi All, Trying to validate some altool credentials, produces this error message. Failed to get authorization for username '<username/>' and password with errors:( Error Domain=NSCocoaErrorDomain Code=0 Status code: 0 UserInfo={NSLocalizedDescription=Status code:0, NSLocalizedFailureReason=The auth server returned a bad status code.}) This is returned when altool is called in the following way. xcrun altool --notarization-history 0 -u <username/> -p <password/> --output-format xml macOS 11.2.3 and Xcode 12.5 Things that have been tried already. Making sure the Apple system status page shows no issues. Different networks. Checked to see if any agreements need to be activated. Recreated the app-specific password multiple times. Any other suggestions? @Quinn - Hi Quinn, it's Sam Rowlands (again) and this is with another App Wrapper customer experiencing this issue (so not me directly).
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
I can't paste anything into my simulator since switching to an M1 MacMini. I've tried ticking and unticking automatically sync clipboard. I've also tried using the send clipboard option manually, but no success. I can seem to paste into safari on the simulator, but not any app I create in Xcode. I've tried multiple and even creating a new one fresh. I get the below snippet in the console complaining its unable to access some file. Looks like its an Xcode / M1 bug. I'm not running via rosetta. Does anyone know how to fix this, its become a real blocker for me testing my app 2021-06-11 12:00:28.656521+0100 camlKit-Example[3736:123707] [db] Failed to initialize client context with error Error Domain=NSOSStatusErrorDomain Code=-10817 (null) UserInfo={_LSFunction=_LSSchemaConfigureForStore, ExpectedSimulatorHash={length = 32, bytes = 0x15dde658 ed2a1267 ab2496d7 34f186ad ... ec431c65 02d68f35 }, _LSLine=409, WrongSimulatorHash={length = 32, bytes = 0xaf25dda9 e45baa35 610eaabd 5bc09901 ... 9cbe61f3 81d7b9d9 }} 202
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:
So I was running Xcode 12 fine. My company put Cylance on my laptop. I think forgot I had it running and installed Xcode 13 beta. Cylance flagged a few files - DeviceLink stuff. I launched the beta - I got the loading a plug-in error dialog. Okay I thought, just throw it out - my regular Xcode 12 should be fine. I launch it - same dialog. Uh oh... this is my work laptop and I just lost the ability to use Xcode?? I throw out Xcode 12 and get it again from the Mac AppStore. After forever installing, the same thing. I do not know how to fix this. I launched Xcode from the Terminal and here is the output: 2021-06-15 12:41:54.415 Xcode[23284:313303] [MT] DVTPlugInLoading: Failed to load code for plug-in com.apple.dt.IDE.IDEiOSSupportCore (/Applications/Xcode.app/Contents/PlugIns/IDEiOSSupportCore.ideplugin), error = Error Domain=NSCocoaErrorDomain Code=3587 dlopen_preflight(/Applications/Xcode.app/Contents/PlugIns/IDEiOSSupportCore.ideplugin/Contents/MacOS/IDEiOSSupportCore): Library not loaded: /System/L
I have a little problem that is being difficult to solve. I configured One Signal in my app to use push notifications. WARNING: OneSignal has detected that your application delegate implements a deprecated method (application:didReceiveLocalNotification:). Please note that this method has been officially deprecated and the OneSignal SDK will no longer call it. You should use UNUserNotificationCenter instead flutter: e76c1c3e-acf1-42b8-97af-0ffbe8ff8c5e ERROR: Error! iOS Simulator does not support push! Please test on a real iOS device. Error: Error Domain=NSCocoaErrorDomain Code=3010 remote notifications are not supported in the simulator UserInfo={NSLocalizedDescription=remote notifications are not supported in the simulator} Application finished. I know that iOS doesn't allow using notifications in the emulator and that's not a problem for me, but it turns out that after giving this error the app just doesn't open! Is there any setting so that the compiler can, say, skip the logging of push notific
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.}
Topic:
App & System Services
SubTopic:
iCloud & Data
Tags:
Hello, I have a big problem with the NFC (I use Ionic & Capacitor), indeed despite having uninstalled and reinstalled it still gives me the same error when I compile it on an IOS emulator: [CoreNFC] 00000002 822651e0 -[NFCHardwareManager areFeaturesSupported:outError:]:154 XPC Error: Error Domain=NSCocoaErrorDomain Code=4099 The connection to service on pid 0 named com.apple.nfcd.service.corenfc was invalidated from this process. UserInfo={NSDebugDescription=The connection to service on pid 0 named com.apple.nfcd.service.corenfc was invalidated from this process. I don't understand this error, I correctly add the right line on Info.plist to say that I am using NFC. I use the phonegap plugin made for ionic 5. **Ionic v5.33.1 Angular v12.1.0 Capacitor v1.2.0**