在我的应用程序中,我有一个上下文,我正在使用 NSTimer 更改 UIButton 的图像,如下所示
[NSTimer scheduledTimerWithTimeInterval:5.0 target:self selector:@selector(LoadImageToTheAdButton) userInfo:nil repeats:YES];
-(void)LoadImageToTheAdButton
{
NSString *strPath = [arrPaths objectAtIndex:0];
strPath = [strPath stringByAppendingPathComponent:@"Folder"];
strPath = [strPath stringByAppendingPathComponent:[arrAdImgNames objectAtIndex:intAdImgIndex]];
UIImage *imgForAdBtn = [[UIImage alloc]initWithContentsOfFile:strPath];
[btnAd setBackgroundImage:imgForAdBtn forState:UIControlStateNormal];
if(intAdImgIndex < [arrAdImgNames count]-1)
{
intAdImgIndex++;
}
else
{
intAdImgIndex = 0;
}
}
现在点击按钮*我需要知道按钮上设置了哪个图像我的意思是,我需要图像名称*
我需要它,因为基于该图像我正在加载一些链接,
怎么办啊,哪位大侠帮帮我,
提前致谢