xcode

Cannot link any C program with gcc on Mac Mojave

ε祈祈猫儿з 提交于 2021-01-06 04:06:20
问题 I've just updated to OSX 10.14.6 (Mojave) and now, after upgrading Xcode and migrating MacPorts, even the simplest C program will not link with any gcc version. For example, linking the program int main() {} gives: dcs16> gcc test.c ld: library not found for -lSystem collect2: error: ld returned 1 exit status I am using gcc 6.5 in /opt/local/bin: dcs16> gcc --version gcc (MacPorts gcc6 6.5.0_4) 6.5.0 The Xcode version is 11.0 and I have installed the package (which was recommended for solving

JavaCPP builds failing on macOS after Xcode 12.2 update due to missing JavaVM framework

こ雲淡風輕ζ 提交于 2021-01-05 11:25:33
问题 I recently updated to Xcode version 12.2 from 12.1. My maven build of a javacpp project began failing at that point on the clang++ step the following command and error: clang++ -I/Users/<username>/git/<product>-javacpp/src/main/cpp -I/usr/local/include -I/Library/Java/JavaVirtualMachines/jdk-14.0.2.jdk/Contents/Home/include -I/Library/Java/JavaVirtualMachines/jdk-14.0.2.jdk/Contents/Home/include/darwin /Users/<username>/git/<product>-javacpp/target/classes/com/<product>/javacpp/video/ffmpeg

How to fix multiple SwiftUI previews for text

谁都会走 提交于 2021-01-05 11:05:37
问题 I am working with SwiftUI and wrote the following example to present an issue I'm experiencing. When I add multiple Buttons, or multiple Texts, it creates two separate previews, but when I run the application on a device they load simultaneously. Attached here is a photo: I cleaned my build folder, restarted my computer, and tried this on various other SwiftUI files but no success. Any ideas? 回答1: You'll need to put both Text s in a VStack or similar. struct ContentView: View { var body: some

How to fix multiple SwiftUI previews for text

强颜欢笑 提交于 2021-01-05 11:05:03
问题 I am working with SwiftUI and wrote the following example to present an issue I'm experiencing. When I add multiple Buttons, or multiple Texts, it creates two separate previews, but when I run the application on a device they load simultaneously. Attached here is a photo: I cleaned my build folder, restarted my computer, and tried this on various other SwiftUI files but no success. Any ideas? 回答1: You'll need to put both Text s in a VStack or similar. struct ContentView: View { var body: some

Xcode ScrollView doesn't scroll

依然范特西╮ 提交于 2021-01-05 09:12:26
问题 I'm trying to implement scrollview using latest xcode. I have content that reaches 'out of bounds' and when I run the simulator, I'm unable to scroll down to see the rest of my content. My hierarchy / constraints are as follows.. Are there constraints you need to have on the subviews within the 'contentViiew' ? I don't have additional code in my view controller that manipulates the scrollview. using Xcode -v 11 & Swift -v 5 <- if this makes a difference 回答1: Please clear all constraints on

Changing the colour of specific list elements SwiftUI

自作多情 提交于 2021-01-05 09:12:23
问题 I have a list of 'players' in my app, and I want to some of them to have a different background colour depending on their properties. Every Player object has a .active property that is either true or false. Depending on this value I want the background of that row to be a light grey rather than the white of the others. How would I do this? I was hoping it would be as simple as: List(homeTeam.players) {player in HStack{ Text("\(player.shirtNumber) - \(player.playerName)") Spacer() Text("\

Changing the colour of specific list elements SwiftUI

守給你的承諾、 提交于 2021-01-05 09:12:06
问题 I have a list of 'players' in my app, and I want to some of them to have a different background colour depending on their properties. Every Player object has a .active property that is either true or false. Depending on this value I want the background of that row to be a light grey rather than the white of the others. How would I do this? I was hoping it would be as simple as: List(homeTeam.players) {player in HStack{ Text("\(player.shirtNumber) - \(player.playerName)") Spacer() Text("\

Changing the colour of specific list elements SwiftUI

梦想的初衷 提交于 2021-01-05 09:11:42
问题 I have a list of 'players' in my app, and I want to some of them to have a different background colour depending on their properties. Every Player object has a .active property that is either true or false. Depending on this value I want the background of that row to be a light grey rather than the white of the others. How would I do this? I was hoping it would be as simple as: List(homeTeam.players) {player in HStack{ Text("\(player.shirtNumber) - \(player.playerName)") Spacer() Text("\

Changing the colour of specific list elements SwiftUI

為{幸葍}努か 提交于 2021-01-05 09:11:38
问题 I have a list of 'players' in my app, and I want to some of them to have a different background colour depending on their properties. Every Player object has a .active property that is either true or false. Depending on this value I want the background of that row to be a light grey rather than the white of the others. How would I do this? I was hoping it would be as simple as: List(homeTeam.players) {player in HStack{ Text("\(player.shirtNumber) - \(player.playerName)") Spacer() Text("\

Write unit tests for ObservableObject ViewModels with Published results

北城以北 提交于 2021-01-05 07:23:25
问题 Today again one combine problem I currently run in and I hope that someone of you can help. How can normal unit tests be written for ObservableObjects classes which contain @Published attributes? How can I subscribe in my test to them to get the result object which I can assert? The injected mock for the web service works correctly, loadProducts() function set exactly the same elements from the mock in the fetchedProducts array. But I don't know currently how to access this array in my test