Search results for

DTiPhoneSimulatorErrorDomain Code 2

158,679 results found

Post

Replies

Boosts

Views

Activity

Two document types in SwiftUI?
Documentation of DocumentGroup says: Your app can support multiple document types by adding additional document group scenes: The example has an editor and a viewer, but I need to have two editors. Creating two different DocumentGroup elements seems to work, but then there's only one New Document menu item, which targets the first DocumentGroup. Is there a way to allow the user to choose which document type to create?
2
0
1.5k
Mar ’22
Strange code coverage issue
Xcode 9.3Seeing a very odd issue with code coverage. I have two unit tests which ultimately test every branch in the following init function (put breakpoints to double-check that). Yet code coverage is putting red in the gutter along with a zero next to the lines in the if-blocks.Build is debug and code coverage turned on. I have not seeing the issue in other classes.init(data aData: Data?) { // Function called 482 times during full unit test run index = 0 let theLength : Int if let theData = aData { theLength = theData.count // Code coverage shows zero here and zone is colored red data = theData } else { // Code coverage shows 482 here (which cannot be since the if-block is reached 90%+) theLength = 0 data = Data() } length = theLength }Same exact thing happens for a simple test class. Unit test created two instances, one passing in a 2, the other 3. Breakpoints prove both are hit, yet code coverage not reflecting that:class IIF
7
0
3.5k
Apr ’18
Can you have two separate model containers with SwiftData?
Hello. See the code below. struct ContentView: View { var body: some View { TabView { VehicleTab() .tabItem({ Label(Vehicles, systemImage: car.fill)}) .modelContainer(for: Vehicle.self) TransactionsTab() .tabItem { Label(Transactions, systemImage: dollarsign) } .modelContainer(for: Transaction.self) } } } Using the .modelContainer() in this way seems to be causing some issue. I was under the assumption that this would just create a container for each view. I get the error below in this configuration. If I comment out either one of the .modelContainer() modifiers, it works fine. Query encountered an error: Error Domain=NSCocoaErrorDomain Code=256 The file “default.store” couldn’t be opened. Are you not able to do what I'm doing? Is there a way to have two separate containers?
1
0
629
Apr ’24
Reply to How to display a base64 file
I think at this point you have two options:1. File a bug report containing the PDF file and your code, then submit a developer tech support incident (described here: https://developer.apple.com/support/technical/).2. Post your question somewhere like Stack Overflow where you can post more of your code, any relevant links, and more information.
Topic: Programming Languages SubTopic: Swift Tags:
Dec ’17
2 factor authentication
Some how Apple is reading my number as 1-868-868 followed by my actual number causing me to not be able to receive my authentication code to get back into my account (Apple ID) First they told me it takes 24hrs because I kept requests new code sent over. Now I am told to wait 6 days although I told them the issue was the number stored is not correctly formatted. Although I asked them to fix it or use my other number or email they said nope it automated I have to wait. I was told I will not get back my account cause Apple won’t verify me after 24hrs now I am loosing my Apple account where I pay for editing apps and Apple Music And iCloud yearly without compensation or the ability to use it on another ID. What can I do to get my account back or should I cut my loses.
0
0
227
Jun ’20
WeatherKit - one "request" or two?
I have a Swift app that fetches current conditions and daily forecasts. It is in production and working without issues. My question is whether the fetch I am using counts as a single “request” for usage thresholds, or two (one for current conditions, one for daily forecast)? I need current conditions more often than daily forecast, so if this is counting as two requests, I could refactor the logic to get each separately as needed. But separating the requests would use more quota if the combined fetch counts as a single request. let service = WeatherService() let location = CLLocation(latitude: weatherData.lat, longitude: weatherData.lon) let startOfToday = Calendar.current.startOfDay(for: Date()) let endDate = Calendar.current.date(byAdding: DateComponents(day: 2), to: startOfToday)! let current: CurrentWeather let daily: Forecast (current, daily) = try await service.weather(for: location, including: .current, .daily(startDate: startOfToday, endDate: endDate))
1
0
853
Apr ’24