独角兽企业重金招聘Python工程师标准>>>
[operationQueue addOperation:[AsyncOperation operationWithString:imageStr view:self order:i]]; //调用
/
@interface AsyncOperation : NSOperation
-(id)initWithString:(NSString *)imgStr view:(YHNavImageView *)view order:(NSInteger)order;
+(id)operationWithString:(NSString *)imgStr view:(YHNavImageView *)view order:(NSInteger)order;
@end
@implementation AsyncOperation
-(id)init
{
[self release];
[NSException raise:NSInternalInconsistencyException format:@"%@: must be initialized with a layer (use -initWithLayer:)", NSStringFromClass([self class])];
return nil;
}
-(id)initWithString:(NSString *)imgStr view:(YHNavImageView *)view order:(NSInteger)order {
self = [super init];
if(self != nil)
{
//队列中要干的事儿
}
return self;
}
+(id)operationWithString:(NSString *)imgStr view:(YHNavImageView *)view order:(NSInteger)order {
return [[[self alloc] initWithString:imgStr view:view order:order] autorelease];
}
-(void)dealloc {
[super dealloc];
}
@end
/