You are writing to a folder that is under admin rights.
Instead write to the user directory: ~/Library/Preferences/myFile.plist
Or make use of the NSUserDefaults class.

Filip van der Meeren
fi...@code2develop.com
http://www.sourceforge.net/projects/perlmanager
http://www.sourceforge.net/projects/xlinterpreter

On 15 Dec 2008, at 11:25, Macarov Anatoli wrote:

I have got my own bundle that I insert into login window. When login window is started up the bundle writes necessary parametr into file which is situated in /Library/Preferences/. I try to write in the following way:
NSString *Value;
NSDictionary *theDict = [NSDictionary dictionaryWithObjectsAndKeys: Value, @"Type", nil]; if([theDict writeToFile:@"/Library/Preferences/myFile.plist" atomically:NO]){ NSString *sString = [NSString stringWithFormat:@"Saving the file Preferences"];
            const char *err = [sString UTF8String];
            syslog(0,err);
        }else{
NSString *sString = [NSString stringWithFormat:@"There was a problem saving the file Preferences"];
            const char *err = [sString UTF8String];
            syslog(0,err);
        }

Gives the message Error in Writing. This code works fine in application. What is another way to write into file?



     ________________________________________________________
Вы уже с Yahoo!?
Испытайте обновленную и улучшенную. Yahoo! Почту! http://ru.mail.yahoo.com
_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/filip%40code2develop.com

This email sent to fi...@code2develop.com

_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to