私のアプリでは、次のように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;
}
}
ボタンをクリックすると*ボタンにどの画像が設定されているかを知る必要があります。つまり、画像名が必要です*
その画像に基づいていくつかのリンクを読み込んでいるので、それが必要です。
どうすればそれを行うことができますか?
前もって感謝します