Post

Replies

Boosts

Views

Activity

cannot find in scope
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" Cannot find 'text1' in scope print("detail") }
38
0
1.7k
Jan ’25
cannot find text1 in scope
import SwiftUI 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" cannot find 'text1' in scope 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 { viewdetail() } Does anyone know why I'm getting "cannot find text1 in scope"?
7
0
334
Dec ’24