Search results for

NSCocoaErrorDomain

1,063 results found

Post

Replies

Boosts

Views

Activity

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
UIDocumentPickerViewController - Open folder from 3rd party file provider
Hi, I am trying to use UIDocumentPickerViewController to select a folder in a 3rd party file provider as a default save location. The goal would be to have that folder be the automatic location to save to whenever the app needs to write a file out to disk, instead of the app's Documents directory. When I present the UIDocumentPickerViewController for selecting folders, however, every 3rd party file provider is grayed out. Only On this Device and iCloud Drive are available. let controller = UIDocumentPickerViewController(documentTypes: [kUTTypeFolder as String], in: .open) controller.delegate = self controller.allowsMultipleSelection = false present(controller, animated: true, completion: nil) The documentation states: With iOS 13, users can select a directory from any of the available file providers using a UIDocumentPickerViewController. It seems strange that this is specifically called out in the docs, but it doesn't work at all. One hypothesis that I have is that there is some confusion in the system betwe
6
0
3.2k
Oct ’21
Xcode quit unexpectedly
Some one can help me for this problem. Thank you!!!!!!Process: Xcode [1411]Path: /Applications/Xcode.app/Contents/MacOS/XcodeIdentifier: com.apple.dt.XcodeVersion: 11.1 (15405)Build Info: IDEFrameworks-15405000000000000~13App Item ID: 497799835App External ID: 832925179Code Type: X86-64 (Native)Parent Process: ??? [1]Responsible: Xcode [1411]User ID: 501Date/Time: 2019-10-17 17:00:19.702 +0200OS Version: Mac OS X 10.14.5 (18F132)Report Version: 12Anonymous UUID: 1031994E-23CB-BF39-895C-07ED5AAE0166Time Awake Since Boot: 9100 secondsSystem Integrity Protection: enabledCrashed Thread: 0 Dispatch queue: com.apple.main-threadException Type: EXC_CRASH (SIGABRT)Exception Codes: 0x0000000000000000, 0x0000000000000000Exception Note: EXC_CORPSE_NOTIFYApplication Specific Information:ProductBuildVersion: 11A1027UNCAUGHT EXCEPTION (NSInternalInconsistencyException): Error getting value for parameter key 'class' of extension 'Xcode.InterfaceBuilderKit.PepperIntegration.ConfigurationList' in plug-in 'com.apple.dt.IDE.IDEI
3
0
2.1k
Oct ’21
Reply to Think I am misunderstanding keychain-access-groups, can anyone confirm how I should be handling it
Morning Quinn, Are you building your Info.plist and .entitlements file with Apple tools? Modern systems apply additional constraints on security-sensitive XML files. See Ensure Properly Formatted Entitlements for more on this. I am not building either the info.plist or the entitlements file using Apple's tools. I am using [NSPropertyListSerialization dataWithPropertyList:format:options:error:] to create a NSData object of format kCFPropertyListXMLFormat_v1_0 which is then written to the file using a stream. plutil -lint ~/mainEntitlementsAppStore.entitlements ~/mainEntitlementsAppStore.entitlements: OK codesign -d --entitlements :- ~/Aqua Swatch.app Executable= ~/Aqua Swatch.app/Contents/MacOS/Aqua Swatch com.apple.application-identifier QXAFMEPH6X.com.ohanaware.aquaSwatch com.apple.developer.team-identifier QXAFMEPH6X com.apple.security.app-sandbox com.apple.security.network.client keychain-access-groups QXAFMEPH6X.com.ohanaware.aquaSwatch If the mainEntitlements only consists of com.apple.security
Topic: Code Signing SubTopic: Entitlements Tags:
Oct ’21
SwiftUI Preview fail with Core Data: "Error Domain=NSCocoaErrorDomain Code=516"
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
4
0
4.6k
Oct ’21
Unable to upload your app for notarization.
*** Error: Notarization failed for 'app.zip'. *** Error: Unable to upload your app for notarization. Failed to get authorization for username xxxx and password. ( Error Domain=NSCocoaErrorDomain Code=0 Status code: 0 UserInfo={NSLocalizedDescription=Status code: 0, NSLocalizedFailureReason=The auth server returned a bad status code.} ) (-1011) { NSLocalizedDescription = Unable to upload your app for notarization.; NSLocalizedFailureReason = Failed to get authorization for username 'xxxx' and password. (n Error Domain=NSCocoaErrorDomain Code=0 Status code: 0 UserInfo={NSLocalizedDescription=Status code: 0, NSLocalizedFailureReason=The auth server returned a bad status code.}n); }
2
0
970
Oct ’21
xcrun altool no longer working with Xcode 13
We use to be able to run the xcrun altool all the time to upload apps to Test flight, but now it has been failing consistently for the last few days. For example: xcrun altool --list-providers -u myemail@email.com then I add my password and get the following error. *** Error: Failed to list providers. *** Error: Failed to list providers. Failed to get authorization for username 'myemail@email.com' and password. ( Error Domain=NSCocoaErrorDomain Code=0 Status code: 0 UserInfo={NSLocalizedDescription=Status code: 0, NSLocalizedFailureReason=The auth server returned a bad status code.} ) (-1011) I have tried to run it on different networks and even had others on my team try and they get the same error. This was working for a long time (even a few times with Xcode 13) and now it just stopped
1
0
5.3k
Oct ’21
iOS15 show you don’t have permission to access “Caches” with Newstand download
my app is newsstand app. it is success download issue in my app with iOS14 & iOS15 simulate. when i try on real device, it fail to download. log Error Domain=NSCocoaErrorDomain Code=513 “1318303744724624100” couldn’t be moved because you don’t have permission to access “Caches”. UserInfo={NSSourceFilePathErrorKey=/var/mobile/Media/Downloads/7803184277104936561/1318303744724624100, NSUserStringVariant=( Move ), NSDestinationFilePath=/private/var/mobile/Containers/Data/Application/1C6FE6AF-1670-48ED-BE04-2806C8AECC65/Library/Caches/bgdl-4119-6c4a7ac1c9c0c671.xzip, NSFilePath=/var/mobile/Media/Downloads/7803184277104936561/1318303744724624100, NSUnderlyingError=0x282aa3d80 {Error Domain=NSPOSIXErrorDomain Code=1 Operation not permitted}} i have set Privacy - Downloads Folder Usage Description in info.plist please help
9
0
3.7k
Oct ’21
Reply to Error thrown when querying for Subscription Products
Hi there, I have been working on StoreKit 2 for my app. I'm still facing the issue with simulators even after updating to the released version of Xcode 13 and its simulators. It's been working correctly on a device. Below is the query code: let productIdentifiers: Set = [monthly_subscription, yearly_subscription, family_monthly_subscription, family_yearly_subscription] Task(priority: nil){ do { let _subscribableProducts = try await Product.products(for: productIdentifiers) /**/ self.subscribableProducts = _subscribableProducts /**/ for subscriptionProduct in self.subscribableProducts { let model_Subscribe = Model_SubscribeType(subscribeType: subscriptionProduct.id, subscribeKey: subscriptionProduct.id, subscribeDuration: , subscribe_CostCurrency: String(subscriptionProduct.displayPrice.prefix(1)), subscribe_Cost: (subscriptionProduct.price), subscribe_DisplayPrice: subscriptionProduct.displayPrice, subscribe_isSubscribed: false, subscribe_FamilySharing: subscriptionProduct.isFamilyShareable, subscribe_SKProdu
Topic: App & System Services SubTopic: StoreKit Tags:
Sep ’21
Reply to I want to access twitter filter search v2 endpoint in ios app
Ok I did this static func callFilterSearch() { let Url = String(format: https://api.twitter.com/2/tweets/search/stream?place.fields=contained_within&user.fields=location&tweet.fields=geo) guard let serviceUrl = URL(string: Url) else { return } var request = URLRequest(url: serviceUrl) request.httpMethod = POST request.setValue(Bearer MY TOKEN, forHTTPHeaderField: Authorization) request.setValue(text/html; charset=UTF-8, forHTTPHeaderField: Content-Type) request.setValue(gzip, deflate, br, forHTTPHeaderField: Accept-Encoding) let session = URLSession.shared session.dataTask(with: request) { (data, response, error) in if let response = response { print(response) } if let data = data { do { let json = try JSONSerialization.jsonObject(with: data, options: .allowFragments) print(json) } catch let error { print(error: (error)) } } }.resume() } and now it is giving me this error error: Error Domain=NSCocoaErrorDomain Code=3840 Invalid value around character 0. UserInfo={NSDebugDescription=Invalid
Topic: App & System Services SubTopic: General Tags:
Sep ’21
Reply to I want to access twitter filter search v2 endpoint in ios app
Ok, I tried this: static func callFilterSearch() { let Url = String(format: https://api.twitter.com/2/tweets/search/stream?place.fields=contained_within&user.fields=location&tweet.fields=geo) guard let serviceUrl = URL(string: Url) else { return } let parameterDictionary = [:] var request = URLRequest(url: serviceUrl) request.httpMethod = POST request.setValue(Bearer token, forHTTPHeaderField: Authorization) request.setValue(Application/json, forHTTPHeaderField: Content-Type) guard let httpBody = try? JSONSerialization.data(withJSONObject: parameterDictionary, options: []) else { return } request.httpBody = httpBody let session = URLSession.shared session.dataTask(with: request) { (data, response, error) in if let response = response { print(response) } if let data = data { do { let json = try JSONSerialization.jsonObject(with: data, options: []) print(json) } catch { print(error) } } }.resume() } But got this error: Error Domain=NSCocoaErrorDomain Code=3840 JSON text did not start with ar
Topic: App & System Services SubTopic: General Tags:
Sep ’21
Enable access to Documents Directory in Xcode 13
I'm trying to export a text document in the Documents directory and running into file permission problem in a Mac app that does not use the App Sandbox. As a workaround for the issue, I tried turning on the App Sandbox and giving read/write access to the Documents directory, but when I add the App Sandbox capability, I have the following entries for file access: User Selected File Downloads Folder Pictures Folder Music Folder Movies Folder Since the file is a text file, exporting to any of the folders in the list makes no sense. If I give User Selected File read/write access, I still get file permission errors when I export. The UI in Xcode provides no way to add folders to the File Access list. All I want to do is let someone export a file in the folder of their choice. How do I do this with the App Sandbox? UPDATE I'm developing a SwiftUI app. I was using SwiftUI's file exporter to export the document. I took robnotyou's suggestion to use NSSavePanel, but I still get the file permission error, with or witho
10
0
7.2k
Sep ’21
Reply to Enable access to Documents Directory in Xcode 13
What I am trying to do is export a collection of Markdown files into an EPUB book. To create the EPUB book I start by creating a file wrapper that has everything the EPUB needs. I finish by using the ZIPFoundation framework to compress the file wrapper into a valid EPUB/Zip archive. When I finish building the file wrapper, I call the FileWrapper class's write function to temporarily create the file so ZIPFoundation can compress and archive it. do { // mainDirectory is the file wrapper root. wrapperURL is the location to export // from either the file exporter panel or NSSavePanel. try mainDirectory.write(to: wrapperURL, options: [], originalContentsURL: nil) } catch { Swift.print(Error temporarily writing the book's file wrapper to disk. Error: (error)) } When I step through this code in the debugger, it goes to the catch block and prints the following message in the console: Error: Error Domain=NSCocoaErrorDomain Code=513 You don’t have permission to save the file TestBook in the location (path to f
Topic: Code Signing SubTopic: General Tags:
Sep ’21
Reply to dataWithContentsOfURL is nil with url from Files app
Why would my app not have permission to view the document when it's from the files app? Error Domain=NSCocoaErrorDomain Code=257 The file “afile.pdf” couldn’t be opened because you don’t have permission to view it. UserInfo={NSFilePath=/private/var/mobile/Containers/Shared/AppGroup/xxxxxxxx/File Provider Storage/afile.pdf, NSUnderlyingError=0x281f4f150 {Error Domain=NSPOSIXErrorDomain Code=1 Operation not permitted}}
Topic: App & System Services SubTopic: Core OS Tags:
Sep ’21
Reply to Family Controls application-identifier Entitlement error while blocking an application
Hi, Any update on the above issue? I am also trying to block application in the same way but I am getting different error, Attempts remaining: 1 Failed to fetch effective value for com.apple.ManagedSettings.effective-media-settings.changed: Error Domain=NSCocoaErrorDomain Code=4099 The connection to service named com.apple.ManagedSettingsAgent was invalidated: failed at lookup with error 159 - Sandbox restriction. UserInfo={NSDebugDescription=The connection to service named com.apple.ManagedSettingsAgent was invalidated: failed at lookup with error 159 - Sandbox restriction.}``` could you please guide me if I'm missing something?
Topic: Business & Education SubTopic: General Tags:
Sep ’21