将数组写入Plist文件中

时间:2022-12-14 13:58:01

-(void)writeToPlist:(NSArray *)uploadingfiles  Name:(NSString *)name

{

        

        NSMutableArray *sList = [[NSMutableArray alloc ]initWithCapacity:[uploadingfiles count] * 2];

        

        for(uploadfile* tmp in uploadingfiles)  

        {

            if(tmp.filename)

                [sList addObject :tmp.filename];

            else {

                [sList addObject :@""];

            }

            if(tmp.filesize)

                [sList addObject :tmp.filesize];

            else {

                [sList addObject :@""];

            }       

        }

        

        [sList writeToFile:getFullPath(name) atomically:YES];

        

}