【发布时间】:2012-06-19 20:15:52
【问题描述】:
所以我有一个UIScrollView 和多个UIImageViews
我必须生成自己的滚动视图类才能利用它的touchesEnded
-(void)touchesEnded:(NSSet *)touches withEvent:(UIEvent *)event
{
// [super touchesEnded:touches withEvent:event];
UITouch *touch = [touches anyObject];
CGPoint point = [touch locationInView:self];
if ((int)(point.x / 100) < [[self items] count] ) {
NSLog(@" ENDED D File Selected is %@ %d " , [[self items] objectAtIndex:(int)(point.x / 100) ] , (int)(point.x / 100) );
}
// [[self nextResponder] touchesEnded:touches withEvent:event];
}
items 是一个NSMutableArray,我在其中存储每个子视图指向的文件的名称,所以基本上是subview[0] === item[0] 等...
subview[0] 是图像视图,item[0] 是该图像的fileName
我的问题是我现在如何“做广告”提醒原始调用者选择了文件 xyz ?与NSLog 行相反?
提前致谢
【问题讨论】:
标签: iphone objective-c ios5 uiscrollview uiimageview