使用 Xcode 12 界面构建器,我无法将视图拖到滚动视图中。这似乎是一项非常简单的任务,多年来一直运行良好。我不确定我错过了什么。不过,将视图拖到其他视图中效果很好。
每次导航到另一个屏幕时,我都会在控制台中收到此消息:
[Assert] displayModeButtonItem is internally managed and not exposed for DoubleColumn style. Returning an empty, disconnected UIBarButtonItem to fulfill the non-null contract.
Run Code Online (Sandbox Code Playgroud)
目前我在应用程序的入口点设置了导航视图,就像这样
NavigationView {
KeyboardView(matrixVM: matrixVM, isNavigationBarHidden: $isNavigationBarHidden)
.background(Color("background")
.edgesIgnoringSafeArea(.all))
.navigationBarTitle("Workspace")
.navigationBarHidden(self.isNavigationBarHidden)
.onAppear {
self.isNavigationBarHidden = true
}
}
Run Code Online (Sandbox Code Playgroud)
然后在 KeyboardView 里面我有导航链接
NavigationLink(destination: NotebookView(isNavigationBarHidden: $isNavigationBarHidden, saved: matrixVM), label: {
Text("Notebooks")
.font(.system(size: 14, design: .rounded))
.fontWeight(.medium)
.foregroundColor(Color("text"))
.padding(.trailing, 10)
})
Run Code Online (Sandbox Code Playgroud)
在 NotebookView 中,我有一个导航链接列表(每个笔记本链接到其详细信息页面)
ScrollView(showsIndicators: false) {
ForEach(notebooks, id: \.self) { notebook in
NavigationLink(destination: ExpandedSnippet(matrixVM: saved ,notebook: notebook)
.navigationBarTitle("Notebook", displayMode: .inline)) …Run Code Online (Sandbox Code Playgroud) 升级到 Xcode 12 后,我的项目不再为模拟器构建。
我得到的错误是:
ld: in ... /Pods/FirebaseAnalytics/Frameworks/FIRAnalyticsConnector.framework/FIRAnalyticsConnector(
FIRAnalyticsConnector_e321ed8e3db06efc9803f6c008e67a34.o),
building for iOS Simulator, but linking in object file built for iOS, file
'.../Pods/FirebaseAnalytics/Frameworks/FIRAnalyticsConnector.framework/FIRAnalyticsConnector'
for architecture arm64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
Run Code Online (Sandbox Code Playgroud)
一种解决方法是添加arm64到我的项目 > 构建设置 > 排除的架构,但它不会为我的真实设备构建。
我已经尝试清理构建文件夹、更新 pod 文件、重新启动等。
我正在使用:
有任何想法吗?
使用 MapKit 和 SwiftUI(版本 12.0 beta 2 (12A6163b))放大/缩小地图时,终端会生成数百条这样的行:
2020-07-21 21:05:39.310719-0500 MyApp[95733:4195994] [VKDefault] 不可见矩形请求样式 Z
import SwiftUI
import MapKit
@main
struct MapTest: App {
var body: some Scene {
WindowGroup {
MapView()
}
}
}
struct MapView: View {
var body: some View {
Map()
}
}
struct MapView_Previews: PreviewProvider {
static var previews: some View {
MapView()
}
}
struct Map: UIViewRepresentable {
func makeUIView(context: Context) -> MKMapView {
let map = MKMapView()
map.delegate = context.coordinator
return map
}
func …Run Code Online (Sandbox Code Playgroud) 我得到 AppName 的架构 (arm64) 不包括 iPhone 11 Pro 可以执行的架构(英特尔 64 位)。Xcode 12 beta-3 上的错误,
我在架构 x86_64 armv7s arm64 下面设置了
如何解决这个错误?
我已经反复显示下面的日志。 在 MacOS Catalina 版本 10.15.4 中安装 Xcode 12 后发生此崩溃
任何人请帮我解决这个崩溃。
Process: Spotlight [3454]
Path: /Applications/Xcode 12.app/Contents/Developer/Platforms/iPhoneOS.platform/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS.simruntime/Contents/Resources/RuntimeRoot/Applications/Spotlight.app/Spotlight
Identifier: Spotlight
Version: 1.0 (1)
Code Type: X86-64 (Native)
Parent Process: launchd_sim [3294]
Responsible: SimulatorTrampoline [2445]
Date/Time: 2020-09-26 07:23:36.460 +0530
OS Version: Mac OS X 10.15.4 (19E266)
Report Version: 12
Application Specific Information:
dyld: launch, loading dependent libraries
DYLD_SHARED_CACHE_DIR=/Users/jitendra/Library/Developer/CoreSimulator/Caches/dyld/19E266/com.apple.CoreSimulator.SimRuntime.iOS-14-0.18A372
DYLD_ROOT_PATH=/Applications/Xcode 12.app/Contents/Developer/Platforms/iPhoneOS.platform/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS.simruntime/Contents/Resources/RuntimeRoot
Time Awake Since Boot: 1800 seconds
System Integrity Protection: disabled
Crashed Thread: 0
Exception Type: EXC_CRASH (SIGKILL)
Exception Note: EXC_CORPSE_NOTIFY
Termination Reason: …Run Code Online (Sandbox Code Playgroud) 我厌倦了为我的 IOS 应用程序构建一个 macOS 应用程序(Xcode 12,SwifUI)。要从我的网站获取 json 数据,我需要一个获取请求(没有 API 密钥)。我在 medium、hackingwithswift 等上找到了几个样本,但我总是保持相同的错误。
[logging] volume does not support data protection, stripping SQLITE_OPEN_FILEPROTECTION_* flags\
Run Code Online (Sandbox Code Playgroud)
我想知道为什么我只在 macOS 项目上出现这个错误,因为我的 IOS 版本工作正常。
class FetchDeviceInfo: ObservableObject {
@Published var deviceInfo = [DeviceData]()
init() {
let url = "https://yourURL"
let session = URLSession(configuration: .default)
session.dataTask(with: URL(string: url)!) { (data, _, _) in
guard let json = data else{return}
do{
let data = try JSONDecoder().decode([DeviceData].self, from: json)
print(images)
DispatchQueue.main.async {
self.deviceInfo = data
}
}
catch{
print(error.localizedDescription)
} …Run Code Online (Sandbox Code Playgroud) 首先免责声明:我使用 Mac Mini 和 Apple Silicon M1。
由于 Xcode 12 中的已知错误,我在 Excluded Architectures 中设置了 arm64:
链接的框架“XXXXXX”缺少此目标所需的一个或多个架构:arm64。
因为我改变了模拟器的控制台(仅在 iOS 14 中)在启动时打印大量错误,关于错误的哈希模拟器:
[db] LSSchemaConfigureForStore 失败,错误错误域=NSOSStatusErrorDomain 代码=-10817 "(null)" UserInfo={_LSFunction=_LSSchemaConfigureForStore, ExpectedSimulatorHash={length = 32, bytes = 0xc853fe2e 5309ad0b 85774b3404e7df374b3404e7df34b304e7df35c535c5c535c54c535c535c , WrongSimulatorHash={length = 32, bytes = 0x762c6c62 f729dcd9 f2ce6d7b bb9aec8d ... d11ece5a 5fc731a0 }}
还有其他人有这个问题吗?问候。
升级到 Xcode 12.3 时,出现错误:
Building for iOS, but the embedded framework 'opus.framework' was built for iOS + iOS Simulator
Run Code Online (Sandbox Code Playgroud)
但更新前一切正常。