실행순서

start or main -> isFinished -> YES -> stop
                                       -> NO -> suspended


@interface TestQueue : NSOperation {

 NSString * i_Id;
 NSOperationQueue * i_queue;
}

-(id)initWithId:(NSString *)qid inOperationQueue:(NSOperationQueue *) queue;

@end


@implementation TestQueue
-(id)initWithId:(NSString *)qid inOperationQueue:(NSOperationQueue *) queue
{
 if(self=[super init])
 {
  i_Id = qid;
  i_queue = [queue retain];
 }
 
 return self;
}
- (void)main
{
 NSLog(@"[%d] Queue Main : %@",[i_queue operationCount], i_Id);
 return;
}
/*
- (void)start
{
 NSLog(@"Queue Start : %@", i_Id);
}*/
- (void)stop
{
 NSLog(@"Queue Stop : %@", i_Id);
}
- (void)dealloc
{
    [i_queue release];  
 
 [super dealloc];
}
- (void)cancel
{
 NSLog(@"Queue Cancel : %@", i_Id);
 
 [super cancel];
}
- (BOOL)isFinished
{
 NSLog(@"Queue Finished : %@", i_Id);
 
 return YES;
}

@end

'iOS' 카테고리의 다른 글

Custom UINavigationController  (0) 2011.01.24
iPhone TestCase 생성  (0) 2011.01.18
NSOperationQueue  (0) 2011.01.10
NSNotificationCenter  (0) 2011.01.05
NSSearchPathForDirectoriesInDomains  (0) 2011.01.05

+ Recent posts