Play sound on iPhone even in silent mode [duplicate]

It’s not advisable, but who am I to say you can’t do it. You may have a good reason to be playing sound. If you are using Audio Sessions, then include <AVFoundation/AVFoundation.h> at the start of your file and [[AVAudioSession sharedInstance] setCategory: AVAudioSessionCategoryPlayback error: nil]; should do the trick. Note if you play music or … Read more

Swift UIAlertController -> ActionSheet iPad iOS8 Crashes

The error message is telling you that you need to give the alert controller’s popoverPresentationController a location so that it can position itself properly. This is easy to do — just check to see if there’s a popover controller and add the sender as the source. If your button is a UIBarButtonItem: if let popoverController … Read more

Base64 images to gmail

The links from Moin Zaman show test results that are outdated (from 2008). As of my thorough testing today Gmail does support displaying embedded images for both methods. Use base64 encoding image inline within <img src=”https://stackoverflow.com/questions/3279523/…”> <html><body><img src=”data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAA9QAAADmCAIAAAC77FroAAAAAXNSR0IArs4c6QAAAAlwSFlzAAAO…”></body></html> Use base64 encoded image as attachment Message-ID: <BE0243A40B89D84DB342702BC5FD6D313EA3BE1B@BYMAIL.example.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: yes X-MS-TNEF-Correlator: x-originating-ip: [xxx.xxx.xxx.xxx] … Read more

Multiple “apple-touch-startup-image” resolutions for iOS web app (esp. for iPad)?

definitive solution for startup-image and touch-icons for iPad and iPhone (landscape || portrait) and (retina || not): <!– iPhone ICON –> <link href=”https://stackoverflow.com/questions/4687698/apple-touch-icon-57×57.png” sizes=”57×57″ rel=”apple-touch-icon”> <!– iPad ICON–> <link href=”apple-touch-icon-72×72.png” sizes=”72×72″ rel=”apple-touch-icon”> <!– iPhone (Retina) ICON–> <link href=”apple-touch-icon-114×114.png” sizes=”114×114″ rel=”apple-touch-icon”> <!– iPad (Retina) ICON–> <link href=”apple-touch-icon-144×144.png” sizes=”144×144″ rel=”apple-touch-icon”> <!– iPhone SPLASHSCREEN–> <link href=”apple-touch-startup-image-320×460.png” media=”(device-width: 320px)” … Read more

Get current orientation of iPad?

Orientation information isn’t very consistent, and there are several approaches. If in a view controller, you can use the interfaceOrientation property. From other places you can call: [[UIDevice currentDevice] orientation] Alternatively, you can request to receive orientation change notifications: [[UIDevice currentDevice] beginGeneratingDeviceOrientationNotifications]; [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(orientationChanged:) name:UIDeviceOrientationDidChangeNotification object:nil]; Some people also like to check the … Read more

iPad Browser Simulator? [closed]

The best approach I found is in Apple’s Technical Note TN2262: Preparing Your Web Content for iPad. Test your website on iPad, and update user agent detection code if necessary Use W3C standard web technologies instead of plug-ins Check your viewport tag settings Modify code that relies on CSS fixed positioning Prepare for a touch … Read more

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