Manually triggering the iPhone/iPad/iPod keyboard from JavaScript

If your code is executed via something that was initiated via a user action then it will work. E.g; this works (pops keyboard): <input type=”text” id=’foo’><div onclick=’$(“#foo”).focus();’>click</div> this doesn’t work (input gets a border but no keyboard pop): <input type=”text” id=’foo’> <script> window.onload = function() { $(“#foo”).focus(); } </script>

How does one get UI_USER_INTERFACE_IDIOM() to work with iPhone OS SDK < 3.2

I do this to get the code to compile in both 3.1.3 and 3.2: BOOL iPad = NO; #ifdef UI_USER_INTERFACE_IDIOM iPad = (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad); #endif if (iPad) { // iPad specific code here } else { // iPhone/iPod specific code here } I also wrote a quick blog post about it here: http://www.programbles.com/2010/04/03/compiling-conditional-code-in-universal-iphone-ipad-applications/

API to determine whether running on iPhone or iPad [duplicate]

Checkout UI_USER_INTERFACE_IDIOM. Returns the interface idiom supported by the current device. Return Value UIUserInterfaceIdiomPhone if the device is an iPhone or iPod touch or UIUserInterfaceIdiomPad if the device is an iPad. UIUserInterfaceIdiom The type of interface that should be used on the current device typedef enum { UIUserInterfaceIdiomPhone, UIUserInterfaceIdiomPad, } UIUserInterfaceIdiom;

iPhone : How to set BackgroundColor of UIButton with buttonType UIButtonTypeCustom

You could create an image programmatically and so have the ability to use your colors in a dynamic way: Create a category for UIButton with this method and be sure to have QuartzCore lib imported via @import QuartzCore: – (void)setColor:(UIColor *)color forState:(UIControlState)state { UIView *colorView = [[UIView alloc] initWithFrame:CGRectMake(0, 0, 1, 1)]; colorView.backgroundColor = color; … Read more

Why am I having to manually set my view’s frame in viewDidLoad?

The frame is not guaranteed to be the same in viewDidLoad as it will be when the view is eventually displayed. UIKit adjusts the frame of your view controller’s view prior to displaying it, based on the context in which will appear. The size is determined based on interface orientation and the dimensions of any … Read more

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