Is this considered as using private functions in iPhone dev, and thus illegal?

Posted by user153231 on Stack Overflow See other posts from Stack Overflow or by user153231
Published on 2009-09-07T07:07:21Z Indexed on 2010/05/19 17:20 UTC
Read the original article Hit count: 206

Filed under:
|
|
|
|

I'm trying to disable scrolling for a UIWebView and the only way i found is using this way:

#import <objc/runtime.h>

id scroller = [[Webview subviews] lastObject];
int count;
Method *method = class_copyMethodList([scroller class], &count);
int i;
for (i=0; i<count; i++) {
    if (strcmp(method_getName(method[i]), "setScrollingEnabled:") == 0)
        break;
}
IMP test = method_getImplementation(method[i]);
test(scroller, @selector(setScrollingEnabled:), NO);

Is this considered to be an illegal way of using the iPhone SDK? Can this cause my application to be rejected for the App store?

© Stack Overflow or respective owner

Related posts about iphone

Related posts about private