Próbuję przekonwertować const char * na NSString *, a następnie przekonwertować go z powrotem. To działa, ale ja dostać:Konwertuj const char * na NSString * i przekonwertuj - _NSAutoreleaseNoPool()
__NSAutoreleaseNoPool(): Object 0x100550a40 of class NSCFArray autoreleased with no pool in place - just leaking
__NSAutoreleaseNoPool(): Object 0x100551730 of class NSCFString autoreleased with no pool in place - just leaking
__NSAutoreleaseNoPool(): Object 0x100551f10 of class NSCFData autoreleased with no pool in place - just leaking
Kod jest:
const char* convert = "hello remove this: *";
NSString *input = [[NSString alloc] initWithUTF8String:convert];// convert
//remove * FROM THE STRING
NSCharacterSet *doNotWant = [NSCharacterSet characterSetWithCharactersInString:@"*"];
// REPLACE * WITH NOTHING
input = [[input componentsSeparatedByCharactersInSet: doNotWant] componentsJoinedByString: @""];
// CONVERT BACK
const char *converted_back = [input UTF8String];
jestem zagubiony, proszę mi pomóc.
Pokaż cały twój kod, myślę, że wiem, jaki jest problem, ale najpierw muszę sprawdzić cały twój kod. –