Basic Drag and Drop in iOS

Assume you have a UIView scene with a background image and many vehicles, you may define each new vehicle as a UIButton (UIImageView will probably work too): UIButton *button = [UIButton buttonWithType:UIButtonTypeCustom]; [button addTarget:self action:@selector(imageTouch:withEvent:) forControlEvents:UIControlEventTouchDown]; [button addTarget:self action:@selector(imageMoved:withEvent:) forControlEvents:UIControlEventTouchDragInside]; [button setImage:[UIImage imageNamed:@”vehicle.png”] forState:UIControlStateNormal]; [self.view addSubview:button]; Then you may move the vehicle wherever you want, … Read more

Can I edit an iPad’s host file?

The previous answer is correct, but if the effect you are looking for is to redirect HTTP traffic for a domain to another IP there is a way. Since it technically is not answering your question, I have asked and answered the question here: How can I redirect HTTP requests made from an iPad?

Supported orientations has no common orientation with the application, and shouldAutorotate is returning YES’

In IOS6 you have supported interface orientations in three places: The .plist (or Target Summary Screen) Your UIApplicationDelegate The UIViewController that is being displayed If you are getting this error it is most likely because the view you are loading in your UIPopover only supports portrait mode. This can be caused by Game Center, iAd, … Read more

Is it possible to force ignore the :hover pseudoclass for iPhone/iPad users?

I found that “:hover” is unpredictable in iPhone/iPad Safari. Sometimes tap on element make that element “:hover”, while sometimes it drifts to other elements. For the time being, I just have a “no-touch” class at body. <body class=”yui3-skin-sam no-touch”> … </body> And have all CSS rules with “:hover” below “.no-touch”: .no-touch my:hover{ color: red; } … Read more

How do I reset the scale/zoom of a web app on an orientation change on the iPhone?

Jeremy Keith (@adactio) has a good solution for this on his blog Orientation and scale Keep the Markup scalable by not setting a maximum-scale in markup. <meta name=”viewport” content=”width=device-width, initial-scale=1″> Then disable scalability with javascript on load until gesturestart when you allow scalability again with this script: if (navigator.userAgent.match(/iPhone/i) || navigator.userAgent.match(/iPad/i)) { var viewportmeta = … Read more

How to get UILabel to respond to tap?

You can add a UITapGestureRecognizer instance to your UILabel. For example: UITapGestureRecognizer *tapGestureRecognizer = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(labelTapped)]; tapGestureRecognizer.numberOfTapsRequired = 1; [myLabel addGestureRecognizer:tapGestureRecognizer]; myLabel.userInteractionEnabled = YES;

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