gpt4 book ai didi

iOS 在 MFMailComposeViewController 和 SKStoreProductViewController 的 init 方法上崩溃

转载 作者:行者123 更新时间:2023-12-02 00:51:37 31 4
gpt4 key购买 nike

我正在开发一个部署目标为 7.0 的 iOS 应用程序,并且我正在尝试在应用程序中呈现内置 View Controller ,例如 MFMailComposeViewController 和 SKStoreProductViewController。但是,当我初始化任何内置 View Controller 时,我的应用程序就会崩溃,并显示以下错误消息:

[__NSGlobalBlock__ encodeWithCoder:]: unrecognized selector sent to instance 0x57986c

崩溃发生在以下几行中:

MFMailComposeViewController* controller = [[MFMailComposeViewController alloc] init];

SKStoreProductViewController *storeViewController = [[SKStoreProductViewController alloc] init];

我找不到任何线索这个错误来自哪里。我正在使用一些第三方 pod,例如 KeepLayout 和 ReactiveCocoa,其中包含 UIView 元素上的一些类别。不确定这是否是此问题的根源。

这是由 [SLComposeViewController composeViewControllerForServiceType:SLServiceTypeTwitter] 引起的崩溃的堆栈跟踪

0 CoreFoundation 0x103c0d47d __exceptionPreprocess + 141
1 libobjc.A.dylib 0x10396c99e objc_exception_throw + 43
2 CoreFoundation 0x103c9e65d -[NSObject(NSObject) doesNotRecognizeSelector:] + 205
3 CoreFoundation 0x103bfed8d ___forwarding___ + 973
4 CoreFoundation 0x103bfe938 _CF_forwarding_prep_0 + 120
5 Foundation 0x101af43ef _encodeObject + 1150
6 Foundation 0x101af770f +[NSKeyedArchiver archivedDataWithRootObject:] + 162
7 UIKit 0x102cb841c -[_UIAppearanceRecorder _recordInvocation:withClassName:containerClassNames:selectorString:forRemoteProcess:] + 2450
8 UIKit 0x102cb3ff1 __54+[_UIAppearance _recordersExcludingSource:withWindow:]_block_invoke + 838
9 CoreFoundation 0x103c8c10f __65-[__NSDictionaryM enumerateKeysAndObjectsWithOptions:usingBlock:]_block_invoke + 111
10 CoreFoundation 0x103c8c01e -[__NSDictionaryM enumerateKeysAndObjectsWithOptions:usingBlock:] + 206
11 UIKit 0x102cb3c99 +[_UIAppearance _recordersExcludingSource:withWindow:] + 137
12 UIKit 0x102e20c9c UIViewServiceCurrentAppearanceSerializedRepresentations + 77
13 UIKit 0x102d58038 +[_UIRemoteViewController requestViewController:fromServiceWithBundleIdentifier:connectionHandler:] + 197
14 Social 0x102626410 -[SLComposeViewController loadServiceViewControllerWithClassName:fromServiceBundleWithIdentifier:] + 172
15 Social 0x102623ec6 -[SLComposeViewController initWithServiceViewControllerClassName:hostingBundleIdentifer:] + 126
16 Social 0x102623d71 -[SLComposeViewController initWithServiceType:] + 267
17 Social 0x102624130 +[SLComposeViewController composeViewControllerForServiceType:] + 65

最佳答案

您需要将 MessageUI 和 StoreKit 框架添加到您的项目中。 (在构建阶段 -> 将二进制文件与库链接)

关于iOS 在 MFMailComposeViewController 和 SKStoreProductViewController 的 init 方法上崩溃,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/23743055/

31 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com