小编Sow*_*mya的帖子

目标c,检查文件存在于路径中

我在iPhone项目中使用Objective-C创建了一个屏幕.在那里,有2个按钮(比如A和B).在单击按钮A时,将在文件夹(例如INBOX)中创建一个xml文件.

我的问题是,我只有在文件夹INBOX中不存在时才需要创建文件.我怎样才能做到这一点?任何人都可以告诉我语法吗?

iphone objective-c

56
推荐指数
1
解决办法
4万
查看次数

更改if else切换字符串

如何使用switch case而不是编写以下方法if else

public void startElement(String uri, String localName, String qName,
    Attributes attributes) throws SAXException 
{

    currentElement = true;

    if (localName.equals("maintag"))
    {
        /** Start */ 
        sitesList = new SitesList();
    } else if (localName.equals("website")) {
        /** Get attribute value */
        String attr = attributes.getValue("category");
        sitesList.setCategory(attr);
    }

}
Run Code Online (Sandbox Code Playgroud)

java if-statement switch-statement

3
推荐指数
2
解决办法
1万
查看次数