NSString

    [Objective-C] NSString 다루기(문자열 다루기) - 1

    📌문자열 길이 구하기 ✔length NSString* test=@"hello"; NSLog(@"length of %@ : %i", test, [test length]); 📌문자열 복사 ✔stringWithString NSString* str = @"hello"; NSString* result = [NSString stringWithString:str]; NSLog(@"result : %@", result); 📌문자열 더하기 - 1 ✔stringByAppendingString NSString* test1 = @"hello"; NSString* test2 = @"world"; NSString* result = [test1 stringByAppendingString:test2]; NSLog(@"%@ + %@ ..

    [Objective-C] NSString convert to char, char to NSString

    📌char to NSString const char *szTest = "Hello"; NSString *nstrTest = [NSString stringWithUTF8String:szTest]; 📌NSString to char NSString *nstrTest = @"Hello"; const char *szTest = [nstrTest UTF8String]; objective-c에서 c언어 함수를 호출할 때도 필요할 것 같다.