Post

Replies

Boosts

Views

Activity

Reply to cannot find in scope
Fist problem is that func detailLine(costa: inout [Double], tipa: inout [Double]) { is never called how should it get costa and tips ? When do you want to call ? When you tap Detail ? If so, here is the fix, but I do not understand the logic here: struct ViewDetail: View { @State var text1: String = "" @State var tip1: String = "" @State var text23: String = "" @State var tip23: String = "" var body: some View { HStack { Text(text1) Text(tip1) Text(text23) Text(tip23) } .onAppear { text1 = "125" } } func detailLine(costa: inout [Double], tipa: inout [Double]) { // NEVER Called print(costa, tipa) text1 = "125" print("detail") } } Second problem How do you want to use text1 in ContentView ? It never appears. If you want, here is how to do with Binding Thrid problem in: func delete(costa: inout [Double], tipa: inout [Double], number: inout Int) { print(costa, tipa) tipa.removeLast() // Crash here as tipa is empty There is a simple fix: func delete(costa: inout [Double], tipa: inout [Double], number: inout Int) { print(costa, tipa) if !tipa.isEmpty && !costa.isEmpty { tipa.removeLast() costa.removeLast() number -= 1 } print(costa,tipa) } The complete code in next post.
Dec ’24
Reply to cannot find in scope
Did you try with the simple text1 ? As you keep posting only bits and pieces, it is impossible to understand what you are doing.   AnotherView a function? No, it is a View, like ViewDetail   Let me explain. The user(driver) enters the cost of the delivery and the amount he got paid. The program(enterp) figures out the tip, tip %, average tip, total costs, total tips, total tip % and total cash and writes it out to the screen. Using detailLine I want to print all deliveries(up to 44) and tips to the second screen. I hope this helps. No, it does not help. What would help would be to see the complete main view, with all the var declarations, all the func inside.   Can you rewrite what you wrote with more detail? No as long as you do not provide complete code as requested several time. We see nowhere a call to display ViewDetail. Where is it ? A last advice: you should start by learning SwiftUI and Swift. Looks like you are rushing to coding. That's a dead end.
Dec ’24
Reply to cannot find in scope
It is very simple so. Let's assume the view that contains enterp() is called AnotherView. Then, in AnotherView define a Binding @Binding var text1ForUpdate: String // To make it easier to understand, I've not named it text1, but you could declare detailLine inside AnotherView somewhere in ViewDetail you call AnotherView pass the text1 as parameter: AnotherView(text1ForUpdate: $text1) Change ne name in detailLine func: text1ForUpdate = "125" Tell if that works now.
Dec ’24
Reply to cannot find text1 in scope
I was asked to send the code where I call detailLine. I did that but I never got the answer. I'm still waiting. Please answer. If I remember well, I did answer (https://developer.apple.com/forums/thread/771287) that the code was not enough. Where do you call enterp() ? We need to understand how the whole code works. As you have multiple posts about essentially the same question, that makes things harder to track.
Dec ’24
Reply to cannot find text1 in scope
If I remember, you have already asked the same question several time. And it seems you have not read the answers. You should learn more about Swift to understand the basic principles. In Swift, an object has a visibility scope: it is visible inside the block where it is defined. In your case, detailLine is declared outside viewdetail (should be written ViewDetail according to Swift naming conventions). As text1 is declared inside ViewDetail, it is not visible in detailLine. Once again, please post complete code so that we understand what you want to do. It seems the architecture of your code has several issues.
Dec ’24
Reply to TOOOO LONG WAITING FOR REVIEW
Yelling in uppercase has rarely speeded things up… Did you notice the warning in Appstore Connect that reviews could suffer delays in the Dec 23 to 26 period ? Did you take care of it ? I fear you just experienced it. But it should now (27) resume a normal speed. Note that this forum is not a channel to Apple. You should have used developers support link.
Topic: App & System Services SubTopic: General Tags:
Dec ’24
Reply to App Settings Not Appearing with Xcode 16.2
I create a project (just with template code) in SwiftUI . I have the same problem when testing in iOS 18 simulator. Nothing shows in Settings in the Apps category. Testing on iOS 17.4 simulator works OK. There are definitely issues in iOS 18: https://forums.developer.apple.com/forums/thread/764519 I tried to remove some entry keys (Group), to no avail. Another problem here. If I create a project (just with template code) in SwiftUI with Xcode 16.2 (MacOS 14.7.2), and try to open with Xcode 15.3, it crashes at the opening of the project Note: problem shows also for UIKit apps: settings show in iOS 18.1, but no setting, for any app, in iOS 18.2. As described here: https://developer.apple.com/forums/thread/748785 You should file a bug report.
Topic: App & System Services SubTopic: General Tags:
Dec ’24
Reply to Is Settings.bundle deprecated? What required-reason API code to use?
There seem to be several issues with Settings Bundle in iOS 18.2. They do not appear anymore in the Apps settings in iOS Settings, as exposed here: https://developer.apple.com/forums/thread/771470 https://developer.apple.com/forums/thread/764519 So, if it is not deprecated, what could be the reason for not to work, when it worked in iOS 17.4 ? I also tested for an existing app (published on Appstore). It is a UIKit app. In iOS 18.1 simulator, I see the settings of a lot of apps. In iOS 18.2, not a single app setting. That is a really serious issue.
Topic: App & System Services SubTopic: Core OS Tags:
Dec ’24