1

I maintain my 3rd party libs with cocoapods. But recently I found some bugs and would like to add some new features to one of the libs so I manually created some .h and .m files in one of the libs.

However when importing those added .h files, Xcode gave the file not found error and couldn't compile them.

How can I solve the problem?

Thanks.

bolizhou
  • 1,208
  • 1
  • 13
  • 31
  • possible duplicate of [iOS - Build fails with CocoaPods cannot find header files](http://stackoverflow.com/questions/12002905/ios-build-fails-with-cocoapods-cannot-find-header-files) – xianritchie Jul 10 '15 at 03:35

1 Answers1

0

When integrating the Pods into your project, CocoaPods generates libraries that cannot be easily modified from Xcode. If you're having CocoaPods build frameworks, instead, those cannot be modified at all. You usually have to rerun pod install or pod update to let CocoaPods regenerate them if you add files to a Pod.

If you want to reliably add files to a Pod, you should checkout a copy on your machine, somewhere NOT in you project's folder and use something like the following to tell CocoaPods that that one Pod is one you're developing and therefore should integrate differently:

pod MyPod, :path => 'path/to/MyPod.podspec'

Still, even in this case, if you add files to the Pod, although it's easier to add them from Xcode, you might want to rerun the pod command line tool to have CocoaPods reintegrate your pod. However, in this case, you'll only have to make sure your files are added to the right project target in order to add files directly from Xcode.

Gianluca Tranchedone
  • 3,598
  • 1
  • 18
  • 33
  • That would be quite complex, I prefer to copy the lib folder into my project out of the Pod so I can add files into them. But your way seems to be right, thanks. – bolizhou Jul 14 '15 at 06:16