English 中文(简体)
如何通过使用NStimer,将更多的图像(Eg: 50) j为迅速消化?
原标题:How to load more(Eg: 50) jpg images to animating quickly by using NSTimer?(Ipad)

这是我的NStimer。

   myTimer = [NSTimer scheduledTimerWithTimeInterval: 0.1 target: self
                                             selector: @selector(callRightRotation:) userInfo: nil repeats: YES];

-(void) callRightRotation:(NSTimer*)myTimer 
  {
       ImageView.tag =[ImageView tag]+1;

           if ([ImageView tag]==50) 
                ImageView.tag=1;

     [ImageView setImage:[UIImage imageNamed:[NSString stringWithFormat:@"kisok01%i.png",[ImageView tag]]]];

      if ([ImageView tag]==1 || [ImageView tag]==50 )
       {
             [myTimer invalidate];
              myTimer= nil;


        }

   }

在这里,在ipad上的图像完全有效,但使用......jpg”的近似图像,一个图像最低300kb ......

Here my questions is

     1. Is it possible loading very fast and smoothly ?
     2. if its not possible is there any alternative solution?
问题回答

你们可以使用ASIHTTPRequest,而不是一线照亮,因此,你的形象将顺利地掌握在背景中。 并且你可以与其他持同样看法的管制机构合作。

import "ASIHTTPRequest.h"

方法

[自律:......

- (避免) DownLoadImageInBackground:NSArray*

页: 1

NSURL * url = [Image URL];

ASIHTTPRequest *request = [ASIHTTPRequest requestWithURL:url];
[request setDelegate:self];
[request startAsynchronous];

iii

- (撤销) 请求

页: 1

NSLog(@"URL Fail : %@",request.url);

NSError *error = [request error];

   // you can give here alert too..

iii

- (撤销)requestFinished:ASIHTTPRequest*

页: 1

NSData *responseData = [request responseData];
UIImage *imgInBackground = [[UIImage alloc]
                     initWithData:responseData];
[imageView setImage: imgInBackground];

iii





相关问题
Code sign Error

I have created a new iPhone application.I have two mach machines. I have created the certificate for running application in iPhone in one mac. Can I use the other mac for running the application in ...

ABPersonViewController Usage for displaying contact

Created a View based Project and added a contact to the AddressBook using ABAddressBookRef,ABRecordRef now i wanted to display the added contact ABPersonViewController is the method but how to use in ...

将音频Clips从Peter改为服务器

我不禁要问,那里是否有任何实例表明从Peit向服务器发送音响。 I m不关心电话或SIP风格的解决办法,只是一个简单的袖珍流程......

• 如何将搜查线重新定位?

我正试图把图像放在搜索条左边。 但是,问题始于这里,搜索条线不能重新布署。

热门标签