Codec ░ iPhone

303singleTap: and private API

Very funny and strange case of rejection. I made a method called ’singleTap’, that is – as the name suggests – receiving events after a single tap occurs.
During the development process the function was not used and commented out, but an oversight let to the notification being left it. And then the message from Apple:

“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 following non-public API is included in your application:

singleTap:

Hmm. Clearly I did not use a private API, apparently I just happened to call a function the same name as a private API function… Wondering if there is a list of reserved function names, which is triggered a rejection?

Solution? I commented out the superflicial notification AND renamed the function to ‘oneTap’. Just in case.

I am starting to believe the stories about the Apple store.

319Chaning Colors in Twitter with the API 162iPhone: Dynamic Table Heights 148iPhone: Checking Network Availability 139QC Show/Hide Private Patches 119Updating to OS 3.0 from beta 5

162iPhone: Dynamic Table Heights

Nice blog from CIMGF on Dynamic Table Heights.
http://www.cimgf.com/2009/09/23/uitableviewcell-dynamic-height/

303singleTap: and private API 160@dynamic – Provide methods dynamically at runtime 148iPhone: Checking Network Availability 119Updating to OS 3.0 from beta 5 102Info.plist

148iPhone: Checking Network Availability

Checking whether network is present and active.
By way of: http://70.40.216.232/forums/viewtopic.php?f=21&t=425

UIApplication-Network.h



//
//  UIApplication-Network.h
//
//  SystemConfiguration.framework will need to be added to your project
//
//  To use just call as a class function [UIApplication hasNetworkConnection]
//

#import 
#import 

@interface UIApplication (NetworkExtensions)

+(BOOL)hasActiveWiFiConnection;     // fast wi-fi connection
+(BOOL)hasNetworkConnection;     // any type of internet connection (edge, 3g, wi-fi)

@end

UIApplication-Network.m


//
//  UIApplication-Network.m
//

#import "UIApplication-Network.h"

@implementation UIApplication (NetworkExtensions)

#define ReachableViaWiFiNetwork          2
#define ReachableDirectWWAN               (1 << 18)
// fast wi-fi connection
+(BOOL)hasActiveWiFiConnection
{
	SCNetworkReachabilityFlags     flags;
	SCNetworkReachabilityRef     reachabilityRef;
	BOOL                              gotFlags;

	reachabilityRef     = SCNetworkReachabilityCreateWithName(CFAllocatorGetDefault(), [@"www.apple.com" UTF8String]);
	gotFlags          = SCNetworkReachabilityGetFlags(reachabilityRef, &flags);
	CFRelease(reachabilityRef);

	if (!gotFlags)
	{
		return NO;
	}

	if( flags & ReachableDirectWWAN )
	{
		return NO;
	}

	if( flags & ReachableViaWiFiNetwork )
	{
		return YES;
	}

	return NO;
}

// any type of internet connection (edge, 3g, wi-fi)
+(BOOL)hasNetworkConnection;
{
    SCNetworkReachabilityFlags     flags;
    SCNetworkReachabilityRef     reachabilityRef;
    BOOL                              gotFlags;

    reachabilityRef     = SCNetworkReachabilityCreateWithName(CFAllocatorGetDefault(), [@"www.apple.com" UTF8String]);
    gotFlags          = SCNetworkReachabilityGetFlags(reachabilityRef, &flags);
    CFRelease(reachabilityRef);

    if (!gotFlags || (flags == 0) )
    {
        return NO;
    }

    return YES;
}

@end

Also, don't forget to add the SystemConfiguration.framework to the Frameworks folder in your application.

In case you get errors like that:


"_SCNetworkReachabilityGetFlags", referenced from:
		      +[UIApplication(NetworkExtensions) hasActiveWiFiConnection] in UIApplication-Network.o
		      +[UIApplication(NetworkExtensions) hasNetworkConnection] in UIApplication-Network.o
		  "_SCNetworkReachabilityCreateWithName", referenced from:
		      +[UIApplication(NetworkExtensions) hasActiveWiFiConnection] in UIApplication-Network.o
		      +[UIApplication(NetworkExtensions) hasNetworkConnection] in UIApplication-Network.o
		ld: symbol(s) not found
		collect2: ld returned 1 exit status
Build failed (2 errors)

Picture 4

303singleTap: and private API 162iPhone: Dynamic Table Heights 119Updating to OS 3.0 from beta 5 102Info.plist 95iPhone Proximity Sensor

119Updating to OS 3.0 from beta 5

Apparently has to be put into recovery mode.

http://discussions.apple.com/thread.jspa?messageID=9651285
http://support.apple.com/kb/HT1808

303singleTap: and private API 175Curling Images at Twitter 162iPhone: Dynamic Table Heights 148iPhone: Checking Network Availability 102Info.plist

102Info.plist

Info.plist with an automatic pop-up of all possible values. Nice.

303singleTap: and private API 162iPhone: Dynamic Table Heights 148iPhone: Checking Network Availability 119Updating to OS 3.0 from beta 5 95iPhone Proximity Sensor

95iPhone Proximity Sensor

http://arstechnica.com/apple/news/2008/11/ars-investigates-does-google-mobile-use-private-apis.ars

hmm. interesting.

How does that relate to iPhone OS 3.0?

303singleTap: and private API 162iPhone: Dynamic Table Heights 148iPhone: Checking Network Availability 119Updating to OS 3.0 from beta 5 102Info.plist

67oF on iF

openFrameworks on iPhone, now finally public.

http://www.memo.tv/ofxiphone
http://www.jeffcrouse.info/uncategorized/openframeworks-on-iphone/

i shall attempt to install it, and report back then. in the meantime too busy with the wolf.

update:
installation was a breeze, the demos are running quite nicely. (of course you did not forget changing the code-signing in the target to your id). curious to find out what the hardware can do. and finally no more excuses of not getting into oF.

303singleTap: and private API 162iPhone: Dynamic Table Heights 148iPhone: Checking Network Availability 119Updating to OS 3.0 from beta 5 102Info.plist

11UITableViewController…

- simple subclass of UITableController
- for ***Fullscreen*** tables only
- create UITableView with loadView
- set delegate & dataSource to itself

303singleTap: and private API 289Simulating Keyboard & Mouse Events. And Key-Modifier Events 275UIWebView – checking when user clicks a link 269Caching on Objective-C with NSURLCache 265Like explode(), only componentsSeparatedByString: