Are all these Cocoapod files supposed to be red after installing?

半城伤御伤魂 提交于 2019-12-23 13:04:22

问题


I just started a new project from scratch and tried to install Parse with Cocoapods for the first time. I'm using Xcode 6.4 and Cocoapods 0.37.2.

I did the standard Cocoapods install with Terminal:

sudo gem install cocoapods
pod setup --verbose

cd ~/Documents/"Application Development"/VeilApp
pod init
open -a Xcode Podfile

In my Podfile:

platform :ios, '8.0'
use_frameworks!

target 'VeilApp' do

pod 'Parse'
pod 'ParseUI'

end

target 'VeilAppTests' do

end

And then again in Terminal:

pod install

I closed xcodeproj and opened xcworkspace version of app, and then I run into this:

imgur.com/D272Tle

Basically a bunch of red (not found? not linked correctly?) Cocoapod files. I tried to save something on Parse, and it does work. But then I tried to subclass PFQueryTableViewController and it couldn't find it. I'm not exactly sure where I went wrong, did I skip a step in installing Cocoapods? I'm quite new to programming in general, so if someone could shed a light on what I'm doing wrong it would be awesome if it comes with steps :)


回答1:


Short Answer = yes

red items in Frameworks and Products, pointing to derived data are normal.


Troubleshooting

Have you tried the obvious:

  1. Quit/Relaunch Xcode
  2. Xcode > Window > Projects > Derived Data Delete...
  3. Proper import ParseUI in your Swift source code
  4. Start over: rm -rf Podfile.lock Pods/ ; pod install

Assuming you got this after the pod install:

Downloading dependencies
Installing Bolts (1.2.0)
Installing Parse (1.7.5)
Installing ParseUI (1.1.4)
Generating Pods project
Integrating client project

...and you followed Cocoapod's advice (generally better to have closed Xcode Project before creating the workspace)...

[!] From now on use VeilApp.xcworkspace.

...then this does work:

Swift

import ParseUI

class MyQueryTableViewController : PFQueryTableViewController {
}

class AClass {
    func aFunction() {
        let pf:PFQueryTableViewController = MyQueryTableViewController(style: .Plain)
    }
}


来源:https://stackoverflow.com/questions/31226185/are-all-these-cocoapod-files-supposed-to-be-red-after-installing

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!