久久久久久久av_日韩在线中文_看一级毛片视频_日本精品二区_成人深夜福利视频_武道仙尊动漫在线观看

<tfoot id='XMOfj'></tfoot><legend id='XMOfj'><style id='XMOfj'><dir id='XMOfj'><q id='XMOfj'></q></dir></style></legend>
        <bdo id='XMOfj'></bdo><ul id='XMOfj'></ul>

        <i id='XMOfj'><tr id='XMOfj'><dt id='XMOfj'><q id='XMOfj'><span id='XMOfj'><b id='XMOfj'><form id='XMOfj'><ins id='XMOfj'></ins><ul id='XMOfj'></ul><sub id='XMOfj'></sub></form><legend id='XMOfj'></legend><bdo id='XMOfj'><pre id='XMOfj'><center id='XMOfj'></center></pre></bdo></b><th id='XMOfj'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='XMOfj'><tfoot id='XMOfj'></tfoot><dl id='XMOfj'><fieldset id='XMOfj'></fieldset></dl></div>
      1. <small id='XMOfj'></small><noframes id='XMOfj'>

      2. 獲取包含在 NSString 中的文件的擴展名

        Get the extension of a file contained in an NSString(獲取包含在 NSString 中的文件的擴展名)

        <legend id='MhAlm'><style id='MhAlm'><dir id='MhAlm'><q id='MhAlm'></q></dir></style></legend>
          <tfoot id='MhAlm'></tfoot>
          • <i id='MhAlm'><tr id='MhAlm'><dt id='MhAlm'><q id='MhAlm'><span id='MhAlm'><b id='MhAlm'><form id='MhAlm'><ins id='MhAlm'></ins><ul id='MhAlm'></ul><sub id='MhAlm'></sub></form><legend id='MhAlm'></legend><bdo id='MhAlm'><pre id='MhAlm'><center id='MhAlm'></center></pre></bdo></b><th id='MhAlm'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='MhAlm'><tfoot id='MhAlm'></tfoot><dl id='MhAlm'><fieldset id='MhAlm'></fieldset></dl></div>
              • <bdo id='MhAlm'></bdo><ul id='MhAlm'></ul>

                  <tbody id='MhAlm'></tbody>

                1. <small id='MhAlm'></small><noframes id='MhAlm'>

                  本文介紹了獲取包含在 NSString 中的文件的擴展名的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學習吧!

                  問題描述

                  限時送ChatGPT賬號..

                  我有一個 NSMutable 字典,其中包含文件 ID 及其文件名+擴展名,格式為 fileone.doc 或 filetwo.pdf.我需要確定在我的 UITableView 中正確顯示相關圖標的文件類型.這是我到目前為止所做的.

                  I have an NSMutable dictionary that contains file IDs and their filename+extension in the simple form of fileone.doc or filetwo.pdf. I need to determine what type of file it is to correctly display a related icon in my UITableView. Here is what I have done so far.

                  NSString *docInfo = [NSString stringWithFormat:@"%d", indexPath.row]; //Determine what cell we are formatting
                  NSString *fileType = [contentFiles objectForKey:docInfo]; //Store the file name in a string
                  

                  我編寫了兩個正則表達式來確定我正在查看的文件類型,但它們從未返回肯定的結果.我之前沒有在 iOS 編程中使用過正則表達式,所以我不完全確定我是否做得對,但我基本上是從 Class Description 頁面復制了代碼.

                  I wrote two regex to determine what type of file I'm looking at, but they never return a positive result. I haven't used regex in iOS programming before, so I'm not entirely sure if I'm doing it right, but I basically copied the code from the Class Description page.

                      NSError *error = NULL;
                  NSRegularExpression *regexPDF = [NSRegularExpression regularExpressionWithPattern:@"/^.*\.pdf$/" options:NSRegularExpressionCaseInsensitive error:&error];
                  NSRegularExpression *regexDOC = [NSRegularExpression regularExpressionWithPattern:@"/^.*\.(doc|docx)$/" options:NSRegularExpressionCaseInsensitive error:&error];
                      NSUInteger numMatch = [regexPDF numberOfMatchesInString:fileType options:0 range:NSMakeRange(0, [fileType length])];
                      NSLog(@"How many matches were found? %@", numMatch);
                  

                  我的問題是,有沒有更簡單的方法來做到這一點?如果不是,我的正則表達式不正確嗎?最后,如果我必須使用它,運行時間成本高嗎?我不知道用戶平均擁有多少文件.

                  My questions would be, is there an easier way to do this? If not, are my regex incorrect? And finally if I have to use this, is it costly in run time? I don't know what the average amount of files a user will have will be.

                  謝謝.

                  推薦答案

                  你在找[fileType pathExtension]

                  NSString 文檔:pathExtension

                  這篇關于獲取包含在 NSString 中的文件的擴展名的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網!

                  【網站聲明】本站部分內容來源于互聯網,旨在幫助大家更快的解決問題,如果有圖片或者內容侵犯了您的權益,請聯系我們刪除處理,感謝您的支持!

                  相關文檔推薦

                  How to animate a UIImageview to display fullscreen by tapping on it?(如何通過點擊動畫 UIImageview 以顯示全屏?)
                  To stop segue and show alert(停止 segue 并顯示警報)
                  iOS 5 storyboard, programmatically determine path(iOS 5 故事板,以編程方式確定路徑)
                  UIProgressView and Custom Track and Progress Images (iOS 5 properties)(UIProgressView 和自定義跟蹤和進度圖像(iOS 5 屬性))
                  Semantic Issue: Property#39;s synthesized getter follows Cocoa naming convention for returning #39;owned#39; objects(語義問題:屬性的合成 getter 遵循 Cocoa 命名約定以返回“擁有對象) - IT屋-程序員軟件開發技術分享
                  Custom font is not working in my App?(自定義字體在我的應用程序中不起作用?)
                      <bdo id='LQRlk'></bdo><ul id='LQRlk'></ul>
                      <legend id='LQRlk'><style id='LQRlk'><dir id='LQRlk'><q id='LQRlk'></q></dir></style></legend>

                          <small id='LQRlk'></small><noframes id='LQRlk'>

                              <tbody id='LQRlk'></tbody>
                            <tfoot id='LQRlk'></tfoot>
                            <i id='LQRlk'><tr id='LQRlk'><dt id='LQRlk'><q id='LQRlk'><span id='LQRlk'><b id='LQRlk'><form id='LQRlk'><ins id='LQRlk'></ins><ul id='LQRlk'></ul><sub id='LQRlk'></sub></form><legend id='LQRlk'></legend><bdo id='LQRlk'><pre id='LQRlk'><center id='LQRlk'></center></pre></bdo></b><th id='LQRlk'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='LQRlk'><tfoot id='LQRlk'></tfoot><dl id='LQRlk'><fieldset id='LQRlk'></fieldset></dl></div>

                            主站蜘蛛池模板: 国产午夜精品久久久久免费视高清 | 国产精品日韩欧美一区二区三区 | 黄色欧美大片 | 在线观看www | 亚洲欧美中文字幕在线观看 | 日本涩涩网 | 91精品久久久久久久久久入口 | 免费看91 | 午夜精品久久 | 91国内精精品久久久久久婷婷 | 日本视频免费观看 | 日韩在线视频观看 | 全部免费毛片在线播放网站 | 在线观看日本网站 | 国产欧美日韩视频 | 久久国产精品72免费观看 | 视频精品一区二区三区 | 精品成人佐山爱一区二区 | 婷婷色在线 | 一区二区视频在线 | 欧美综合一区二区三区 | 成人午夜免费福利视频 | 国产一级免费视频 | 91精品国产综合久久精品 | 亚洲最大的黄色网址 | 成人在线免费 | 成人高潮片免费视频欧美 | 欧美精品久久久 | 91原创视频在线观看 | 国产亚洲精品久久久久动 | 91免费视频 | 9久久精品| 国产一区免费 | 精品国产一区二区在线 | 亚洲精品一区二区三区在线 | 亚洲国产高清高潮精品美女 | 欧美成人aaa级毛片在线视频 | 日韩中文字幕在线 | 精品在线一区二区三区 | 成人av在线播放 | 成人av在线播放 |