__NSCFNumber assetWriterInput error
<p>Here are my codes</p>

<pre><code>-(void) WriteToMovieAtPath 
{ 
NSLog(@"Write Started");
//1 Wire the writer
NSError *error = nil;

videoWriter = [[AVAssetWriter alloc] initWithURL:
                              [NSURL fileURLWithPath:[self getVideoPath  ]] fileType:AVFileTypeQuickTimeMovie
                                                          error:&amp;error];
NSParameterAssert(videoWriter);

videoSettings = [NSDictionary dictionaryWithObjectsAndKeys:
                               AVVideoCodecH264, AVVideoCodecKey,
                               [NSNumber numberWithInt:_videoSize.width], AVVideoWidthKey,
                               [NSNumber numberWithInt:_videoSize.height], AVVideoHeightKey,
                               nil];

videoWriterInput = [[AVAssetWriterInput
                                         assetWriterInputWithMediaType:AVMediaTypeVideo
                                         outputSettings:videoSettings] retain];



////////////
adaptor = [AVAssetWriterInputPixelBufferAdaptor
                                                 assetWriterInputPixelBufferAdaptorWithAssetWriterInput:videoWriterInput
                                                 sourcePixelBufferAttributes:nil];

NSParameterAssert(videoWriterInput);
NSParameterAssert([videoWriter canAddInput:videoWriterInput]);
videoWriterInput.expectsMediaDataInRealTime = YES;
[videoWriter addInput:videoWriterInput];

//2 Start a session:
[videoWriter startWriting];
[videoWriter startSessionAtSourceTime:kCMTimeZero];


//convert uiimage to CGImage.


if ( adaptor.assetWriterInput.readyForMoreMediaData)//breakpoint a
{
    printf("ok");
}

}
</code></pre>

<p>it works, but if I move lines</p>

<pre><code>    if ( adaptor.assetWriterInput.readyForMoreMediaData)//breakpoint a
{
    printf("ok");
}
</code></pre>

<p>outside the function, when excute adaptor.assetWriterInput.readyForMoreMediaData, it always reports</p>

<pre><code>*** Terminating app due to uncaught exception 'NSInvalidArgumentException', 
reason: '-[__NSCFNumber assetWriterInput]: unrecognized selector sent 
to instance 0x9d6db40'
</code></pre>

<p>I try to use Zombie to locate error, it displays </p>

<pre><code>adaptor = [AVAssetWriterInputPixelBufferAdaptor

assetWriterInputPixelBufferAdaptorWithAssetWriterInput:videoWriterInput
                                                 sourcePixelBufferAttributes:nil];
</code></pre>

<p>autoreleased, if I call outside the function, it will cause Zombie</p>

<p>Welcome any comment</p>
