0

What Apple says about Private APIs. How can a user test his/her application if it contains Private APIs. What are the steps Apple has suggested users to test there apps for Private APIs and other reason for an app could get rejected ?

A link or a tutorial would help.

note: i have used AppScanner but it crashes when i upload the .app file. (So it doesn't work)

Illep
  • 16,375
  • 46
  • 171
  • 302
  • possible duplicate of [Detecting the use of private APIs](http://stackoverflow.com/questions/1740588/detecting-the-use-of-private-apis) – jscs Mar 22 '12 at 05:50

1 Answers1

5

The best way is to use Apple's validate step after you make an archive. Other than that, if it compiles without calls to KVC for Apple APIs, it should be good. On that note, there are many public libraries that successfully use some private APIs that Apple does not reject.

Peter DeWeese
  • 18,141
  • 8
  • 79
  • 101
  • What is `KVC` stand for ? Is there any tutorial/article where i could learn more about the `Validate step` you were saying. – Illep Mar 22 '12 at 02:13
  • 1
    @Illep I don't know the KVC thing, but about validating just make build->archive then go to Xcode Organizer and find the archives menu, you can click in your archive and then validate. When you try to submit your app it will also validate it. – fbernardo Mar 22 '12 at 02:19
  • @fbernardo is correct on validation, and KVC stands for Key Value Coding, which is used among other things to access hidden fields by name. You probably aren't using it. http://developer.apple.com/library/mac/#documentation/Cocoa/Conceptual/KeyValueCoding/Articles/KeyValueCoding.html – Peter DeWeese Mar 22 '12 at 02:26
  • @PeterDeWeese Calls for KVC for Apple API's? Can you give an example? – fbernardo Mar 22 '12 at 02:47
  • @PeterDeWeese well, i am using NSDictionary and NSUserDefaults. I hope they are key value coding. – Illep Mar 22 '12 at 13:53
  • Here is an example that is not a private API: `self` is a UIViewController; `[self valueForKey:@"view"]` is equivalent to `self.view`. – Peter DeWeese Mar 22 '12 at 13:53
  • It doesn't sound like accessing private vars using KVC is an issue for you. – Peter DeWeese Mar 22 '12 at 18:45