Advertise Mobile SDKs Books Events Forum News Social Networking Support Us
Follow @iphonedevsdk on Twitter

Mockup & CodeGen, iPhone & iPad
($9.99)

Make your own iPhone apps
and run them live!
(free)

Manu
($0.99)

Want your application or service advertised on iPhone Dev SDK?

Go Back   iPhone Dev SDK Forum

View Single Post
Old 07-27-2010, 11:31 AM   #1 (permalink)
KiKaL
Registered Member
 
Join Date: Jul 2010
Posts: 3
Default Trouble Writing to pList file

I am trying to append to an array plist but have been unsuccessful. I'm not sure what I'm doing wrong. I don't get any errors but it doesn't append the test string.



PHP Code:
-(NSString *) saveFilePath
{
    
NSArray *pathArray =
    
NSSearchPathForDirectoriesInDomains(NSDocumentDirectoryNSUserDomainMaskYES);

    return [[
pathArray objectAtIndex:0stringByAppendingPathComponent:@"project.plist"];
}

// Implement viewDidLoad to do additional setup after loading the view, typically from a nib.
- (void)viewDidLoad {
    
NSString *myPath = [self saveFilePath];
    
NSString *test = @"Code";
    
NSMutableArray *values = [[NSMutableArray allocinitWithContentsOfFile:myPath];
        [
values addObject:test];   
        [
values writeToFile:[self saveFilePathatomically:YES];
        [
values release];

    [
super viewDidLoad];

KiKaL is offline   Reply With Quote
 

» Advertisements
» Stats
Members: 158,852
Threads: 89,216
Posts: 380,666
Top Poster: BrianSlick (7,129)
Welcome to our newest member, syrreintyia1
Powered by vBadvanced CMPS v3.1.0

All times are GMT -5. The time now is 04:56 AM.
Powered by vBulletin® Version 3.8.0
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.