ich versuche const char * in NSString * zu konvertieren und dann zurück zu konvertieren. Es funktioniert, aber ich erhalte:conver char * in NSString * konvertieren und zurück konvertieren - _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
Der Code ist:
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];
Ich bin verloren, bitte helfen Sie mir.
Zeigen Sie alle Ihren Code, ich denke, ich weiß, was das Problem ist, aber ich muss zuerst Ihren gesamten Code überprüfen. –