I'm using xcode 16 with swift. I'm trying to call a function in another file. It used to work. Now I'm getting: Cannot find 'detailline' in scope. Detailline is the function I'm calling. I just added variables to the top. I have since deleted them. Please help.
Post
Replies
Boosts
Views
Activity
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.
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.
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.
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
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
How can I put navigation into an existing program?
I want to print a percentage to the screen. How can I only print 2 decimal places.
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.
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.
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.
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
How do i get a view controller file when I add a new app? I used to get one but now I don't.
When I add a new app I don't get a viewcontroller swift file. The first screen has APP under IOS. It doesn't have single frame app. What happened to swiftcontroller?
I want to set an alarm in my app using the clock app. How can I access the clock app from my IOS app? How can I access any other app if I wanted to?