gpt4 book ai didi

swift - 与 NavigationControllerDelegate 的冗余一致性

转载 作者:行者123 更新时间:2023-11-28 06:16:55 24 4
gpt4 key购买 nike

我有一个错误说 Redundant Conformance to Protocol UINavigationControllerDelegate

所以这是我的独立代码。

class DelegateProfileViewController: FormViewController, MFMailComposeViewControllerDelegate, UINavigationControllerDelegate  {


class ChatViewController: JSQMessagesViewController, UIActionSheetDelegate, UIImagePickerControllerDelegate,
UINavigationControllerDelegate {


class EditSubGroupViewController: FormViewController, SelectUsersFromSubGroupDelegate, SelectSingleFromSubGroupDelegate, UIImagePickerControllerDelegate, UINavigationControllerDelegate {



extension CreateEngagementViewController: UIImagePickerControllerDelegate, UINavigationControllerDelegate {


class FeedViewController: UITableViewController, UIImagePickerControllerDelegate, UINavigationControllerDelegate, DZNEmptyDataSetSource, DZNEmptyDataSetDelegate, UITextFieldDelegate {

你明白了。这些错误中的每一个都会出现 Redundant Conformance of BLANK to protocol UINavigationControllerDelegate。

如果有人能告诉我为什么这些错误会破坏我的项目,我会很高兴。谢谢

最佳答案

如果子类声明符合已从父类(super class)继承的协议(protocol),您将收到该错误消息

举个例子:如果在你的情况下 FormViewController 已经符合 UINavigationControllerDelegate

class FormViewController: UINavigationControllerDelegate

那么就不需要通过这样做再次符合它:-

class DelegateProfileViewController: FormViewController, MFMailComposeViewControllerDelegate, UINavigationControllerDelegate

应该改为:-

class DelegateProfileViewController: FormViewController, MFMailComposeViewControllerDelegate

这将删除您的冗余一致性。希望您明白我在说什么。

关于swift - 与 NavigationControllerDelegate 的冗余一致性,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/44856466/

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