App Store review incorrectly flags category methods as overriding SPI

Originator:andrew
Number:rdar://7414099 Date Originated:20-Nov-2009 02:21 PM
Status:Open Resolved:
Product:Other Product Version:3.0
Classification:Serious Bug Reproducible:I Didn't Try
 
20-Nov-2009 02:21 PM Andrew Wooster:
** SUMMARY:
RogueSheep recently blogged [0] that an app of theirs that uses the Three20 [1] framework was rejected because:

"""The notice from Apple indicated that we had used a private method of UIViewController called previousViewController. Interestingly enough, we did not explicitly use this call anywhere in our code. Looking a bit into the version of the Three20 library we were using revealed that it coincidentally contained a category that added a method to UIViewController called previousViewController."""

I believe this to be a false positive. Apologies in advance if I'm wrong. I'm working on very little information here. [*]

** STEPS TO REPRODUCE:
Attached is a test project which should trigger the false positive in your static analyzer (or whatever you're using). It's hard to tell, because I haven't seen this myself and don't have access to the tool itself.

** NOTES:
Three20 does have a category on UIViewController which adds the method "-previousViewController". However, Apple does not (as tested with -respondsToSelector:) have a private method called -previousViewController in UIViewController.

The closest I can find, which may be triggering the problem, is the private method -previousViewController defined for UINavigationController, a subclass of UIViewController.

However, the private method on UINavigationController should override the category method defined by Three20, so the category method should not cause any problems in Apple code.

So, I believe whichever tool you're using to determine whether an app is using SPI is flawed and producing false positives.

[*] I am, however, an interested party, in that I work on several apps which use Three20, and could thus be rejected for this reason.
[0] http://blog.roguesheep.com/2009/11/19/warning-love-hurts/
[1] http://github.com/facebook/three20

Comments

Apple has resolved this issue.

The project file referenced above is available at: http://blog.planetaryscale.com/wp-content/uploads/2009/11/CategoryBehavior.zip


Please note: Reports posted here will not necessarily be seen by Apple. All problems should be submitted at bugreport.apple.com before they are posted here. Please only post information for Radars that you have filed yourself, and please do not include Apple confidential information in your posts. Thank you!