2012年9月3日 星期一

MAC Day 8 - Objective-C - NSString

https://developer.apple.com/library/mac/#documentation/Cocoa/Reference/Foundation/Classes/NSString_Class/Reference/NSString.html


stringWithString:

Returns a string created by copying the characters from another given string.
+ (id)stringWithString:(NSString *)aString

e.g.     newStr = [NSString stringWithString: oldStr];

UTF8String

Returns a null-terminated UTF8 representation of the receiver.
- (const char *)UTF8String

e.g     NSLog(@"newStr: %s", [newStr UTF8String]);



沒有留言:

熱門文章