Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
584 views
in Technique[技术] by (71.8m points)

ios - 'No such module' when I use CocoaPods

So here's my procedure. I create a new Podfile in the project directory, then I added the following

platform :ios, '9.0'
use_frameworks!

target 'CPod' do
pod 'AFNetworking', '~> 2.5'
pod 'ORStackView', '~> 2.0'
pod 'SwiftyJSON', '~> 2.1'
end 

I fire off pod install, and everything goes well, open up the xcworkspace. I then go over to ViewController.swift and if I try to import a pod I get No such module 'SwiftyJSON', if I were to do import SwiftyJSON. Any ideas?

EDIT: SwiftyJSON is a Swift based module, not Obj-C

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

Try adding the Pods framework to your build scheme and building the framework. After you've built it, build/run your project.

Steps:

  1. Scheme menu > Manage Schemes > check Pods > Close manage

    enter image description here

  2. Select Pods from the scheme menu.
  3. Build Pods.
  4. Select your project from the same menu, then build/run it.

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...