我是iphone编程新手。我从.m文件中获取此代码(代码段)。当我尝试xcode项目时,我得到了一些我不理解的错误。
-(BOOL)setUp:(BOOL)startImmediate
{
[self saveDownloadInfo];
if (startImmediate)
{
bar = [UIDownloadBar initWithProgressBarFrame:CGRectMake(0, 17.0, 50, 11.0)
delegate:self];
[bar setProgressViewStyle:UIProgressViewStyleBar];
[bar beginDownloadWithURL:[NSURL URLWithString:[self FileUrl]] timeout:600 fileName:[self FileTitle]];
}
else
{
bar = [UIDownloadBar initWithProgressBarFrame:CGRectMake(140.0, 36.0, 130.0, 11.0)
delegate:self];
[bar setProgressViewStyle:UIProgressViewStyleDefault];
[bar beginDownloadWithURL:[NSURL URLWithString:[self FileUrl]] timeout:600 fileName:[self FileTitle]];
}
if ([self.orgYTLink length] >0) bar.orgYTLink = self.orgYTLink;
return YES;
}
-(void)setUpWithPausedDownload:(long long)expectedBytes ReceivedBytes:(float)bytesReceived
{
bar = [UIDownloadBar initWithProgressBarFrame:CGRectMake(140.0, 36, 130.0, 11.0)
delegate:self];
[bar setProgressViewStyle:UIProgressViewStyleDefault];
bar.expectedBytes = expectedBytes;
bar.bytesReceived = bytesReceived;
if (expectedBytes >0) // The download was indeed paused rather than just queued in which case it should have been 0
{
[bar forceStop];
// Read the contents of file into the receivedData
// bar.receivedData = [self loadQueuedOrPausedItemContents];
bar.progress = ((bytesReceived/(float)expectedBytes)*100)/100;
}
bar.orgYTLink = self.orgYTLink;
}
错误报告:
知道为什么它会给我这个错误吗? 提前谢谢。