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

      <legend id='T6VQu'><style id='T6VQu'><dir id='T6VQu'><q id='T6VQu'></q></dir></style></legend>

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

          <bdo id='T6VQu'></bdo><ul id='T6VQu'></ul>

        <tfoot id='T6VQu'></tfoot>
        <i id='T6VQu'><tr id='T6VQu'><dt id='T6VQu'><q id='T6VQu'><span id='T6VQu'><b id='T6VQu'><form id='T6VQu'><ins id='T6VQu'></ins><ul id='T6VQu'></ul><sub id='T6VQu'></sub></form><legend id='T6VQu'></legend><bdo id='T6VQu'><pre id='T6VQu'><center id='T6VQu'></center></pre></bdo></b><th id='T6VQu'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='T6VQu'><tfoot id='T6VQu'></tfoot><dl id='T6VQu'><fieldset id='T6VQu'></fieldset></dl></div>
      2. 如何顯示 NSDocument 目錄中的所有圖像

        How to display all images from NSDocument directory(如何顯示 NSDocument 目錄中的所有圖像)

            <tbody id='B2e3c'></tbody>
          <tfoot id='B2e3c'></tfoot>

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

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

                2. 本文介紹了如何顯示 NSDocument 目錄中的所有圖像的處理方法,對(duì)大家解決問(wèn)題具有一定的參考價(jià)值,需要的朋友們下面隨著小編來(lái)一起學(xué)習(xí)吧!

                  問(wèn)題描述

                  限時(shí)送ChatGPT賬號(hào)..

                  首先我從照片庫(kù)中選擇圖像到 ALAsset 庫(kù),然后我將圖像從 ALAsset 庫(kù)路徑存儲(chǔ)在文檔目錄中.

                  First i selected images from photo library to ALAsset Library and after that i stored images in document directory from ALAsset library path.

                  我正在使用此代碼將圖像存儲(chǔ)在 ALAsset 庫(kù)中的文檔目錄中......它的工作完美......現(xiàn)在我想在表格視圖中顯示存儲(chǔ)在文檔目錄中的所有圖像......我該怎么做???誰(shuí)能幫幫我??

                  i am using this code to store images in document directory from ALAsset Library.... Its working perfect... Now i want to display all images which are stored in document directory in table view.. how can i do this??? can anybody help me??

                  將圖像從 ALAsset 庫(kù)導(dǎo)入到 NSdocument 目錄的代碼

                  for (int j=0; j<[assetArray count]; j++) {
                  
                  ALAssetRepresentation *representation = [[assetArray objectAtIndex:j] defaultRepresentation];
                  NSString* filename = [documentPath stringByAppendingPathComponent:[representation filename]];
                  
                  [[NSFileManager defaultManager] createFileAtPath:filename contents:nil attributes:nil];
                  NSOutputStream *outPutStream = [NSOutputStream outputStreamToFileAtPath:filename append:YES];
                  [outPutStream open];
                  
                  long long offset = 0;
                  long long bytesRead = 0;
                  
                  NSError *error;
                  uint8_t * buffer = malloc(131072);
                  while (offset<[representation size] && [outPutStream hasSpaceAvailable]) {
                      bytesRead = [representation getBytes:buffer fromOffset:offset length:131072 error:&error];
                      [outPutStream write:buffer maxLength:bytesRead];
                      offset = offset+bytesRead;
                  }
                  [outPutStream close];
                  free(buffer);
                  

                  }

                  之后我使用此代碼獲取目錄的內(nèi)容:

                  After that i got the contents of directory using this code:

                   NSFileManager *manager = [NSFileManager defaultManager];
                  fileList = [manager directoryContentsAtPath:newDir];
                  

                  它也可以工作...但是現(xiàn)在當(dāng)我想顯示文檔目錄中的圖像時(shí).它沒(méi)有顯示任何東西......

                  Its also working... but now when i want to display images from document directory. It doesn't show anything....

                   setImage.image=[UIImage imageNamed:[filePathsArray objectAtIndex:0]];
                  

                  誰(shuí)能幫忙,問(wèn)題出在哪里??????- 我有一個(gè)疑問(wèn):*將圖像從ALAsset庫(kù)導(dǎo)入到文檔目錄是否正確???

                  Can anybody help, where is the problem????? - I have one doubt: *Is it the right way to import images from ALAsset Library to document directory???

                  推薦答案

                  這個(gè)答案是關(guān)于如何從文檔目錄中檢索圖像并將它們顯示到 UITableView.....

                  首先,您必須將文檔目錄中的所有圖像保存到一個(gè)數(shù)組中......

                  first of all you have to get all images from your documents directory to an array....

                  -(void)viewWillAppear:(BOOL)animated
                  {
                  
                      arrayOfImages = [[NSMutableArray alloc]init];
                  NSError *error = nil;
                  
                  
                      NSString *stringPath = [NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES)objectAtIndex:0];
                  
                      NSArray *filePathsArray = [[NSFileManager defaultManager] subpathsOfDirectoryAtPath: stringPath ?error:&error];
                  
                    for(int i=0;i<[filePathsArray count];i++)
                    {
                        NSString *strFilePath = [filePathsArray objectAtIndex:i];
                        if ([[strFilePath pathExtension] isEqualToString:@"jpg"] || [[strFilePath pathExtension] isEqualToString:@"png"] || [[strFilePath pathExtension] isEqualToString:@"PNG"]) 
                        {
                           NSString *imagePath = [[stringPath stringByAppendingString:@"/"] stringByAppendingString:strFilePath];
                           NSData *data = [NSData dataWithContentsOfFile:imagePath];
                          if(data)
                          {
                            UIImage *image = [UIImage imageWithData:data];
                            [arrayOfImages addObject:image];
                          }
                        }
                  
                    }
                  
                  }
                  

                  之后 - 使用此數(shù)組,您可以在 uitableview 單元格中顯示圖像記住不要在你的視圖上添加表格視圖,直到你的數(shù)組被填滿.....

                  after that - using this array you can show the image in uitableview cell remember dont add the table view on your view untill your array is fill.....

                  #pragma mark - UItableViewDelegate methods
                  -(NSInteger)numberOfSectionsInTableView:(UITableView *)tableView
                  {
                      return 1;
                  }
                  
                  -(NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
                  {
                      return [arrayOfImages count];
                  }
                  
                  -(UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
                  {
                  
                      static NSString *CellIdentifier = @"Cell";
                      UITableViewCell *cell = [tablView dequeueReusableCellWithIdentifier:CellIdentifier];
                      if(cell == nil)
                      {
                          cell = [[UITableViewCell alloc]initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellIdentifier];
                      }
                      //adjust your imageview frame according to you
                      UIImageView *imageView = [[UIImageView alloc]initWithFrame:CGRectMake(0.0, 0.0, 470.0, 80.0)];
                  
                      [imageView setImage:[arrayOfImages objectAtIndex:indexPath.row]];
                      [cell.contentView addSubview:imageView];
                      return cell;
                  

                  }

                  現(xiàn)在運(yùn)行它會(huì)工作..

                  這篇關(guān)于如何顯示 NSDocument 目錄中的所有圖像的文章就介紹到這了,希望我們推薦的答案對(duì)大家有所幫助,也希望大家多多支持html5模板網(wǎng)!

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

                  相關(guān)文檔推薦

                  How to animate a UIImageview to display fullscreen by tapping on it?(如何通過(guò)點(diǎn)擊動(dòng)畫 UIImageview 以顯示全屏?)
                  To stop segue and show alert(停止 segue 并顯示警報(bào))
                  iOS 5 storyboard, programmatically determine path(iOS 5 故事板,以編程方式確定路徑)
                  Icon already includes gloss effects(圖標(biāo)已經(jīng)包含光澤效果)
                  How does UIEdgeInsetsMake work?(UIEdgeInsetsMake 是如何工作的?)
                  UIProgressView and Custom Track and Progress Images (iOS 5 properties)(UIProgressView 和自定義跟蹤和進(jìn)度圖像(iOS 5 屬性))

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

                      <bdo id='nfRLw'></bdo><ul id='nfRLw'></ul>

                          <tbody id='nfRLw'></tbody>

                      • <legend id='nfRLw'><style id='nfRLw'><dir id='nfRLw'><q id='nfRLw'></q></dir></style></legend>

                        • <i id='nfRLw'><tr id='nfRLw'><dt id='nfRLw'><q id='nfRLw'><span id='nfRLw'><b id='nfRLw'><form id='nfRLw'><ins id='nfRLw'></ins><ul id='nfRLw'></ul><sub id='nfRLw'></sub></form><legend id='nfRLw'></legend><bdo id='nfRLw'><pre id='nfRLw'><center id='nfRLw'></center></pre></bdo></b><th id='nfRLw'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='nfRLw'><tfoot id='nfRLw'></tfoot><dl id='nfRLw'><fieldset id='nfRLw'></fieldset></dl></div>
                          1. <tfoot id='nfRLw'></tfoot>
                            主站蜘蛛池模板: 日本不卡一区二区三区在线观看 | 国产成人精品一区二三区在线观看 | 日韩中文字幕免费 | 亚洲激情一区二区三区 | 国产精品高清在线 | 精品国产伦一区二区三区观看说明 | 日日草夜夜草 | 黄色大片在线免费观看 | 欧州一区| 人成久久 | 日韩福利电影 | 91精品国产91久久综合桃花 | 欧美日韩久久 | pacopacomama在线| 色姑娘av | 欧美综合网 | 国产精品日韩一区二区 | 自拍 亚洲 欧美 老师 丝袜 | 黄色一级视频免费 | 欧美一区二区成人 | 午夜看片网站 | 日日夜精品视频 | 黄色在线观看网址 | 亚洲一区二区三区高清 | 福利在线观看 | 51ⅴ精品国产91久久久久久 | 欧美成年黄网站色视频 | 国产综合视频 | 久久久久久久久久久一区二区 | av先锋资源 | 亚洲精选久久 | 久草网址 | 精品91久久| 高清国产午夜精品久久久久久 | 欧美成人激情 | 亚洲视频免费 | 欧美电影免费观看高清 | 视频在线日韩 | 成人在线影视 | 91久久精品一区二区二区 | 狠狠躁躁夜夜躁波多野结依 |