clang静态分析警告:Object autorelease too many times
问题代码块
MusicFeeAuthQueryingPopView *queryView = [[MusicFeeAuthQueryingPopView alloc] initwithMusicId:mediaItem.persistentId authType:KWMFAuthorityPlay resourceType:KWMFResourceTypeAudio];
[queryView show:nil sipState:NO];
[queryView doModal];
[queryView autorelease];
if (queryView.resultUserCancel )
return NO;
if ([queryView resultAuthCheckSuccessWithOperation:causeType])
return YES;
KWMusicFeeOneItem * feeOneItem = [queryView resultFirstFeeSong:causeType];
当把MusicFeeAuthQueryingPopView的initwithMusicId改称initWithMusicId ,即符合initWith的命名格式,再次用clang分析,告警消失.
如果打开clang的详细分析结果,会发现小写的initwithMusicId返回的是引用计数0的对象(clang的分析错误,不是运行时结果)