每当编译我的应用程序时,我都会在 xcode 中看到以下警告消息。
iOS Simulator 部署目标“IPHONEOS_DEPLOYMENT_TARGET”设置为 8.0,但支持的部署目标版本范围为 9.0 到 14.3.99。
谷歌说它在某种程度上与 cocoapods 有关,但我没有使用它们(只是 swift 包)并且我也没有在 xcode 的项目文件列表中看到 pod 文件。
部署目标已设置为 14 -
关于如何摆脱这些消息有什么想法吗?
升级到 Xcode 12 和 iOS 14 后出现问题。
场景:我有一个嵌套的 UITableView:nestedTableView。像下面
class GAllowGestureEventPassTableView: UITableView, UIGestureRecognizerDelegate {
var allowGestureEventPassViews: [UIView] = []
func gestureRecognizer(_ gestureRecognizer: UIGestureRecognizer, shouldRecognizeSimultaneouslyWith otherGestureRecognizer: UIGestureRecognizer) -> Bool {
panGestureRecognizer.cancelsTouchesInView = false
guard let otherView = otherGestureRecognizer.view else { return false }
print("tableView : \(type(of: otherView))")
if allowGestureEventPassViews.contains(otherView) {
print("allowGestureEventPassViews contains : \(type(of: otherView))")
print("gesture pass ")
return true
} else {
return false
}
}
}
Run Code Online (Sandbox Code Playgroud)
然后我将另一个 UITableView 添加到nestedTableView的 allowGestureEventPassViews 数组中。所以我可以控制哪个 tableView 可以滚动。
self.nestedTableView.allowGestureEventPassViews.append(controller.tableView)
Run Code Online (Sandbox Code Playgroud)
在 …
我将 Xcode 升级到 Xcode 12,并构建了我的项目。首先,它出现如下错误:
ld:为 iOS 模拟器构建,但在为 iOS 构建的 dylib 中链接,文件“/Users/ethanli/Documents/Aspira/RA.com4iOS/RA.com4iOS/source/ReserveAmerica/ReserveAmerica4/External/Mapbox/MapboxMobileEvents.framework/MapboxMobileEvents”用于架构 arm64
我通过在 Build Settings 中向 Excluded Architecture 添加“arm64”消除了这个错误。参考 https://developer.apple.com/forums/thread/656509
但是……又出现了一个错误:
错误:无法找到构建输入文件:'/Users/ethanli/Library/Developer/Xcode/DerivedData/ReserveAmerica4-cgnruuknmgycgrbadguodtkwspmy/Build/Products/DEBUG-iphonesimulator/ReserveAmerica4.app/ReserveAmerica4'(在目标 4 'from projectAmerica' ReserveAmerica4')
我去Finder的路径,“ReserveAmerica4”真的不存在。
有没有办法解决这个问题?
我在添加 3rd 方框架后尝试构建一个项目,但是在添加框架后我无法编译该项目,我收到架构 arm64 的未定义符号:尝试在设备上编译时出错,但我可以在模拟器上编译. 我已经尝试了在 stackoverflow 上找到的所有其他解决方案。任何帮助表示赞赏!
这是我尝试过的:
我尝试过的所有解决方案都不适合我。
Undefined symbols for architecture arm64:
"_OBJC_CLASS_$_*", referenced from:
objc-class-ref in frameworkName.o
ld: symbol(s) not found for architecture arm64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
Run Code Online (Sandbox Code Playgroud) 使用 Xcode 12 尝试为我的项目创建 Widget 应用程序扩展。
创建新的 Widget 目标后,我收到以下错误:
'Widget' is annotated with @main and must provide a main static function of type () -> Void or () throws -> Void.
Run Code Online (Sandbox Code Playgroud)
有没有办法ScrollView通过使用更改默认滚动动画ScrollViewReader?
我尝试了不同的东西,但动画仍然是默认的。
withAnimation(.easeInOut(duration: 60)) { // <-- Not working (changes nothing)
proxy.scrollTo(50, anchor: .center)
}
Run Code Online (Sandbox Code Playgroud)
正如你在这里看到的:(显然这比 1 分钟的动画快)
struct ContentView: View {
var body: some View {
ScrollView {
ScrollViewReader { proxy in
Button("Scroll to") {
withAnimation(.easeInOut(duration: 60)) {
proxy.scrollTo(50, anchor: .center)
}
}
ForEach(0..<100) { i in
Rectangle()
.frame(width: 200, height: 100)
.foregroundColor(.green)
.overlay(Text("\(i)").foregroundColor(.white).id(i))
}
.frame(maxWidth: .infinity)
}
}
}
}
Run Code Online (Sandbox Code Playgroud)
也许这还不可能?
谢谢!
我正在使用 Xcode 12.0 和 Carthage 0.35.0,当我这样做Carthage bootstrap --platform iOS或Carthage update --platform iOS --no-use-binaries在我开发的框架上时,我收到此错误。我在 Xcode 11.7 中没有这个问题。
*** Building scheme "MyFrameworkKit" in MyFrameworkKit.xcodeproj
Build Failed
Task failed with exit code 1:
/usr/bin/xcrun lipo -create /Users/myname/Library/Caches/org.carthage.CarthageKit/DerivedData/12.0_12A7209/MyFrameworkKit/579b0a4ac155ab413da1d73609bf5f24e5ed7cc8/Build/Intermediates.noindex/ArchiveIntermediates/MyFrameworkKit/IntermediateBuildFilesPath/UninstalledProducts/iphoneos/MyFrameworkKit.framework/MyFrameworkKit /Users/myname/Library/Caches/org.carthage.CarthageKit/DerivedData/12.0_12A7209/MyFrameworkKit/579b0a4ac155ab413da1d73609bf5f24e5ed7cc8/Build/Products/Release-iphonesimulator/MyFrameworkKit.framework/MyFrameworkKit -output /Users/myname/Developer/myapp/ios/Carthage/Build/iOS/MyFrameworkKit.framework/MyFrameworkKit
This usually indicates that project itself failed to compile. Please check the xcodebuild log for more details: /var/folders/11/tjwvq_yx4mj042kv46mxz1wh0000gn/T/carthage-xcodebuild.gaIzr4.log
Run Code Online (Sandbox Code Playgroud)
当我查看上面提到的日志文件时。我看到构建成功了。但是当我打开 Xcode 并尝试构建应用程序时,我看到了以下消息:/Users/myname/Developer/myapp/ios/myapp.xcodeproj Building for iOS Simulator, but the linked framework 'MyFrameworkKit.framework' was built for iOS.
从 Xcode 11.7 到 …
Xcode 12 有一个新的默认警告,它会在您使用 #import 或 #include"quotes.h"而不是<brackets.h>.
警告:“双引号包含在框架标题中”
你如何关闭整个项目的这个警告?
从详细视图返回后,所选行保持灰色。在模拟器和真实设备上都发生,仅在 iOS 14 上发生。有谁知道如何删除它,使其与 iOS 13 上的行为相同(不保持选中状态)?这是项目中唯一的代码。(没有其他导航或任何东西)。
let items = ["item1", "item2"]
struct ContentView: View {
var body: some View {
NavigationView {
VStack {
Text("Hello")
List(items, id: \.self) { item in
NavigationLink(destination: Text(item)) {
Text(item)
}
}
.listStyle(PlainListStyle())
}
}
// .navigationViewStyle(StackNavigationViewStyle()) // didn't solve the problem
}
}
Run Code Online (Sandbox Code Playgroud)