Method 'alloc' is defined in class 'NSObject' and is not visible

Completed

Hello,

 

I am giving AppCode a try and when I open my project I get a lot of inspection errors "method X is defined in class Y and is not visible". Project compiles just fine.

 

AppCode 2016.3.3

Xcode 8.2.1

 

This is the same issue as the following post (which dates from 2014), but it didn't help me solve my problem:

https://intellij-support.jetbrains.com/hc/en-us/community/posts/206587465-Method-init-is-defined-in-class-NSObject-and-is-not-visible?input_string=Medhod%20%27alloc%27%20is%20defined%20in%20class%20%27NSObject%27%20and%20is%20not%20visible

 

Any help would be appreciated!

6 comments

I have the same issue. Invalidate caches did not work.

How was this fixed?

0

Stein,

This particular issue was fixed in AppCode 2017.1. What version are you using at the moment?

0

Hello Tatiana,

I'm using the latest version: 
AppCode 2017.1.1
Build #OC-171.4073.48, built on April 19, 2017
Subscription is active until January 18, 2018
JRE: 1.8.0_112-release-736-b16 x86_64
JVM: OpenJDK 64-Bit Server VM by JetBrains s.r.o
Mac OS X 10.12.4

0

Stein,

Then it makes sense to create an issue in our tracker with a sample project or code snippet to reproduce. 

0

Hello Tatiana, 

apologies for the delay. I found out that the issue was caused by an external library (iCarousel) which did the following:

#if defined USING_CHAMELEON || defined __IPHONE_OS_VERSION_MAX_ALLOWED
#define ICAROUSEL_IOS
#else
#define ICAROUSEL_MACOS
#endif


#ifdef ICAROUSEL_IOS
#import <UIKit/UIKit.h>
#else
#import <Cocoa/Cocoa.h>
typedef NSView UIView;
#endif

AppCode wrongfully thought ICAROUSEL_IOS was not defined. Do I create an issue for this in the tracker, or is it a configuration issue on my part?

 

0

Please sign in to leave a comment.