๋ณธ๋ฌธ ๋ฐ”๋กœ๊ฐ€๊ธฐ

NSString3

[iOS] Objective-C NSString -> char* ๊ณผ char* -> NSString // char* -> NSString char szText[] = "hello World"; NSString* nsStr = [NSString stringWithUTF8String: szText]; // NSString -> char* NSString* nsStr = @"hello World"; char* strTmp = (char*)[nsStr UTF8String]; // NSString -> unsigend char* NSString* nsStr = @"hello World"; unsigned char* strTmp = (unsigned char*)[nsStr UTF8String]; // NSString ๊ธธ์ด ๊ตฌํ•˜๊ธฐ NSString* nsStr2 = @"check length!"; int nLengt.. 2021. 10. 21.
[iOS] Objective-C NSString์˜ ๊ฐ’์„ null ์ฒดํฌํ•˜๋Š” ๋ฐฉ๋ฒ• NSString *nsStr = @"Hello World"; if ([nsStr isEqual: [NSNull null]]) printf("null"); else printf("not null"); https://stackoverflow.com/questions/19546920/how-to-check-nsstring-is-null-or-not how to Check NSString is null or not I want to check weather a NSString is null or not. Im assigning from an JSON array. After assigning that string value is . Now I want to check this string is null or no.. 2021. 10. 13.
[iOS] Objective-C NSMutableDictionary ๋ฅผ json ํ˜•ํƒœ๋กœ ๋ณ€ํ™˜ iOS (Objective-C) ์—์„œ JSON ํ˜•ํƒœ๋กœ http ํ†ต์‹ ์„ ํ•˜๊ธฐ ์œ„ํ•ด json ํ˜•ํƒœ๋กœ ๋ณ€ํ™˜์„ ํ•˜๋Š” ์ฝ”๋“œ์ด๋‹ค. NSMutableDictionary ํ˜•ํƒœ์˜ ๋ฐ์ดํ„ฐ๋ฅผ NSJSONSerialization ์„ ์ด์šฉํ•ด NSData ๋กœ ๋ณ€ํ™˜ํ•œ ํ›„, ๋‹ค์‹œ NSString ์œผ๋กœ ๋ณ€ํ™˜ํ•œ๋‹ค. NSMutableDictionary *retDic = [[NSMutableDictionary alloc]init]; [retDic setValue:๊ฐ’1 forKey:@"ํ‚ค1"]; [retDic setValue:๊ฐ’2 forKey:@"ํ‚ค2"]; NSData *requestData = [NSJSONSerialization dataWithJSONObject:retDic options:0 error:nil]; NSString *req.. 2021. 10. 6.