Invalid redeclaration of ****

后端 未结 2 1614
情书的邮戳
情书的邮戳 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: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).

提交回复
热议问题