我找到觸點的問題。在Objective c中找到觸摸點c/cocoa touch
我有一個功能loadView()
其中我設置了16個瓷磚(16 UIImageView
)。
然後在功能:
- (void) touchesBegan:(NSSet*)touches withEvent:(UIEvent*)event
{
// Retrieve the touch point
UITouch *touch=[[event allTouches]anyObject];
CGPoint point= [touch locationInView:touch.view];
CGRect frame = [self frame]; // Error this Line
}
我已經使用幀識別哪些幀/瓦片使用幀起源按壓。
,但此行:
CGRect frame = [self frame];
讓我瘋了。有人告訴我該怎麼做(有解釋,爲什麼不工作)。 PLZ。
你爲什麼不告訴我們你得到了什麼樣的錯誤?同樣,告訴我們這個方法在 – newacct 2009-10-01 07:55:08
中是什麼類的。是的,你需要提供更多的細節讓我們能夠解決你的問題。 – 2009-10-01 12:15:01