instructure / CKRefreshControl

A pull-to-refresh view for iOS 5, 100% API-compatible with UIRefreshControl in iOS 6
MIT License
292 stars 57 forks source link

In 5.1 Simulator getting "dyld: Symbol not found: _OBJC_CLASS_$_UIRefreshControl" #17

Closed jeremymedford closed 11 years ago

jeremymedford commented 11 years ago

I'm using Xcode 4.6.2 and adding CKRefreshControl 1.1.0 as a CocoaPod to my project that supports iOS 5 and up. When attempting to run on the iOS 5.1 (or 5.0) simulator, this message shows up in the console:

dyld: Symbol not found: _OBJCCLASS$_UIRefreshControl Referenced from: /Users/jmedf/Library/Application Support/iPhone Simulator/5.1/Applications/4DA1DA57-47E6-4D77-B635-6ED600782758/MY_APP.app/MY_APP Expected in: /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator5.1.sdk/System/Library/Frameworks/UIKit.framework/UIKit

I followed the steps on the readme. The only difference is we are initializing this way:

self.refreshControl = [[UIRefreshControl alloc] init]; [self.refreshControl addTarget:self action:@selector(doRefresh:) forControlEvents:UIControlEventValueChanged];

Everything works as expected in iOS 6. I can only deduce that this class can't see CKRefreshControl. I'm importing with:

import "CKRefreshControl.h"

bjhomer commented 11 years ago

There's no need to even import the CKRefreshControl header; the header for UIRefreshControl that the iOS 6 SDK provides should be enough.

However, you do need to make sure that CKRefreshControl.m is being compiled into the pods library. Can you verify that?

jeremymedford commented 11 years ago

Thanks for replying.

  1. An 'ls' on the Pods/CKRefreshControl directory reveals the 'CKRefreshControl.m' file. The Project Navigator shows this file under Pods/CKRefreshControl.
  2. As for importing the header, don't I need to import the header for implementing doRefresh? -(void)doRefresh:(CKRefreshControl *)sender

On Mon, Apr 29, 2013 at 11:04 AM, BJ Homer notifications@github.com wrote:

There's no need to even import the CKRefreshControl header; the header for UIRefreshControl that the iOS 6 SDK provides should be enough.

However, you do need to make sure that CKRefreshControl.m is being compiled into the pods library. Can you verify that?

— Reply to this email directly or view it on GitHubhttps://github.com/instructure/CKRefreshControl/issues/17#issuecomment-17183378 .

Jeremy Medford, Application Developer mobile: 510.289.6437 phone: 510.832.2253 skype: team.medford

bjhomer commented 11 years ago

doRefresh: is the name of whatever method you implement to handle the refresh being triggered. It's the name of your own method, not something that CKRefreshControl provides for you.

As for the file, the question is whether the CKRefreshControl.m is actually being linked into the project. When you select it in the project navigator, does the "Target Membership" in the detail inspector on the right show a checkbox for the Pods target?

jeremymedford commented 11 years ago

Ah, right of course.

Yes, the Target Membership is showing a checkmark next to 'Pods'.

On Mon, Apr 29, 2013 at 11:28 AM, BJ Homer notifications@github.com wrote:

doRefresh: is the name of whatever method you implement to handle the refresh being triggered. It's the name of your own method, not something that CKRefreshControl provides for you.

As for the file, the question is whether the CKRefreshControl.m is actually being linked into the project. When you select it in the project navigator, does the "Target Membership" in the detail inspector on the right show a checkbox for the Pods target?

— Reply to this email directly or view it on GitHubhttps://github.com/instructure/CKRefreshControl/issues/17#issuecomment-17184851 .

Jeremy Medford, Application Developer mobile: 510.289.6437 phone: 510.832.2253 skype: team.medford

bjhomer commented 11 years ago

Hm. And your app is linking with libPods.a?

I just created a new project with Xcode 4.6.2, with the following podfile:

platform :ios, '5.0'

pod 'CKRefreshControl'

I then added some code to a view controller to allocate a UIRefreshControl, and it works just fine in the 5.0 simulator.

I wonder if there's a difference between the 5.0 and the 5.1 simulators? It would surprise me that it would manifest like this, but maybe try with the 5.0 simulator and see if that makes a difference?

d11wtq commented 11 years ago

Try doing a clean build. I get this sometimes when switching from one simulator to another, or from a device to the simulator.

Il giorno 30/apr/2013, alle ore 06:35, BJ Homer notifications@github.com ha scritto:

Hm. And your app is linking with libPods.a?

I just created a new project with Xcode 4.6.2, with the following podfile:

platform :ios, '5.0'

pod 'CKRefreshControl' I then added some code to a view controller to allocate a UIRefreshControl, and it works just fine in the 5.0 simulator.

I wonder if there's a difference between the 5.0 and the 5.1 simulators? It would surprise me that it would manifest like this, but maybe try with the 5.0 simulator and see if that makes a difference?

— Reply to this email directly or view it on GitHub.

johnhaitas commented 11 years ago

have you added the -ObjC linker flag to your project?

jeremymedford commented 11 years ago

Yes, We are using a few other pods as well.

It is really strange. I created a test project of my own the same way you did but used the 5.1 simulator and it works. I have been trying different ways to break this test project to try and reproduce the issue...but so far nothing.

I will continue to look. It is more than likely that the project has some setting somewhere that is tripping up the linker.

(This is an inherited project.)

Thanks.

On Mon, Apr 29, 2013 at 1:35 PM, BJ Homer notifications@github.com wrote:

Hm. And your app is linking with libPods.a?

I just created a new project with Xcode 4.6.2, with the following podfile:

platform :ios, '5.0'

pod 'CKRefreshControl'

I then added some code to a view controller to allocate a UIRefreshControl, and it works just fine in the 5.0 simulator.

I wonder if there's a difference between the 5.0 and the 5.1 simulators? It would surprise me that it would manifest like this, but maybe try with the 5.0 simulator and see if that makes a difference?

— Reply to this email directly or view it on GitHubhttps://github.com/instructure/CKRefreshControl/issues/17#issuecomment-17192496 .

Jeremy Medford, Application Developer mobile: 510.289.6437 phone: 510.832.2253 skype: team.medford

jeremymedford commented 11 years ago

Follow up on this issue.

The error was being caused by the project target inclusion of UIKit being set to 'Required' rather than 'Optional'. The compiler was trying to use the UIKit library version of UIRefreshControl because of the 'Required' setting.

Now, what I don't understand is that the Demo project I created had 'Required' and everything worked fine.

Granted the project I'm working is orders of magnitude more complex. Well, I'm going to consider this resolved for now. Thanks for your assistance.