When using the new Xcode 11 beta. I'm getting the following crash while running my app that uses MapKit. Xcode 10 works fine. Also creating a new project and adding a Map with Mapkit works fine.
A simple web search doesn't yield anything.
Any clues where to look to solve this problem?
Xcode 11 beta 1:
dyld: Symbol not found: _NavigationConfig_MapLocalizeLabels
Referenced from: /Applications/Xcode-beta.app/Contents/Developer/Platforms/iPhoneOS.platform/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS.simruntime/Contents/Resources/RuntimeRoot/System/Library/Frameworks/MapKit.framework/MapKit
Expected in: /Users/Teameh/Library/Developer/Xcode/DerivedData/MyApp-dejdjcwzzweszweqllhjxqbarbsp/Build/Products/Debug-iphonesimulator/Navigation.framework/Navigation
in /Applications/Xcode-beta.app/Contents/Developer/Platforms/iPhoneOS.platform/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS.simruntime/Contents/Resources/RuntimeRoot/System/Library/Frameworks/MapKit.framework/MapKit
Run Code Online (Sandbox Code Playgroud)
Xcode 11 beta 3:
dyld: Symbol not found: _NavigationConfig_MapLocalizeLabels
Referenced from: …Run Code Online (Sandbox Code Playgroud) 我有一台运行MacOS high sierra 10.13.6的Mac于2011年初。我的Mac无法升级到更高的MacOS版本。
我需要安装XCode 11才能利用SwiftUI。
此答案适用于XCode 10.2,但不适用于XCode 11。
那么我可以在MacOS High Sierra 10.13.6上安装XCode11吗?
我已经安装了 Xcode 11,正如苹果在https://developer.apple.com/tutorials/swiftui/creating-and-combining-views链接中所建议的,我打开了对象库,但只有三个选项,一个用于代码片段,第二个用于媒体,第三个是颜色,但在右上角的 + 图标中看不到对象库
1)尝试按照苹果的建议打开对象库。
请看这个截图
应该显示对象库
好的。我知道这不应该是火箭科学。我似乎无法使用暗模式,并且已经阅读了几次文档。希望有人可以找出我所缺少的。
我的内容视图如下所示:
struct ContentView : View {
var body: some View {
VStack {
Text("Hello World")
Text("Yo yo yo")
.color(Color("darkModeColor"))
}
}
Run Code Online (Sandbox Code Playgroud)
}
无论我做什么,当它应该呈现青色时,颜色始终是“ Any”外观。
我知道暗模式本身可以工作,因为苹果提供的所有系统语义颜色都可以正常工作,因为您可以看到“ Hello World”文本变为白色。
有什么想法我所缺少的吗?还是其他人遇到了Xcode 11 Beta 1的问题?
当我在SwiftUI中创建视图并在Xcode预览中使用渲染时PreviewLayout.sizeThatFits,预览会根据其内容调整其大小。当我使用导入UIKIt视图时UIViewRepresentable,它会显示完整的设备尺寸框架。
有没有一种方法,使SwiftUI尊重intrinsicContentSize的UIView子类?
struct Label: UIViewRepresentable {
func makeUIView(context: UIViewRepresentableContext<Label>) -> UILabel {
return UILabel()
}
func updateUIView(_ uiView: UILabel, context: UIViewRepresentableContext<Label>) {
uiView.text = "Some text"
}
}
#if DEBUG
struct Label_Previews: PreviewProvider {
static var previews: some View {
Group {
Label().previewLayout(.sizeThatFits)
}
}
}
#endif
Run Code Online (Sandbox Code Playgroud) 我已将应用程序目标更改为 IOS 13 以检查应用程序中已弃用的方法,但收到以下警告:
“UIApplicationDidChangeStatusBarOrientationNotification”已弃用:首先在 iOS 13.0 中弃用 - 使用 viewWillTransitionToSize:withTransitionCoordinator: 代替。
这是我在我的项目中实现的代码。
- (instancetype)init
{
self = [super init];
if (self) {
[[NSNotificationCenter defaultCenter] addObserver:self
selector:@selector(onChangeStatusBarOrientationNotification:)
name:UIApplicationDidChangeStatusBarOrientationNotification
object:nil];
}
return self;
}
Run Code Online (Sandbox Code Playgroud)
请向我建议 ios 12 和 ios 13 的解决方案。
提前致谢。
我收到错误消息:“ playbackState”仅在iOS 13.0或更高版本中可用
但MPNowPlayingInfoCenter.playbackState已在我的iOS 11应用中使用。
这是iOS 13的问题?我现在可以处理吗?
在iOS11中:
@available(iOS 5.0, *)
open class MPNowPlayingInfoCenter : NSObject {
open class func `default`() -> MPNowPlayingInfoCenter
open var nowPlayingInfo: [String : Any]?
open var playbackState: MPNowPlayingPlaybackState
}
Run Code Online (Sandbox Code Playgroud)
现在在iOS 13中:
@available(iOS 5.0, *)
open class MPNowPlayingInfoCenter : NSObject {
open class func `default`() -> MPNowPlayingInfoCenter
open var nowPlayingInfo: [String : Any]?
@available(iOS 13.0, *)
open var playbackState: MPNowPlayingPlaybackState
}
Run Code Online (Sandbox Code Playgroud) 我尝试在iOS13 Beta上测试应用。当我在欢迎屏幕上点击按钮以选择另一个屏幕时,应用程序冻结,然后终止。当我在Xcode 11中进行调试时,我在控制台日志中看到以下警告行
[framework] CoreUI: RunTimeThemeRefForBundleIdentifierAndName() couldn't find Assets.car in bundle with identifier: '(null)'
[framework] CoreUI: RunTimeThemeRefForBundleIdentifierAndName() couldn't find Assets.car in bundle with identifier: '(null)'
Run Code Online (Sandbox Code Playgroud)
然后几秒钟后,应用程序终止并显示日志条目:
Message from debugger: Terminated due to memory issue
Run Code Online (Sandbox Code Playgroud)
在iOS 12上没有这样的问题。我用几个资产文件创建了简单的测试应用程序,并在单击按钮时进行筛选工作正常。我也将目标版本更改为iOS 13,更改了包标识符,进行了清理和重建-但问题并没有消失
由于我已更新到Xcode 11,因此我的应用中的插页式广告将不再加载。(在一切正常之前。该应用程序甚至已在App Store上发布。我们现在正在创建该应用程序的更新版本)
我通过Cocoapods安装了Google AdMobs SDK,并将其更新为最新版本。仍然没有成功。(我遵循了Google教程的所有步骤,即如何实施插页式广告。)以下是我从控制台收到的错误消息:
2019-10-10 21:42:35.543249+0100 BuszZer[76592:876619] <Google> To get test ads on this device, set: request.testDevices = @[ kGADSimulatorID ];
2019-10-10 21:42:35.599222+0100 BuszZer[76592:876796] [Client] Updating selectors failed with: Error Domain=NSCocoaErrorDomain Code=4099 "The connection to service on pid 0 named com.apple.commcenter.coretelephony.xpc was invalidated." UserInfo={NSDebugDescription=The connection to service on pid 0 named com.apple.commcenter.coretelephony.xpc was invalidated.}
2019-10-10 21:42:35.599426+0100 BuszZer[76592:876796] [Client] Updating selectors after delegate addition failed with: Error Domain=NSCocoaErrorDomain Code=4099 "The connection to service on pid 0 named com.apple.commcenter.coretelephony.xpc was …Run Code Online (Sandbox Code Playgroud) I recently updated to macOS Catalina so I could update some of my apps with Mac support using Catalyst. Whenever I run the app and it tries to access the CloudKit data (I use CloudKit to sync Core Data, Data if an iCloud Account is available), it then crashes with the following error. [User Defaults] Couldn't write values for keys (
ApplicationAccessibilityEnabled
) in CFPrefsPlistSource<0x600002c07700> (Domain: com.apple.Accessibility, User: kCFPreferencesCurrentUser, ByHost: No, Container: (null), Contents Need Refresh: Yes): setting preferences outside …