Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

iOS project not seeing local changes when developing a Cocoapod project

Tags:

ios

cocoapods

I'm working on a framework that is available via Cocoapods.

I have my project set up using their suggested setup, and their development page says "You can work on the library from its folder on your system." but when I make changes to the files in the "Development Pods" folder and build my project, the changes do not show up.

I've tried running $ pod install on the project, which regenerates the xcworkspace file, but the changes still don't show up. I'm unsure how the changes are being missed, as I've commented out a large chunk of code and added a few NSLogs, but it still runs as if I never made the changes.

I've also tried cleaning the project via xcode.

Any ideas?

Bonus q: What is the correct way to work on a cocoapod framework? The documentation is rather lacking when it comes to setting up a project like this.

Edit: Here's the podfile:

platform :ios, "6.0"
pod "MyFramework", :path => "../"

(using an example name as the pod is't published yet)

like image 736
Geoff Avatar asked Dec 20 '13 17:12

Geoff


2 Answers

The fix was to delete my xcworkspace [rm -rf MyFramework.xcworkspace] and recreate it via pod install.

The only difference I can see is that Pods is now included in the build targets for my demo app's scheme.

like image 91
Geoff Avatar answered Oct 14 '22 23:10

Geoff


Here's the general process for developing a cocoapod.

  1. Run pod lib create <Pod Name> to create your project.

    cd MyDirectory
    pod lib create MyPod
    
  2. Make sure to run pod install inside your example project. This will generate a .xcworkspace file.

    cd MyPod/Example
    pod install
    
  3. Open your example project via the .xcworkspace file.

    Xcode -> File -> Open -> MyPod.xcworkspace

  4. Edit your pod via Pods/Development Pods.

    Project Navigator -> Pods -> Development Pods -> MyPod -> <file>

  5. Clean, build, & run your example project.

    Make sure to clean (cmd+shift+k) your project before running, otherwise changes made to your pod will not be captured.

like image 21
Derek Soike Avatar answered Oct 14 '22 22:10

Derek Soike