mrackwitz / MRProgress

Collection of iOS drop-in components to visualize progress
MIT License
2.55k stars 306 forks source link

iOS 8 / Swift / XCode 6 (beta 5) bug in MRMethodCopier.m #55

Closed Jeehut closed 9 years ago

Jeehut commented 9 years ago

I just tried to use MRProgress with a new Swift project I develop and therefore imported all files under the src folder to my project. But when I run the project, I get the following error:

Assertion failure in -[MRMethodCopier copyInstanceMethod:], [...]/MyProject/MRProgress/Utils/MRMethodCopier.m:25
Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'Didn't found method setAnimatingWithStateOfTask: on origin class UIActivityIndicatorView.'

What's wrong here? Am I doing something wrong? If not, it would be great to get compatibility with iOS 8 since it's nearing release.

mrackwitz commented 9 years ago

It seems as you copied and linked the files for AFNetworking support to your project without integrating AFNetworking itself. Either leave the files in the directory src/Support/AFNetworking out, or drop AFNetworking in your project, if you need it.

Jeehut commented 9 years ago

Thank you, but I have AFNetworking added manually within my project as well and even changed the line #import <AFNetworking/AFNetworking.h> to #import "AFNetworking.h in order to get it run.

Removing the Support directory helped though, thanks for that hint.

mrackwitz commented 9 years ago

Ah okay, did you integrated AFNetworking as a static library? Then you probably need to set the linker flag -ObjC for your project to load categories, which you don't reference directly.

Jeehut commented 9 years ago

I just copied the AFNetworking directory to my project as I did with the MRProgress src directory. So no, I haven't integrated AFNetworking as a static library. And using categories everywhere else is working without the -ObjC flag manually set. But as I don't need the AFNetworking Support directory I'm fine.