How to use UIPanGestureRecognizer to move object? iPhone/iPad

I found the tutorial Working with UIGestureRecognizers, and I think that is what I am looking for. It helped me come up with the following solution: -(IBAction) someMethod { UIPanGestureRecognizer *panRecognizer = [[UIPanGestureRecognizer alloc] initWithTarget:self action:@selector(move:)]; [panRecognizer setMinimumNumberOfTouches:1]; [panRecognizer setMaximumNumberOfTouches:1]; [ViewMain addGestureRecognizer:panRecognizer]; [panRecognizer release]; } -(void)move:(UIPanGestureRecognizer*)sender { [self.view bringSubviewToFront:sender.view]; CGPoint translatedPoint = [sender translationInView:sender.view.superview]; if … Read more

IPhone/IPad: How to get screen width programmatically?

Take a look at UIScreen. eg. CGFloat width = [UIScreen mainScreen].bounds.size.width; Take a look at the applicationFrame property if you don’t want the status bar included (won’t affect the width). UPDATE: It turns out UIScreen (-bounds or -applicationFrame) doesn’t take into account the current interface orientation. A more correct approach would be to ask your … Read more

iPhone OS Memory Warnings. What Do The Different Levels Mean?

Memory level warnings are logged by SpringBoard. As an app developer you don’t need to care about it. Just responding to -{application}didReceiveMemoryWarning is enough. There are 4 levels of warnings (0 to 3). These are set from the kernel memory watcher, and can be obtained by the not-so-public function OSMemoryNotificationCurrentLevel(). typedef enum { OSMemoryNotificationLevelAny = … Read more

is there any way to distribute ios applications outside app store?

There are several possibilities, which probably won’t match your needs: Since last month it’s possible to test apps on a device without the need of a paid membership. There’s a possibility to deploy an app through a service like TestFlight, but this needs either a profile installed on the device (like HockeyApp) or always new … Read more

ActionSheet not working iPad

You need to provide a source view or button just before presenting optionMenu since on iPad its a UIPopoverPresentationController, As it says in your error. This just means that your action sheet points to the button letting the user know where it started from. For example if you’re presenting your optionMenu by tapping on the … Read more

window.onbeforeunload not working on the iPad?

This bit of JavaScript works for me on Safari and Chrome on ipad and iphone, as well as desktop/laptop/other browsers: var isOnIOS = navigator.userAgent.match(/iPad/i)|| navigator.userAgent.match(/iPhone/i); var eventName = isOnIOS ? “pagehide” : “beforeunload”; window.addEventListener(eventName, function (event) { window.event.cancelBubble = true; // Don’t know if this works on iOS but it might! … } );

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)