标签: xcode12

iOS14 中表格部分标题中的白色背景

使用xcode12构建到iOS14后出现此问题。

我有一个透明背景的部分标题,在 iOS14 上它变成白色,新_UISystemBackgroundView添加到层次结构。

xcode uitableview swift ios14 xcode12

7
推荐指数
2
解决办法
1342
查看次数

带有 XCode 12 和模拟器的崩溃弹出窗口

使用 Xcode 12 和 iOS 模拟器,Xcode 不会崩溃,但这些是我每隔几个小时就会出现的错误,并不总是全部,但总是其中一些

CalendarWidgetAppExtension quit unexpectedly.
parsecd quit unexpectedly.
healthappd quit unexpectedly.
NewsTag quit unexpectedly.
NewsToday2 quit unexpectedly.
bulletindistributord quit unexpectedly.
ProtectedCloudKeySyncing quit unexpectedly.
Run Code Online (Sandbox Code Playgroud)

有人知道这是怎么回事吗?

xcode simulator ios ios-simulator xcode12

7
推荐指数
1
解决办法
458
查看次数

未定义的符号:_OBJC_CLASS_$_FIRApp

我正在尝试使用 Swift 包管理器添加 Firebase Analytic 和 Firebase Crashlytics,这里是 firebase SDK 的 git 链接
https://github.com/firebase/firebase-ios-sdk

之后我在 AppDelegate 文件中添加这两行

#import <FirebaseCore/FIRApp.h>

#import <Firebase.h>

一切都很好,直到我添加此[FIRApp configure];错误

架构arm64的未定义符号:“ OBJC_CLASS $_FIRApp”,引用自:HWOFAppDelegate.o ld中的objc-class-ref:找不到架构arm64 clang的符号:错误:链接器命令失败,退出代码1(使用-v查看调用)

我认为类似问题的堆栈溢出的每个链接都尝试了每个解决方案,但没有什么可以帮助我,比如更改其他链接器标志等...请帮助我..我真的很感激...我在这里使用 Xcode 12.1 和 Objective-C 是我收到的错误的屏幕截图

在此输入图像描述

以及添加依赖项的屏幕截图

在此输入图像描述

objective-c firebase swift-package-manager firebase-analytics xcode12

7
推荐指数
1
解决办法
3万
查看次数

升级到 XCode12.5 后不再构建 React Native App

我的本机应用程序之前在 xcode 11 中构建并在模拟器上运行。但是,自从升级到 xcode 12.5 后,我收到以下构建错误

Cannot initialize a parameter of type 'NSArray<id<RCTBridgeModule>> *' with an rvalue of type 'NSArray<Class>*'

Cannot initialize a parameter of type 'NSArray<Class> *' with an lvalue of type 'NSArray<id<RCTBridgeModule>> *__strong'

Cannot initialize a parameter of type 'NSArray<id<RCTBridgeModule>> *' with an lvalue of type 'NSArray<Class> *__strong'
Run Code Online (Sandbox Code Playgroud)

这些错误来自我的项目中通过 cocoapods 的 react-core。

xcode react-native xcode12

7
推荐指数
1
解决办法
1139
查看次数

无法在 Catalina 上安装 cocoapods

我有 catalina OS 10.15.7 和 XCode 版本 12.4 (12D4e) 我正在尝试使用 gem 安装 cocoapods:

sudo gem install cocoapods
Run Code Online (Sandbox Code Playgroud)

我收到此错误:

ERROR:  While executing gem ... (Gem::FilePermissionError)
    You don't have write permissions for the /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/gems/2.6.0 directory.
Run Code Online (Sandbox Code Playgroud)

解决这个问题真是一场噩梦。我尝试使用brew install。Brew 能够安装它。但吊舱不起作用。当我使用简单的命令时,例如

pod init
or 
pod -v
Run Code Online (Sandbox Code Playgroud)

我收到此错误:

Traceback (most recent call last):
    16: from /usr/local/Cellar/cocoapods/1.11.2_1/libexec/bin/pod:23:in `<main>'
    15: from /Library/Ruby/Site/2.6.0/rubygems.rb:285:in `activate_bin_path'
    14: from /Library/Ruby/Site/2.6.0/rubygems.rb:285:in `synchronize'
    13: from /Library/Ruby/Site/2.6.0/rubygems.rb:286:in `block in activate_bin_path'
    12: from /Library/Ruby/Site/2.6.0/rubygems/specification.rb:1369:in `activate'
    11: from /Library/Ruby/Site/2.6.0/rubygems/specification.rb:1387:in `activate_dependencies'
    10: from /Library/Ruby/Site/2.6.0/rubygems/specification.rb:1387:in `each'
     9: from /Library/Ruby/Site/2.6.0/rubygems/specification.rb:1405:in …
Run Code Online (Sandbox Code Playgroud)

macos xcode cocoapods macos-catalina xcode12

7
推荐指数
2
解决办法
4918
查看次数

SwiftUI SignInWithAppleButton 挂起

我正在尝试使用 SwiftUI 实现使用 Apple 登录,但在我输入正确的密码后它挂起。

我正在使用真实用户和模拟器以及 XCode 12.0 Beta。不幸的是,我现在没有可供测试的设备。我也尝试过沙盒用户,但没有成功。

我已将使用 Apple 功能的登录添加到配置文件中

永远不会达到成功的打印语句。

我错过了什么?

用户界面

使用https://developer.apple.com/documentation/swiftui/signinwithapplebutton 中的示例代码

import SwiftUI
import AuthenticationServices

struct SignInView: View {
    var body: some View {
        VStack {
            SignInWithAppleButton(
                .signIn,
                onRequest: { request in
                    request.requestedScopes = [.fullName]
                },
                onCompletion: { result in
                    switch result {
                    case .success (let authResults):
                        print("rhe01 Authorization successful.")
                    case .failure (let error):
                        print("rhe01 Authorization failed: " + error.localizedDescription)
                    }
                }
            )
        }
    }
}
Run Code Online (Sandbox Code Playgroud)

swift swiftui apple-sign-in xcode12

6
推荐指数
1
解决办法
588
查看次数

如何处理 Swift 包的依赖工件校验和?

使用 Xcode 12 beta 和 swift-tools-version 5.3,您可以链接到一个框架,如下所示:

        .binaryTarget(
            name: "Stripe",
            url: "https://github.com/stripe/stripe-ios/releases/download/v19.3.0/Stripe.xcframework.zip",
            checksum: "fe459dd443beee5140018388fd6933e09b8787d5b473ec9c2234d75ff0d968bd"
        )
Run Code Online (Sandbox Code Playgroud)

但是当我需要更新校验和(我错了)时,我得到了

: artifact of binary target 'Stripe' has changed checksum; this is a potential security risk so the new artifact won't be downloaded

Run Code Online (Sandbox Code Playgroud)

当我需要更改校验和时,如何重置或覆盖它?

xcode swift-package-manager xcode12

6
推荐指数
1
解决办法
1244
查看次数

为什么当放在 swiftUI 中的 NavigationView 内的元素上时 onAppear() 执行两次?(Xcode 12.0)

FirstView Appeared打印两次。首次加载视图时一次,选择 NavigationLink 时再次加载。

import SwiftUI

struct FirstView: View {
    
    var body: some View {
        NavigationView{
            ZStack{
                Text("FirstView").onAppear(perform: {print("FirstView Appeared")})
                
                NavigationLink(destination: SecondView()) {
                    Text("Goto SecondView")
                }.offset(y: 50)
            }
        }
    }
}

struct SecondView: View {
    
    var body: some View {

        Text("SecondView").onAppear(perform: {print("SecondView Appeared")})
    }
}
Run Code Online (Sandbox Code Playgroud)

在模拟器和个人设备上运行上面的代码在Xcode 12.0 beta中,在选择NavigationLink时,在下面的Xcode 12.0 Beta中会产生下面的输出:

FirstView Appeared
FirstView Appeared
SecondView Appeared
Run Code Online (Sandbox Code Playgroud)

这是 onAppear() 预期行为的重复吗?

如果是这样,有什么最佳实践可以在firstview创建时加载一些数据,然后返回到firstview(因为 onAppear() 会在导航离开时尝试加载一些数据firstView)

navigation swiftui swiftui-navigationlink xcode12

6
推荐指数
1
解决办法
814
查看次数

Xcode 12:面板中的环境覆盖设置未反映在模拟器上

我关注了一个关于 iOS 14 新东西的 YouTube 视频。现在我们可以通过面板设置环境覆盖。但是我发现像 Text Dynamic 类型这样的变化并没有反映在 iOS 模拟器上。找了一圈,很新,没找到相关资料。有没有人在这里遇到过同样的问题,如何解决?

有一个警告“2020-07-18 11:46:25.479202+0800 SwiftUITest[32945:888273] libMobileGestalt MobileGestaltCache.c:38: No persisted cache on this platform.” 在控制台中。不确定是否相关。

在此处输入图片说明

MacOS: 10.15.6 Beta (19G71a)

Xcode: 12.0 beta 2 (12A6163b)

import SwiftUI

struct ContentView: View {
    
    @State private var text = "Hello, world!"
    
    var body: some View {
        TextEditor(text: $text)
            .padding()
            .foregroundColor(.blue)
            .font(.custom("Georgia", size: 24, relativeTo: .largeTitle))
    }
}

struct ContentView_Previews: PreviewProvider {
    static var previews: some View {
        ContentView()
    }
}
Run Code Online (Sandbox Code Playgroud)

environment xcode12

6
推荐指数
0
解决办法
794
查看次数

CoreData 对成员“id”Xcode 12 的不明确引用

我有一个属性 id 为 String 类型的 coredata 实体

尝试从关键路径引用该属性时会引发错误

let path = #keyPath(User.id) //Ambiguous reference to member 'id'
Run Code Online (Sandbox Code Playgroud)

代码生成器设置为类定义。

我试图检查类的生成文件,我发现实体类现在确认Identifiable需要id

我注意到将部署目标设置为低于 iOS 13 的任何内容都会解决这个问题(但我不想这样做)

Xcode 12.0 测试版 4 (12A8179i)

有没有办法在不禁用代码生成或更改部署目标的情况下解决这个问题?

core-data ios codegen swift xcode12

6
推荐指数
1
解决办法
519
查看次数