Advertise Mobile SDKs Books Events Forum News Social Networking Support Us
Follow @iphonedevsdk on Twitter

Interface 2, Advanced iOS
Mockup & Code Gen
($9.99)

Make your own iPhone apps
and run them live!
(free)

Pic Frame Dynamo: Photo Editing
($0.99)

Abiliator
($1.99)

Want your application or service advertised on iPhone Dev SDK?

Go Back   iPhone Dev SDK Forum > iPhone SDK Development Forums > iPhone SDK Development

Reply
 
LinkBack Thread Tools Display Modes
Old 05-31-2010, 02:53 PM   #1 (permalink)
Registered Member
 
Join Date: May 2010
Posts: 5
ferdart is on a distinguished road
Default UIWebDocumentView seen as non public API

Hi all,
one of my apps has been recently rejected becuase (according to apple) it uses private APIs ("3.3.1 Applications may only use Documented APIs in the manner prescribed by Apple and must not use or call any private APIs.").
The non-public API that is included in my application is UIWebDocumentView.
That's kind of new, I used the same code for months without any problems.
Here's how I'm using it in my view, I'm wondering if you could help me to fix this issue:

myview.h

Code:
#import <Foundation/Foundation.h>
#import <UIKit/UIKit.h>
#import "songDatabase.h"
#import "WebView.h"
#import "UIWebDocumentView.h"

@interface APWindow : UIWindow {
	songDatabase *database; 
	
	CGPoint startPos;
}


@end
myview.m

Code:
#import "APWindow.h"
#import "songView.h"
@class UIWebDocumentView;


@implementation APWindow

- (void)sendEvent:(UIEvent*)event {
	if (database == nil)
		database = [songDatabase sharedInstance];
	
	if (database.songBeingViewed)
	{
		NSSet *allTouches = [event allTouches];
		if ([allTouches count] == 1)
		{
			UITouch *aTouch = [allTouches anyObject];
			if ([aTouch.view isMemberOfClass:[UIWebDocumentView class]])
			{
				if (aTouch.phase == UITouchPhaseBegan)
					startPos = [aTouch locationInView:aTouch.view];
				else if (aTouch.phase == UITouchPhaseEnded)
				{
					CGPoint endPos = [aTouch locationInView:aTouch.view];
					CGFloat dx = endPos.x - startPos.x;
					CGFloat dy = endPos.y - startPos.y;
					if ((dx*dx + dy*dy) < 100)	// a movement of <= 10 pixels
					{
						[[songDatabase sharedInstance].songView webViewWasTapped];
					}
					
					startPos.x = -1;
					startPos.y = -1; 
				}
			}
		}
	}
	
	[super sendEvent:event];
}

@end
Thanks
ferdart is offline   Reply With Quote
Old 05-31-2010, 03:21 PM   #2 (permalink)
Registered Member
 
Join Date: May 2009
Posts: 247
linkmx is on a distinguished road
Default

Well, UIWebViewDocument it's a private class, if you want to detect touch on a webview use the following method, no need to use private APIs.

Detecting taps and events on UIWebView – The right way The Spoken Word
linkmx is offline   Reply With Quote
Reply

Bookmarks

Tags
api, private, uiwebdocumentview

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



» Advertisements
» Online Users: 328
9 members and 319 guests
ajay123123, ashaman64, baja_yu, ChrisYates, HemiMG, newDev, Objective Zero, pkIDSF, Steven.C
Most users ever online was 1,387, 04-10-2012 at 04:21 AM.
» Stats
Members: 175,648
Threads: 94,113
Posts: 402,878
Top Poster: BrianSlick (7,990)
Welcome to our newest member, brandon6031
Powered by vBadvanced CMPS v3.1.0

All times are GMT -5. The time now is 07:55 PM.
Powered by vBulletin® Version 3.8.0
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.3.0