iPhone开发 判断文件是否存在

//判断文件是否存在

    if(![c judgeFileExist:@"user.plist"])        

    {

        NSLog(@"请确认该文件是否存在!");

        return;

    }



//判断文件是否存在

-(BOOL)judgeFileExist:(NSString * )fileName

{

    //获取文件路径

    NSString *path = [[NSBundle mainBundle] pathForResource:fileName ofType:@""];

    if(path==NULL)

        return NO;

    returnYES;

}

posted @ 2012-02-27 14:55  凡娃软件  阅读(630)  评论(0编辑  收藏  举报