Post

Replies

Boosts

Views

Activity

array
I'm using xcode 16.1 withSwift. I want to know how to call a function passing in an array. Also I need to know how to declare the function receiving the array. I currently have: func myfunc(costa: [Double]) { } I call it like this: myfunc(costa:[ ]) It's an array of Doubles. I don't get any errors but the array is always empty. Please help. Thank you.
3
0
95
4d
percentages
I want to know how to format doubles. In the program I have 4.3333 I just want to print 4 to the screen. I just want to print whole numbers. I'm using Swiftui with xcode. Please help. Thank you.
3
0
126
4d
arrays
I'm using xcode 16.1 withSwiftUI. I want to know how to call a function passing in an array. Also I need to know how to declare the function receiving the array. I currently have: func myfunc(costa: [Double] { some code } I call it like this: myfunc(costa:[ ]) It's an array of Doubles. I don't get any errors but the array is always empty even though it's not empty on the sending side. Please help. Thank you.
2
0
151
4d
navigation
I'm using xcode 16.1 with SwiftUI. I have a program that needs another screen. How can I add navigation? All the youtube videos show you how to add navigation to a new program. Is there a video that shows you how to add navigation to an existing program? Any instruction would help. Thanks
2
0
133
1w
format percentages
I'm using XCODE with Swiftui. I want to know how I can format percentages in the program to whole numbers with a % sign without any decimal places to the screen. For instance if the program figures 33.3333 I want to print 33% to the screen. If I have 67.85762 in the program I want to print 67% (or 68% if it can be rounded) to the screen. Please help. Thanks
3
0
163
2w
Checking for NIL
I have a program where the user enters 2 fields with numerics. If they accidently enter a letter the program crashes. How can I check for NIL without making the variable optional. If I make it optional I get an error in the Textfield. How can I test a Textfield for NIL? Please help.
4
0
215
3w
Navigation View
How can I add navigation to an existing program. I coded this as per youtube video: var body: some View { NavigationView { VStack { NavigationLink(destination: viewdetail()) { Text("click") .frame(width: 300, height: 150, alignment: .center) .background(Color.gray) .foregroundColor(.black) } } } It doesn't work. If I comment out the rest of the program it works. I have VStacks and HStacks and functions after the navigation code. Please help.
2
0
169
3w
cocoapods
When I try to install cocoapods I get this error: [!] Oh no, an error occurred. Search for existing GitHub issues similar to yours: https://github.com/CocoaPods/CocoaPods/search?q=dlopen%28%2FLibrary%2FRuby%2FGems%2F2.6.0%2Fgems%2Fffi-1.12.2%2Flib%2Fffi_c.bundle%2C+0x0009%29%3A+tried%3A+%27%2FLibrary%2FRuby%2FGems%2F2.6.0%2Fgems%2Fffi-1.12.2%2Flib%2Fffi_c.bundle%27+%28mach-o+file%2C+but+is+an+incompatible+architecture+%28have+%27x86_64%27%2C+need+%27arm64e%27+or+%27arm64%27%29%29%2C+%27%2FSystem%2FVolumes%2FPreboot%2FCryptexes%2FOS%2FLibrary%2FRuby%2FGems%2F2.6.0%2Fgems%2Fffi-1.12.2%2Flib%2Fffi_c.bundle%27+%28no+such+file%29%2C+%27%2FLibrary%2FRuby%2FGems%2F2.6.0%2Fgems%2Fffi-1.12.2%2Flib%2Fffi_c.bundle%27+%28mach-o+file%2C+but+is+an+incompatible+architecture+%28have+%27x86_64%27%2C+need+%27arm64e%27+or+%27arm64%27%29%29+-+%2FLibrary%2FRuby%2FGems%2F2.6.0%2Fgems%2Fffi-1.12.2%2Flib%2Fffi_c.bundle&type=Issues If none exists, create a ticket, with the template displayed above, on: https://github.com/CocoaPods/CocoaPods/issues/new Be sure to first read the contributing guide for details on how to properly submit a ticket: https://github.com/CocoaPods/CocoaPods/blob/master/CONTRIBUTING.md Don't forget to anonymize any private data! Looking for related issues on cocoapods/cocoapods... Searching for inspections failed: undefined method `map' for nil:NilClass robertsantovasco@iMac L1 demo % I typed "install pod". There's pages of errors above that. Here is my podfile: platform :ios, '9.0' target 'L1 demo' do Comment the next line if you don't want to use dynamic frameworks use_frameworks! pod 'RealmSwift' end Please help. Thank you.
0
0
159
Nov ’24
cd on terminal
When I'm in TERMINAL and I issue the cd command it says no such file or directory. I cut this from the terminal session: Last login: Tue Nov 12 20:10:57 on ttys000 The default interactive shell is now zsh. To update your account to use zsh, please run chsh -s /bin/zsh. For more details, please visit https://support.apple.com/kb/HT208050. iMac:~ robertsantovasco$ cd desktop iMac:desktop robertsantovasco$ cd L1 demo -bash: cd: L1: No such file or directory iMac:desktop robertsantovasco$ cd L1 -bash: cd: L1: No such file or directory iMac:desktop robertsantovasco$ cd L1 demo -bash: cd: L1: No such file or directory iMac:desktop robertsantovasco$ cd / iMac:/ robertsantovasco$ cd desktop -bash: cd: desktop: No such file or directory iMac:/ robertsantovasco$ cd L1 demo -bash: cd: L1: No such file or directory iMac:/ robertsantovasco$ cd L1 demo -bash: cd: L1: No such file or directory iMac:/ robertsantovasco$ cd desktop -bash: cd: desktop: No such file or directory iMac:/ robertsantovasco$ cd desktop -bash: cd: desktop: No such file or directory iMac:/ robertsantovasco$ CD desktop /usr/bin/CD: line 4: cd: desktop: No such file
5
0
315
Nov ’24