Post

Replies

Boosts

Views

Activity

Reply to IPhone 16 - remove Device Management
Take it back to the store and say they sold you an iPhone that is blocked by this Telia software thing. Demand a brand new replacement, and open it there and then in the store in front of one of their staff. If you have a separate phone (or camera, which you seem to have), record the unboxing. Or, you could do as it says, and contact Telia Customer Service, demanding they remove it, but I wouldn't be 100% satisfied with that solution at all.
Topic: App & System Services SubTopic: General Tags:
Dec ’24
Reply to MAC OS Sequoia 15.2 and Thunderbolt incompatibilities
You're in the wrong place. These are the Developer Forums, where developers of apps for Apple's platforms ask each other for hints and tips on coding. I know you've been on the product support forums, but jumping to these developer forums is a waste of time, and you're just clogging these forums up for everyone else. Have you raised a Feedback report? If not, please do so at https://feedbackassistant.apple.com/ You will get more traction there than a random post on here. Oh, and a few minor things: It's "macOS" not MAC OS" It's "Mac" not "MAC". It's "Mac Pro" not "MAC PRO"
Dec ’24
Reply to Swift/ Swift UI errors.
MyApp likely has something called ContentView() in it. This means that it wants to display the view called ContentView. You seem to have deleted the lines that define ContentView, so you need to put them back: import SwiftUI import AVFoundation struct ContentView: View { var body: some View { Button("Greet me") { let synthesizer = AVSpeechSynthesizer() let utterance = AVSpeechUtterance(string: "Hello World!") synthesizer.speak(utterance) } } }
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Dec ’24
Reply to cannot find in scope
Okay, well, you went ahead anyway. Here's my update: // ContentView.swift import SwiftUI struct ContentView: View { @State private var tipa: [Double] = [] @State private var costa: [Double] = [] @State private var cost = "" @State private var costt: Double? = 0.0 @State private var paidt: Double? = 0.0 @State private var paid = "" @State private var tipp = "" @State private var tipc = "" @State private var tipaa = "" @State private var totalCost = "" @State private var totalTips = "" @State private var totalCash = "" @State private var tipcc = "" @State private var numbc = "" @State private var deletep = 0 @State private var number = 0 @State private var errorMsg = "" var body: some View { GeometryReader { g in NavigationStack { VStack { HStack { // No need to manually pad the date out with spaces, which will never be correct. // Just use an HStack and put a Spacer() in, so it goes: |<.....Spacer().....>Date| Spacer() Text(Date().formatted(date: .numeric, time: .omitted)) .foregroundStyle(Color.black) .fontWeight(.bold) .padding(.trailing, 10) } Text("Driver's Food Delivery") .font(.largeTitle) .fontWeight(.bold) Image("Screenshot 2024") VStack { Spacer() Text(errorMsg) .foregroundStyle(Color.red) // Here, put the text in one Text element, and tell SwiftUI to put it on two lines. // No need for msg/msg2 variables. Text("Enter cost and how much was paid. Enter numbers and one decimal point only, then press Enter.") .foregroundStyle(Color.blue) .lineLimit(2, reservesSpace: true) Spacer() } // Use a Grid to lay out your data; much cleaner, and SwiftUI will keep it in columns for you Grid(alignment: .center, horizontalSpacing: 6, verticalSpacing: 6) { GridRow { Text("Cost") .gridColumnAlignment(.leading) Text("Paid") .gridColumnAlignment(.leading) Text("Tip") .gridColumnAlignment(.trailing) Text("Tip %") .gridColumnAlignment(.trailing) } .font(.headline) GridRow { TextField("Cost", text: $cost) .padding(10) .background(Color.brown) .cornerRadius(12) .frame(width: g.size.width * 0.2) .gridColumnAlignment(.leading) TextField("Paid", text: $paid) .padding(10) .background(Color.brown) .cornerRadius(12) .frame(width: g.size.width * 0.2) .gridColumnAlignment(.leading) Text(tipp) .frame(width: g.size.width * 0.2) .gridColumnAlignment(.trailing) Text(tipc) .frame(width: g.size.width * 0.2) .gridColumnAlignment(.trailing) } } .padding(.vertical, 20) HStack { Button { enterPayment() } label: { Text("Enter") .font(.title2) .padding(10) .background(Color.green) .foregroundStyle(Color.white) .cornerRadius(12) } .padding(.leading, 10) // Keeps it off the edge of the screen NavigationLink(destination: ViewDetail()) { Text("Detail") .font(.title2) .padding(10) .background(Color.blue) .foregroundStyle(Color.white) .cornerRadius(12) } Spacer() // Leaves a gap between the Enter & Detail buttons, and the destructive Delete button Button { delete(costa: &costa, tipa: &tipa, number: &number) } label: { Text("Delete") .font(.title2) .padding(10) .background(Color.red) .foregroundStyle(Color.white) .cornerRadius(12) } .padding(.trailing, 10) // Keeps it off the edge of the screen } Divider() // Nice little divider .padding(.vertical, 20) } VStack { Grid(alignment: .center, horizontalSpacing: 6, verticalSpacing: 6) { GridRow { Text("Avg. Tip") .padding(.horizontal, 20) Text("Tip %") .padding(.horizontal, 20) Text("#") .padding(.horizontal, 20) } .gridColumnAlignment(.center) .font(.title3) GridRow { Text(tipaa) .padding(.horizontal, 20) Text(tipcc) .padding(.horizontal, 20) Text(numbc) .padding(.horizontal, 20) } .gridColumnAlignment(.center) .font(.system(size: 22, weight: .bold)) .foregroundStyle(Color.blue) } Spacer() } VStack { Grid(alignment: .center, horizontalSpacing: 6, verticalSpacing: 6) { GridRow { Text("Total Cost") .padding(.horizontal, 10) Text("Total Tips") .padding(.horizontal, 10) Text("Total Cash") .padding(.horizontal, 10) } .gridColumnAlignment(.center) .font(.title3) GridRow { Text(totalCost) .padding(.horizontal, 10) Text(totalTips) .padding(.horizontal, 10) Text(totalCash) .padding(.horizontal, 10) } .gridColumnAlignment(.center) .font(.system(size: 22, weight: .bold)) .foregroundStyle(Color.blue) } Spacer() } } } } func enterPayment() { var ttips = 0.0 var tcost = 0.0 var tipo = 0.00 costt = Double(cost) paidt = Double(paid) errorMsg = "" if(costt != nil && paidt != nil) { tipo = Double(paid)! - Double(cost)! tipa.append(tipo) costa.append(Double(cost)!) number += 1 numbc = String(number) ttips = (tipa.reduce(0, +)) tcost = (costa.reduce(0, +)) tipaa = (ttips / Double(number)).formatted(.currency(code: "USD")) totalTips = ttips.formatted(.currency(code: "USD")) totalCost = tcost.formatted(.currency(code: "USD")) tipp = tipo.formatted(.currency(code: "USD")) tipc = String(tipo / Double(cost)! * 100) tipc = String(format: "%3.0f%%", Double(tipc)!) tipcc = String(ttips / tcost * 100) tipcc = String(format: "%3.0f%%", Double(tipcc)!) totalCash = (tcost + ttips).formatted(.currency(code: "USD")) } else { errorMsg = "Enter numbers and 1 decimal point only." } } } struct ViewDetail: View { @State var text1: String = "" @State var tip1: String = "" @State var text23: String = "" @State var tip23: String = "" var body: some View { Text(text1) Text(tip1) Text(text23) Text(tip23) } func detailLine(costa: inout [Double], tipa: inout [Double]) { print(costa, tipa) text1 = "125" print("detail") } } func delete(costa: inout [Double], tipa: inout [Double], number: inout Int) { print(costa, tipa) tipa.removeLast() costa.removeLast() number -= 1 print(costa,tipa) } #Preview { ContentView() }
Dec ’24
Reply to cannot find in scope
Don't post the whole program. Aside from the fact it's far too much code and you'll end up posting it over numerous posts, you still haven't mastered the use of the code formatting tool so we won't be able to understand it anyway. Please just reduce your code to the smallest bit possible - remove any formatting that's unnecessary, like fonts and padding etc. - you can add it back later. As @Claude31 was saying, use a Binding to pass values from one View to another, something like this: struct ViewOne: View { @State private var firstNames: [String] = ["Dave", "Geoff", "Bob", "Charlie"] var body: some View { Text("Some text") ViewTwo(firstNames: $firstNames) } } struct ViewTwo: View { @Binding firstNames: [String] var body: some View { firstNames.forEach { name in Text("Current name = '\(name)'") } } } That should display this: Some text Current name = 'Dave' Current name = 'Geoff' Current name = 'Bob' Current name = 'Charlie'
Dec ’24
Reply to Sound not working on iPad 7th generation
You should probably raise this as a bug in the usual way. It won't really get progressed if it's only posted in these Developer Forums. You need to raise each issue you find separately at https://feedbackassistant.apple.com/ You can post the FB numbers here if you want, so that others can link to them. We use these forums to ask for help on coding our apps; not for pointing out bugs in a beta version of the software. Please report bugs in the usual way.
Dec ’24
Reply to Rooted iPhone 15 Pro
You're in the wrong place. This is nothing to do with us. These are the Developer Forums, where developers of apps for Apple's platforms ask each other for hints and tips on coding. Your post is completely irrelevant to these forums, and I have marked it as such. Please don't post such things here again.
Topic: Privacy & Security SubTopic: General Tags:
Dec ’24
Reply to Spotlight doesn't show .html file results
Okay, I'd say raise a bug, then post the FB number here. https://feedbackassistant.apple.com/
Topic: App & System Services SubTopic: General Tags:
Replies
Boosts
Views
Activity
Dec ’24
Reply to Spotlight doesn't show .html file results
Do you get different results if the "Websites" item in Settings > Spotlight is on or off? Perhaps "Websites" is a new option in macOS 15? I can't remember if it was there before, but it might encompass .html files, too.
Topic: App & System Services SubTopic: General Tags:
Replies
Boosts
Views
Activity
Dec ’24
Reply to IPhone 16 - remove Device Management
Take it back to the store and say they sold you an iPhone that is blocked by this Telia software thing. Demand a brand new replacement, and open it there and then in the store in front of one of their staff. If you have a separate phone (or camera, which you seem to have), record the unboxing. Or, you could do as it says, and contact Telia Customer Service, demanding they remove it, but I wouldn't be 100% satisfied with that solution at all.
Topic: App & System Services SubTopic: General Tags:
Replies
Boosts
Views
Activity
Dec ’24
Reply to Swift/ Swift UI errors.
Don't forget to tip your waiter / mark the answer as accepted.
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Replies
Boosts
Views
Activity
Dec ’24
Reply to Image Playground is not working after update !!!
These are the Developer Forums, where developers of apps for Apple's platforms ask each other for hints and tips on coding. Your question is more of a product support one, so I'd suggest you ask it over at the Apple Support Forums. Thanks.
Replies
Boosts
Views
Activity
Dec ’24
Reply to Please support device mirroring with cable and without iCloud login
If you have a suggestion, you should raise it at: https://www.apple.com/feedback/
Topic: Community SubTopic: Apple Developers Tags:
Replies
Boosts
Views
Activity
Dec ’24
Reply to MAC OS Sequoia 15.2 and Thunderbolt incompatibilities
You're in the wrong place. These are the Developer Forums, where developers of apps for Apple's platforms ask each other for hints and tips on coding. I know you've been on the product support forums, but jumping to these developer forums is a waste of time, and you're just clogging these forums up for everyone else. Have you raised a Feedback report? If not, please do so at https://feedbackassistant.apple.com/ You will get more traction there than a random post on here. Oh, and a few minor things: It's "macOS" not MAC OS" It's "Mac" not "MAC". It's "Mac Pro" not "MAC PRO"
Replies
Boosts
Views
Activity
Dec ’24
Reply to I cannot share the sqlite database file.
We need the basics before we can even attempt to help you: How are you trying to share the file? What error(s) are you receiving? Are you doing this inside an app you're developing, and do you need help with the code; or is this more of a generic product support request?
Replies
Boosts
Views
Activity
Dec ’24
Reply to Swift/ Swift UI errors.
MyApp likely has something called ContentView() in it. This means that it wants to display the view called ContentView. You seem to have deleted the lines that define ContentView, so you need to put them back: import SwiftUI import AVFoundation struct ContentView: View { var body: some View { Button("Greet me") { let synthesizer = AVSpeechSynthesizer() let utterance = AVSpeechUtterance(string: "Hello World!") synthesizer.speak(utterance) } } }
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Replies
Boosts
Views
Activity
Dec ’24
Reply to Warnings - Failed to locate resource
I think those are internal to Apple's frameworks so you can ignore them. I've seen the "default.csv" one. However, if they annoy you, you can raise a feedback request to have them silenced. https://feedbackassistant.apple.com/
Replies
Boosts
Views
Activity
Dec ’24
Reply to cannot find in scope
Okay, well, you went ahead anyway. Here's my update: // ContentView.swift import SwiftUI struct ContentView: View { @State private var tipa: [Double] = [] @State private var costa: [Double] = [] @State private var cost = "" @State private var costt: Double? = 0.0 @State private var paidt: Double? = 0.0 @State private var paid = "" @State private var tipp = "" @State private var tipc = "" @State private var tipaa = "" @State private var totalCost = "" @State private var totalTips = "" @State private var totalCash = "" @State private var tipcc = "" @State private var numbc = "" @State private var deletep = 0 @State private var number = 0 @State private var errorMsg = "" var body: some View { GeometryReader { g in NavigationStack { VStack { HStack { // No need to manually pad the date out with spaces, which will never be correct. // Just use an HStack and put a Spacer() in, so it goes: |<.....Spacer().....>Date| Spacer() Text(Date().formatted(date: .numeric, time: .omitted)) .foregroundStyle(Color.black) .fontWeight(.bold) .padding(.trailing, 10) } Text("Driver's Food Delivery") .font(.largeTitle) .fontWeight(.bold) Image("Screenshot 2024") VStack { Spacer() Text(errorMsg) .foregroundStyle(Color.red) // Here, put the text in one Text element, and tell SwiftUI to put it on two lines. // No need for msg/msg2 variables. Text("Enter cost and how much was paid. Enter numbers and one decimal point only, then press Enter.") .foregroundStyle(Color.blue) .lineLimit(2, reservesSpace: true) Spacer() } // Use a Grid to lay out your data; much cleaner, and SwiftUI will keep it in columns for you Grid(alignment: .center, horizontalSpacing: 6, verticalSpacing: 6) { GridRow { Text("Cost") .gridColumnAlignment(.leading) Text("Paid") .gridColumnAlignment(.leading) Text("Tip") .gridColumnAlignment(.trailing) Text("Tip %") .gridColumnAlignment(.trailing) } .font(.headline) GridRow { TextField("Cost", text: $cost) .padding(10) .background(Color.brown) .cornerRadius(12) .frame(width: g.size.width * 0.2) .gridColumnAlignment(.leading) TextField("Paid", text: $paid) .padding(10) .background(Color.brown) .cornerRadius(12) .frame(width: g.size.width * 0.2) .gridColumnAlignment(.leading) Text(tipp) .frame(width: g.size.width * 0.2) .gridColumnAlignment(.trailing) Text(tipc) .frame(width: g.size.width * 0.2) .gridColumnAlignment(.trailing) } } .padding(.vertical, 20) HStack { Button { enterPayment() } label: { Text("Enter") .font(.title2) .padding(10) .background(Color.green) .foregroundStyle(Color.white) .cornerRadius(12) } .padding(.leading, 10) // Keeps it off the edge of the screen NavigationLink(destination: ViewDetail()) { Text("Detail") .font(.title2) .padding(10) .background(Color.blue) .foregroundStyle(Color.white) .cornerRadius(12) } Spacer() // Leaves a gap between the Enter & Detail buttons, and the destructive Delete button Button { delete(costa: &costa, tipa: &tipa, number: &number) } label: { Text("Delete") .font(.title2) .padding(10) .background(Color.red) .foregroundStyle(Color.white) .cornerRadius(12) } .padding(.trailing, 10) // Keeps it off the edge of the screen } Divider() // Nice little divider .padding(.vertical, 20) } VStack { Grid(alignment: .center, horizontalSpacing: 6, verticalSpacing: 6) { GridRow { Text("Avg. Tip") .padding(.horizontal, 20) Text("Tip %") .padding(.horizontal, 20) Text("#") .padding(.horizontal, 20) } .gridColumnAlignment(.center) .font(.title3) GridRow { Text(tipaa) .padding(.horizontal, 20) Text(tipcc) .padding(.horizontal, 20) Text(numbc) .padding(.horizontal, 20) } .gridColumnAlignment(.center) .font(.system(size: 22, weight: .bold)) .foregroundStyle(Color.blue) } Spacer() } VStack { Grid(alignment: .center, horizontalSpacing: 6, verticalSpacing: 6) { GridRow { Text("Total Cost") .padding(.horizontal, 10) Text("Total Tips") .padding(.horizontal, 10) Text("Total Cash") .padding(.horizontal, 10) } .gridColumnAlignment(.center) .font(.title3) GridRow { Text(totalCost) .padding(.horizontal, 10) Text(totalTips) .padding(.horizontal, 10) Text(totalCash) .padding(.horizontal, 10) } .gridColumnAlignment(.center) .font(.system(size: 22, weight: .bold)) .foregroundStyle(Color.blue) } Spacer() } } } } func enterPayment() { var ttips = 0.0 var tcost = 0.0 var tipo = 0.00 costt = Double(cost) paidt = Double(paid) errorMsg = "" if(costt != nil && paidt != nil) { tipo = Double(paid)! - Double(cost)! tipa.append(tipo) costa.append(Double(cost)!) number += 1 numbc = String(number) ttips = (tipa.reduce(0, +)) tcost = (costa.reduce(0, +)) tipaa = (ttips / Double(number)).formatted(.currency(code: "USD")) totalTips = ttips.formatted(.currency(code: "USD")) totalCost = tcost.formatted(.currency(code: "USD")) tipp = tipo.formatted(.currency(code: "USD")) tipc = String(tipo / Double(cost)! * 100) tipc = String(format: "%3.0f%%", Double(tipc)!) tipcc = String(ttips / tcost * 100) tipcc = String(format: "%3.0f%%", Double(tipcc)!) totalCash = (tcost + ttips).formatted(.currency(code: "USD")) } else { errorMsg = "Enter numbers and 1 decimal point only." } } } struct ViewDetail: View { @State var text1: String = "" @State var tip1: String = "" @State var text23: String = "" @State var tip23: String = "" var body: some View { Text(text1) Text(tip1) Text(text23) Text(tip23) } func detailLine(costa: inout [Double], tipa: inout [Double]) { print(costa, tipa) text1 = "125" print("detail") } } func delete(costa: inout [Double], tipa: inout [Double], number: inout Int) { print(costa, tipa) tipa.removeLast() costa.removeLast() number -= 1 print(costa,tipa) } #Preview { ContentView() }
Replies
Boosts
Views
Activity
Dec ’24
Reply to cannot find in scope
Don't post the whole program. Aside from the fact it's far too much code and you'll end up posting it over numerous posts, you still haven't mastered the use of the code formatting tool so we won't be able to understand it anyway. Please just reduce your code to the smallest bit possible - remove any formatting that's unnecessary, like fonts and padding etc. - you can add it back later. As @Claude31 was saying, use a Binding to pass values from one View to another, something like this: struct ViewOne: View { @State private var firstNames: [String] = ["Dave", "Geoff", "Bob", "Charlie"] var body: some View { Text("Some text") ViewTwo(firstNames: $firstNames) } } struct ViewTwo: View { @Binding firstNames: [String] var body: some View { firstNames.forEach { name in Text("Current name = '\(name)'") } } } That should display this: Some text Current name = 'Dave' Current name = 'Geoff' Current name = 'Bob' Current name = 'Charlie'
Replies
Boosts
Views
Activity
Dec ’24
Reply to Sound not working on iPad 7th generation
You should probably raise this as a bug in the usual way. It won't really get progressed if it's only posted in these Developer Forums. You need to raise each issue you find separately at https://feedbackassistant.apple.com/ You can post the FB numbers here if you want, so that others can link to them. We use these forums to ask for help on coding our apps; not for pointing out bugs in a beta version of the software. Please report bugs in the usual way.
Replies
Boosts
Views
Activity
Dec ’24
Reply to Rooted iPhone 15 Pro
You're in the wrong place. This is nothing to do with us. These are the Developer Forums, where developers of apps for Apple's platforms ask each other for hints and tips on coding. Your post is completely irrelevant to these forums, and I have marked it as such. Please don't post such things here again.
Topic: Privacy & Security SubTopic: General Tags:
Replies
Boosts
Views
Activity
Dec ’24