"unrecognized selector sent to instance" error on device

I got a project that include another static library sub-project. Today as customer's requirement, I remove the sub-project and replace it with the universal library. It can be run on simulator as before, but while run on device, it raise the error as title.

Checking the linker flag(-ObjC -all_load) and search path of header and lib. All is OK, Both projects r ARC mode. The key point is project can run on simulator successfully.

Finally I find that it resolved by removing all lib and app in the build path. XCode may link the old lib in build path. Since the sub-project has been removed, clearn project operation won't remove the previous lib in build path any more.

猜你喜欢

转载自shappy1978.iteye.com/blog/1940953