I've been using the new template for a document-based SwiftUI app. While you get a lot of file-management for free in the new template, as it stands in the iOS version users have to back out of the file to the file browser to change the filename. I want to create an opportunity for the user to rename the file while it is open. Here's a sample project focused on the issue: https://github.com/stevepvc/DocumentRenamer In the code, I've added to the template code a simple UI with a textfield for the user to enter a new name. When the user hits the rename button, the app checks to see if the URL with that name component is available, appending a suffix if necessary to create a target url. func getTargetURL() -> URL { ttlet baseURLt=tself.fileurl.deletingLastPathComponent() ttprint(filename: (self.filename)) ttprint(fileURL: (self.fileurl)) ttprint(BaseURL: (baseURL)) ttvar target = URL(fileURLWithPath: baseURL.path + /(filename).exampletext) ttvar nameSuffix = 1 tt ttwhile (target as NSURL).checkPromisedItemIsR
Search results for
NSCocoaErrorDomain
1,063 results found
Selecting any option will automatically load the page
Post
Replies
Boosts
Views
Activity
I saved and compared the output of launchctl print for both the working sample global-daemon and mine. They both look benign and identical, except for the expected differences (label of the daemon, path of executable, PID and port number of the endpoint). They also both have this environment = { XPC_SERVICE_NAME => com.mycompany.itm.service } entry, which says launchd KNOWS my global daemon should publish an XPC Service by this name. I managed to make another tiny progress, by trying to connect to my global daemon from the UI app of the sample-code I'm using - the one that succeeds in communicating with the sample daemon. I duplicated the code there, and try to talk to the two daemons - each with its own label and protocol. Now, the UI client app no longer calls my connection invalidation handler immediately as I try to get to the remote object proxy and send it a message, like thus: id ro = [self.myServiceConnection remoteObjectProxyWithErrorHandler:^(NSError * _Nonnull error) { NSLog(@Error obtaining rem
Topic:
Code Signing
SubTopic:
Entitlements
Tags:
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
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?
I’m converting a MusicKit app from iOS to macOS with Catalyst but can’t get the player to work. The app works flawlessly on iOS but I get the following error in my console on macOS whenever the MPMusicPlayer tries to manipulate the queue by adding a song with a store id [SDKPlayback] Failed to obtain remoteObject: Error Domain=NSCocoaErrorDomain Code=4099 The connection to service on pid 0 named com.apple.Music.MPMusicPlayerApplicationControllerInternal was invalidated. UserInfo={NSDebugDescription=The connection to service on pid 0 named com.apple.Music.MPMusicPlayerApplicationControllerInternal was invalidated.} Both the player, setQueue and play methods are according to the documentation supported on Mac Catalyst 13+: https://developer.apple.com/documentation/mediaplayer/mpmusicplayercontroller https://developer.apple.com/documentation/mediaplayer/mpmusicplayercontroller/1624253-setqueue https://developer.apple.com/documentation/mediaplayer/mpmusicplayercontroller/2582424-preparetoplay https://dev
Hi there, I just downloaded the Sample Code provided by de developer documentation in order to run a simple Client-Server app with TVML Kit for tvOS. https://developer.apple.com/documentation/tvmljs/creating_a_client-server_tvml_app I'm following the docs step by step and after running the server in the terminal. I would go and open the project in Xcode and hit the build button. It would lauch the simulator but I get the following error in the simulator: This operation couldn't be completed (TVMLKitErrorDomain error 3.) And in my console I would get this: CreateTVMLApp[82816:2094742] [Image] _TVAssetGroup failed to purge cache path: Shared Asset Group, Error Domain=NSCocoaErrorDomain Code=4 “SharedImageCache” couldn’t be removed. UserInfo={NSUserStringVariant=( Remove ), NSFilePath=/Users/aeum3893/Library/Developer/CoreSimulator/Devices/A976E6FD-6B0D-4C24-BB4C-DDA1F31B0F01/data/Containers/Data/Application/9AC60995-C9EB-4051-803B-334E1A06F9DC/Library/Caches/com.example.apple-samplecode.creating-a-basi
I have been struggling with this error. My build succeeds but won't run. I've tried every suggestion I've ready in every article I could find and nothing has worked. This happens if I run it on the simulator or device. Any tips? ============================== 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 = /Users/Me/Library/Developer/Xcode/DerivedData/Main-ekzzcailcbrpykazzxdtbnpsjuhr/Build/Products/Debug-iphoneos/APP NAME.app; } - The operation couldn’t be completed. Permission denied Domain: NSPOSIXErrorDomain Code: 13 Failure Reason: Permission denied
I am testing SKAdNetwork 2.2 version; iPhone 12 ProMax beta iOS 14.5 and Version 12.5 beta (12E5220o) in my m1 clip macbookpro; after run below code [SKAdNetwork startImpression:theSkAdImpressionObject completionHandler:^(NSError * _Nullable error) { }]; //theSkAdImpressionObject is valid nothing happened, and I got below log: 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} so, any suggestions ? thanks
I have discovered an error that functioned in macOS but does not in iOS. Specifically, all the atPath: 's above are fed .absoluteString which must be .path in iOS. Correcting this eliminated the debugger statement: Error Domain=NSCocoaErrorDomain Code=642 You can’t save the file Thanks to Leo Dabus Nov 23 '20 at 3:53 @ stackoverflow.com for pointing out the different results of each.
Topic:
UI Frameworks
SubTopic:
SwiftUI
Tags:
I am having trouble on iOS 14.4 creating a symbolic link. This is prompted by the fact that I cannot get a image pointing to a file with spaces in its name to work even if I urlencode the path. I will post about that in a separate request. My work around for the above is to create a symbolic link to a file in the application support directory that is added dynamically as part of normal app function. I tried the URL and the path version of createSymbolicLinkAt<URL,PATH> path=/var/mobile/Containers/Data/Application/6AFD230E-EC7A-4E50-80A5-38E0DB0B1F07/Library/Application Support/1612401575.M10168/Iridium Portal Icons-Address Book.png symlinkPath=/var/mobile/Containers/Data/Application/6AFD230E-EC7A-4E50-80A5-38E0DB0B1F07/Library/Application Support/1612401575.M10168/Iridium-Portal-Icons-Address-Book.png NSFileManager* fm = NSFileManager.defaultManager; NSString* path = [NSString stringWithFormat:@%@/%@, dir, filename]; NSString *symlinkPath; NSError *simError; NSError *urlsimError; symlinkPath=[path strin
Hello, I solved the primary issue but in the process of exploring I discovered an oddity with symbolic link creation that warrants explanation. I am trying to create a symbolic link to a file in a subdirectory of the Application Support Directory. When I try to create a symbolic link by path it throws an error. When I repeat the same thing but with URL I do not get an error. I have revised my code above to correct an error that I discovered. For a sanity check I downloaded the app container and inspected the directory and I do not see the symbolic link. what am I missing. NSFileManager* fm = NSFileManager.defaultManager; NSString* path = [NSString stringWithFormat:@%@/%@, dir, filename]; tttttt NSString *symlinkPath; NSError *simError; NSError *urlsimError; NSString *symlinkFile = [filename stringByReplacingOccurrencesOfString:@ withString:@-] symlinkPath=[NSString stringWithFormat:@%@/%@,dir,symlinkFile]; [fm createSymbolicLinkAtPath:symlinkPath toPath:path error:&simError]; [fm createSymbolicLinkAtURL:
Topic:
App & System Services
SubTopic:
Core OS
Tags:
I'm facing the exact same problem with the application I'm working on. Have tried clean up the build folder also check the permission settings for then DerivedData folder but no result. Build succeeds but get the below error Details: The file “myapp” 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 = /Users/sysuser/Library/Developer/Xcode/DerivedData/myapp-aylojruwzhsbrrbwomkiwefxqlxv/Build/Products/Debug-iphonesimulator/myapp.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 19H114) Xcode 12.4 (17801) (Build 12D4e) Please if someone can help resolve this issue?
Topic:
Developer Tools & Services
SubTopic:
Xcode
Tags:
NSArray *tableau = [fm contentsOfDirectoryAtURL:url .... I get in return: Error Domain=NSCocoaErrorDomain Code=257 The file “*************” couldn’t be opened because you don’t have permission to view it. UserInfo={NSURL=file:///Users/gerardMonNom, NSFilePath=/Users/gerardMonNom, NSUnderlyingError=0x6000033788d0 {Error Domain=NSPOSIXErrorDomain Code=1 Operation not permitted}} How do we fix this anomaly?
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}
Hello, Since I added Core Data to my SwiftUI project, preview canva is no more working, showing an error explaining that the update took more than 5 seconds (the app is working correctly in simulator). I opened the preview diagnostic report folder, and found a file named SerializationErrors.txt, with the following message: Error Domain=NSCocoaErrorDomain Code=516 “SizeModel+CoreDataClass.swift” couldn’t be linked to “Intermediates” because an item with the same name already exists. I feel like there is a problem of refreshing the class generated for my Core data model. I tried to follow some recommendations found on this website, deleting the Library/Developer/Xcode/UserData/Previews/Simulator Devices/, or also Library/Developer/Xcode/DerivedData, and cleaning/closing Xcode, but none of them had any effect on the problem. Doing so, I noticed that in the Previews folder, two Simulator Devices were generated (one empty Simulator Devices, and one filled Simulator%20Devices), and regenerated even if I cl