groups

name language licence
Force Application Crash Objective-C Other
FourCharCode to NSString Objective-C Other
ROT13 Objective-C Other
NSIndexSet to String Objective-C Other
getBoundingClientRect from WebKit using JavaScriptCore Objective-C Other
NSImage Create QuickLook icon for URL Objective-C Other
Method Replacement (swizzle) Objective-C Other
Safe respondsToSelector: override Objective-C Other

< 1 2 3 >



language: Objective-C
licence: Other

ROT13

options: view full snippetsend to code collector
// The magic and power of ROT13 encryption, now available via Cocoa!!!
@interface NSString (NSString_Additions)
-(NSString *) rot13String;
@end

@implementation NSString (NSString_Additions)
-(NSString *) rot13String
{
	const char *_string = [self cStringUsingEncoding:NSASCIIStringEncoding];
	int stringLength = [self length];
	char newString[stringLength+1];
	
	int x;
	for( x=0; x<stringLength; x++ )
	{
	
(Continues...)