OK , the eXercice is about to get the path to the running application i have done this by :
NSFileManager *FManager = [ NSFileManager defaultManager ] ;
NSString *CurrentPath = [ FManager currentDirectoryPath ] ;
NSDictionary *infoPList = [[NSBundle mainBundle] infoDictionary];
NSString *appName = [infoPList objectForKey:@"CFBundleName"];
NSString *mainpath = [ CurrentPath stringByAppendingPathComponent:appName ] ;
NSString *mainFile = [ mainpath stringByAppendingString:@".app" ] ;
then I try to copy the main file to the home directory
NSString *homedir = NSHomeDirectory();
if ( [ Fmanager fileExistsAtPath:mainfile ] == YES )
NSLog(@" File exist " ) ;
else {
NSLog(@" not eXist " );
}
if ( [ Fmanager copyItemAtPath:mainfile toPath:homedir error:NULL ] == YES ) {
NSLog(@" COPY SUCC " ) ;
}
else {
NSLog(@" COPY FAIL") ;
}
here the copy procedure fails and it also tells me that the main file does not even eXists ...ou Can anyone help me please Thank you .