Sunday, August 26, 2012

Hosting WCF in IIS

Here is the config code for web.config for hosting WCF in IIS6, windows server 2003




Key:

1. Config endpoint behaviors, using webHttp

2. binding use webHttpBinding

Wednesday, August 8, 2012

NSString Examples

NSLog


NSLog( @"The sky is %@.", @"blue" );
The preceding line of code results in this output:
The sky is blue.

Finding the Length of an NSString


NSString *string = @"A string to measure";
NSUInteger stringLength = [string length];
NSLog( @"The length is: %d.", stringLength);
results in:
The length is: 19.

Obtaining an Uppercase NSString


NSString *string1 = @"Make me taller.";
NSString *string2 = [string1 uppercaseString];
NSLog( @"Uppercased string: %@", string2 );

results in:
Uppercased string: MAKE ME TALLER.

Appending an NSString to Another NSString


NSString *string1 = @"The First Part ";
NSString *string2 = @"The Second Part";
NSString *result = [string1 stringByAppendingString: string2];
NSLog( @"Resulting string: %@", result );
results in:
Resulting string: The First Part The Second Part


Breaking a Sentence into Individual Word


NSString *string1 = @"This sentence is falling apart";
NSArray *words =
[string1 componentsSeparatedByCharactersInSet:
[NSCharacterSet whitespaceCharacterSet]];
NSLog( @"Word array: %@", words);
results in:
Word array: (
This,
sentence,
is,
falling,
apart
)

C String to NSString and Back


char* cString = "Hello Universe";
NSString* nsString = [NSString stringWithUTF8String: cString];
This code does the reverse:
NSString* nsString = @"Anybody Home?";
char* cString = [nsString UTF8String];







Monday, August 6, 2012

NSString Class Reference

Here is the link for Objective C NSString Class Reference

NSString Class Reference 

Wednesday, August 1, 2012