9

I am new to this technology.

I am getting following warning while uploading application from Application Loaded.

Warning says "The app references non-public selectors in "App Name" instance, viewController"

Please help me solve this warning.

Thanks in advance!

EDIT

Image :-

enter image description here

EDIT :-

Will my application get approve?

P.J
  • 6,547
  • 9
  • 44
  • 74
  • You are using some private API! – Moxy Dec 01 '12 at 06:34
  • http://stackoverflow.com/questions/10884968/apple-says-the-app-references-non-public-selectors-in-my-app-what-does-that-mea – nycynik Dec 01 '12 at 06:34
  • The real question is what instance method of a view controller you are calling that Apple considers private. We cannot answer until we know that; the dialog image you posted does not reveal it. – Kendall Helmstetter Gelner Dec 06 '12 at 07:54
  • In almost all cases you'll have a warning in your view where you're referencing a private api. Do you have any warnings in that controller? – Stakenborg Dec 06 '12 at 21:06
  • 1
    Has anyone suggested that he click the _view_ (little magnifying glass icon) on the right side of the image? Usually that will point him to where that code is being used... – Miles Alden Dec 08 '12 at 22:08

7 Answers7

6

Use App Scanner. It analyzes your .app file for private API method usage.

It will catch methods that have been named the same as a private API method, even if it has it's own implementation. Also, it'll catch @selectors inside methods (just like the official iOS automated checker).

App Scanner doesn't catch the case when performSelector: is called with a selector that is a private method. However, Apple's tools do catch that case.

Another Alternative APP Kit, though I haven't used it. Give it a try.

Check out this Q&A, if you haven't. How does Apple know you are using private API?. Looks Helpful.

Community
  • 1
  • 1
Pranav Jaiswal
  • 3,752
  • 3
  • 32
  • 50
  • When I try to upload my .app file, App Scanner application crashes, any other alternative? – P.J Dec 05 '12 at 09:39
  • actually I cross-checked with an .app file of my app it works fine. Check upadted answer – Pranav Jaiswal Dec 05 '12 at 10:03
  • +1 for the link to the *How does Apple know ...* question. KennyTM's answer is the best information I've seen on this issue. – Nate Dec 08 '12 at 22:15
1

What was the last thing you added to the code before you got this error? The error means you have a private API call, as my link above notes.

If you dont think it was your code, then it might be any of the included code.

nycynik
  • 7,371
  • 8
  • 62
  • 87
  • My application get successfully uploaded, but it gave me this warning, will my application will be rejected due to this, If I have 10 privileges I can upload that warning image also – P.J Dec 01 '12 at 06:39
  • Yes it will get rejected. You can put the image up, if you post it to a free image service (like imageshack) and add the link. – nycynik Dec 01 '12 at 06:42
  • @iPhoneDev, you have enough rep to upload an image now. – iDev Dec 01 '12 at 06:44
  • Can you tell me where my code will be which uses non-public sectors? – P.J Dec 01 '12 at 06:50
1

@iPhoneDev: i guess your application will not be rejected due to this reason. Because i have faced this warning in one of my app, and it was accepted successfully. So no need to worry

coder1010
  • 412
  • 5
  • 15
  • it is a gamble... he is using something deemed private by the static analyzer – Daij-Djan Dec 03 '12 at 08:51
  • @Daij-Djan i have just answered to his question 'Will my app get approved'. I am not supporting he should do it. Why down vote for that – coder1010 Dec 04 '12 at 09:03
  • because even if it did work for you, it isnt sure it is working for him. a) it is all dependent on the reviewer, b) on your connections and most importantly on c) WHAT private code is used -- and we dont know what/how he used it – Daij-Djan Dec 04 '12 at 09:07
  • @code1010 you're likely right and I would bet on it but technically, it is NOT okay :) – Daij-Djan Dec 04 '12 at 09:08
  • +1, it's your view.. so +1 vote, Thanks – Suresh D Feb 03 '14 at 13:51
1

I think you might have a function named instance somewhere in your code, such as:

+(id)instance{
    return something;
}

.. maybe a singleton implementation? If this is the case, just rename it.

I've seen apps approved despite the fact that they triggered similar alarms, but why would you want to risk a rejection?

magma
  • 8,432
  • 1
  • 35
  • 33
1

Search for viewController in your entire project and search if there is any singleton implementation. Even if Apple approve you application, its not good to have non-public sectors in your application. You can also use App Scanner

Hope it helps you

Pranjal Bikash Das
  • 1,092
  • 9
  • 27
0

Almost certainly get rejected for this.

Just a guess, but search for "viewController" and see if you are referencing a private instance method, or perhaps a private instance variable via dot notation: .viewController

Dad
  • 6,388
  • 2
  • 28
  • 34
0

No, your app will be rejected like this. Definitely. Apple review team uses the same checks as Xcode plus a few more.

Cocoanetics
  • 8,171
  • 2
  • 30
  • 57