iOS study Day 11-IO中可能會用到的常量

來源:互聯網
上載者:User

#import int main(int argc, const char * argv[]){    @autoreleasepool    {                //擷取程式根目錄        NSString * filepath = NSHomeDirectory();        NSLog(@"filepath程式根目錄: %@", filepath);        //擷取Documents目錄        NSArray* paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);        NSString* thepath = [paths lastObject];        NSLog(@"Documents目錄:%@", thepath);        //擷取使用者案頭目錄        paths = NSSearchPathForDirectoriesInDomains(NSDesktopDirectory, NSUserDomainMask, YES);        thepath = [paths lastObject];        NSLog(@"案頭目錄:%@", thepath);        //擷取使用者Library目錄        paths = NSSearchPathForDirectoriesInDomains(NSLibraryDirectory, NSUserDomainMask, YES);        thepath = [paths lastObject];        NSLog(@"Library目錄:%@", thepath);        //擷取使用者案頭目錄        paths = NSSearchPathForDirectoriesInDomains(NSCachesDirectory, NSUserDomainMask, YES);        thepath = [paths lastObject];        NSLog(@"案頭目錄:%@", thepath);        //擷取臨時檔案夾路徑        thepath = NSTemporaryDirectory();        NSLog(@"臨時目錄:%@", thepath);                //        得到數組的每一個值        paths = [thepath pathComponents];        for (int i=0; i
        //        NSApplicationDirectory = 1,             // supported applications (Applications)//        NSDemoApplicationDirectory,             // unsupported applications, demonstration versions (Demos)//        NSDeveloperApplicationDirectory,        // developer applications (Developer/Applications). DEPRECATED - there is no one single Developer directory.//        NSAdminApplicationDirectory,            // system and network administration applications (Administration)//        NSLibraryDirectory,                     // various documentation, support, and configuration files, resources (Library)//        NSDeveloperDirectory,                   // developer resources (Developer) DEPRECATED - there is no one single Developer directory.//        NSUserDirectory,                        // user home directories (Users)//        NSDocumentationDirectory,               // documentation (Documentation)//        NSDocumentDirectory,                    // documents (Documents)//        NSCoreServiceDirectory,                 // location of CoreServices directory (System/Library/CoreServices)//        NSAutosavedInformationDirectory NS_ENUM_AVAILABLE(10_6, 4_0) = 11,   // location of autosaved documents (Documents/Autosaved)//        NSDesktopDirectory = 12,                // location of user's desktop//        NSCachesDirectory = 13,                 // location of discardable cache files (Library/Caches)//        NSApplicationSupportDirectory = 14,     // location of application support files (plug-ins, etc) (Library/Application Support)//        NSDownloadsDirectory NS_ENUM_AVAILABLE(10_5, 2_0) = 15,              // location of the user's "Downloads" directory//        NSInputMethodsDirectory NS_ENUM_AVAILABLE(10_6, 4_0) = 16,           // input methods (Library/Input Methods)//        NSMoviesDirectory NS_ENUM_AVAILABLE(10_6, 4_0) = 17,                 // location of user's Movies directory (~/Movies)//        NSMusicDirectory NS_ENUM_AVAILABLE(10_6, 4_0) = 18,                  // location of user's Music directory (~/Music)//        NSPicturesDirectory NS_ENUM_AVAILABLE(10_6, 4_0) = 19,               // location of user's Pictures directory (~/Pictures)//        NSPrinterDescriptionDirectory NS_ENUM_AVAILABLE(10_6, 4_0) = 20,     // location of system's PPDs directory (Library/Printers/PPDs)//        NSSharedPublicDirectory NS_ENUM_AVAILABLE(10_6, 4_0) = 21,           // location of user's Public sharing directory (~/Public)//        NSPreferencePanesDirectory NS_ENUM_AVAILABLE(10_6, 4_0) = 22,        // location of the PreferencePanes directory for use with System Preferences (Library/PreferencePanes)//        NSApplicationScriptsDirectory NS_ENUM_AVAILABLE(10_8, NA) = 23,      // location of the user scripts folder for the calling application (~/Library/Application Scripts/code-signing-id)//        NSItemReplacementDirectory NS_ENUM_AVAILABLE(10_6, 4_0) = 99,    // For use with NSFileManager's URLForDirectory:inDomain:appropriateForURL:create:error://        NSAllApplicationsDirectory = 100,       // all directories where applications can occur//        NSAllLibrariesDirectory = 101,          // all directories where resources can occur//        NSTrashDirectory NS_ENUM_AVAILABLE(10_8, NA) = 102                   // location of Trash directory                                    }    return 0;}

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.