Being new to objective-C but tinkering I was trying out dragging with the iPad, and the following code from my viewcontroller.m works okay in portrait, but not in landscape:
-(void) touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event {
UITouch *touch = [[event allTouches] anyObject];
CGPoint location = [touch locationInView:mainView.superview];
testViewToMove.center = location;
}
-(void)touchesMoved:(NSSet *)touches withEvent:(UIEvent *)event {
[self touchesBegan:touches withEvent:event];
}
mainView being the default view that was created with the app, and testViewToMove being a UIView I made for kicks.
In landscape, the coordinates don't seem to translate. I'm sure this is something obvious, but I don't get it, what's going on here?
I tried setting the view to landscape, and tinkering with some other settings to no avail... I also saw this, but to my own dismay I haven't been able to get it to work.