Note that there are some explanatory texts on larger screens.

plurals
  1. POString to string EXC_BAD_ACCESS why?
    primarykey
    data
    text
    <p>whats I missed?</p> <pre><code>NSString * configPath = nil; -(IBAction)setPlistPathAndWriteData:(id)sender{ NSOpenPanel *panel = [NSOpenPanel openPanel]; [panel setDirectory:@"/Volumes/"]; [panel setNameFieldStringValue:@"config.plist"]; [panel setRequiredFileType:@"plist"]; NSInteger ret = [panel runModal]; if ( ret == NSFileHandlingPanelOKButton ) { NSString *filePath= [[panel URL] path]; // with this works fine //configPath = [NSString stringWithFormat:@"/Volumes/Macintosh HD/config.plist"]; // with this EXC BAD ACCESS configPath = [NSString stringWithFormat:@"%@", filePath]; [self writeData]; } } -(void)writeData { SET_TEMP_PLIST NSTask *task = [[NSTask alloc] init]; NSPipe *pipe = [[NSPipe alloc] init]; NSFileHandle *writeHandle = [pipe fileHandleForWriting]; NSData *configData = [NSPropertyListSerialization dataFromPropertyList:tmpPlist format: NSPropertyListXMLFormat_v1_0 errorDescription:nil]; [task setLaunchPath:@"/usr/libexec/authopen"]; ////////////////////////////////////////////////////////EXC_BAD_ACCESS HERE//////// [task setArguments:[NSArray arrayWithObjects:@"-c", @"-w", configPath, nil]]; [task setStandardInput:pipe]; [writeHandle writeData:configData]; [task launch]; close([writeHandle fileDescriptor]); [task waitUntilExit]; [task release]; } </code></pre> <p><strong>EDIT</strong></p> <p>well... works fine with this code:</p> <pre><code>NSString *filePath= [[[panel URL] path] retain]; const char * cString = [filePath UTF8String]; configPath = [[NSString stringWithUTF8String:cString] retain]; </code></pre> <p>but this is not perfect method.. thought</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload