Invalid redeclaration of ****

后端 未结 2 1527
情书的邮戳
情书的邮戳 2020-12-04 00:27

Note: I\'ve search a lot, such as Invalid redeclaration of UITableViewDataSource method? not apply to my case. For there is no duplicate file or class in m

相关标签:
2条回答
  • 2020-12-04 01:04
    • Go your project root directory->Build phases.
    • Under complied resources, check AppDelegate file is added twice or not.

    If it is added twice, then added one file.

    0 讨论(0)
  • 2020-12-04 01:11

    I add this answer as a supplement of pkc456's answer.

    Both redeclaration and recompile can cause the issue.

    In my code there is no redeclaration, so it's the recompile cause it.

    I go to the Build phases menu, and I found the AppDelegate.swift file added twice there.

    Solution:

    1. Select either of the two AppDelegate.swift file, and click the - to remove it.

    2. Clean and build the project(For Xcode Version 9.3 (9E145) Product->Clean and Product->Build).

    0 讨论(0)
提交回复
热议问题