Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Xcode 6 GM version, iPhone 6 simulator, no visible @interface for 'UITapGestureRecognizer' declares the selector 'initWithTarget:action:'

Tags:

xcode

ios

xcode6

UIPanGestureRecognizer *pan = [[UIPanGestureRecognizer alloc] initWithTarget:self action:@selector(panGestureRecognized:)];

This code can compile for any simulator in Xcode 5,

but in Xcode 6, it can only compile for simulators with 32 bit CPUs(iPhone 5 and under),

when compiling for simulators with 64 bit CPUs(iPhone 5s, iPhone 6, iPhone plus), compiler says:

no visible @interface for 'UITapGestureRecognizer' declares the selector 'initWithTarget:action:'

But I do have imported <UIKit/UITapGestureRecognizer>

What's the problem?

like image 342
CarmeloS Avatar asked Sep 10 '14 01:09

CarmeloS


3 Answers

Try Product > Clean menu first.(i.e. command + shift + k)
If it won't help, with option key, Product > Clean Build Folder... (i.e. option + command + shift + k).
At last, remove all derived data directory with rm -rf ~/Library/Developer/Xcode/DerivedData/.

I think ~/Library/Developer/Xcode/DerivedData/ModuleCache/* made with old (Xcode5) SDK causes this problem.

like image 151
rintaro Avatar answered Nov 15 '22 14:11

rintaro


For me this started happenning when I updated to xCode GM, and only when 5s, 6, 6+ simulator is selected. All others are fine. Removing ~/Library/Developer/Xcode/DerivedData/ModuleCache solved it for me

like image 25
Biku Toru Avatar answered Nov 15 '22 14:11

Biku Toru


I removed my Xcode 5 bundle and restarted my Mac, then magically it works now, I still don't know the reason however.

like image 26
CarmeloS Avatar answered Nov 15 '22 13:11

CarmeloS