iphone-4

Need to access the default camera shutter sound used by the iPhone

核能气质少年 提交于 2019-11-30 17:26:06
Right now when a user presses a button I play a custom camera shutter sound. However, if possible, I would much rather just use the camera shutter sound that plays by default whenever you take a photo using your iPhone. Is there a way that I can access and use the default iPhone camera shutter sound? And if yes, then where is it actually located? I need to figure out it's file path so that I can use it with the code below and just change the input for pathForResource : NSString *soundFilePath = [[NSBundle mainBundle] pathForResource:@"shutter" ofType: @"wav"]; NSURL *fileURL = [[NSURL alloc]

Location services don't stop when application is terminated

倖福魔咒の 提交于 2019-11-30 12:26:06
I'm currently developing an iPhone application which needs location services for various use including AR. I test everything on simulator and on my iPhone 3GS and everything went well. I recently tested on iPhone4 and on iPad2 and the location service (the little icon in status bar) keeps displaying even when I manually kill the app! The only way to disable this icon is to manually stop the location service for my app in the settings. Does anyone know something about this? If needed I can post my code. Thank you in advance Edit : When I kill the application, go to location services, switch off

Need to access the default camera shutter sound used by the iPhone

可紊 提交于 2019-11-30 01:11:49
问题 Right now when a user presses a button I play a custom camera shutter sound. However, if possible, I would much rather just use the camera shutter sound that plays by default whenever you take a photo using your iPhone. Is there a way that I can access and use the default iPhone camera shutter sound? And if yes, then where is it actually located? I need to figure out it's file path so that I can use it with the code below and just change the input for pathForResource : NSString *soundFilePath

Location services don't stop when application is terminated

半腔热情 提交于 2019-11-29 17:53:12
问题 I'm currently developing an iPhone application which needs location services for various use including AR. I test everything on simulator and on my iPhone 3GS and everything went well. I recently tested on iPhone4 and on iPad2 and the location service (the little icon in status bar) keeps displaying even when I manually kill the app! The only way to disable this icon is to manually stop the location service for my app in the settings. Does anyone know something about this? If needed I can

How use CGImageCreateWithImageInRect for iPhone 4 (HD)?

拈花ヽ惹草 提交于 2019-11-28 19:30:43
I use the following code to getting images from the sprite. And it works fine everywhere except the iPhone 4 (HD version). - (UIImage *)croppedImage:(CGRect)rect { CGImageRef image = CGImageCreateWithImageInRect([self CGImage], rect); UIImage *result = [UIImage imageWithCGImage:image]; CGImageRelease(image); return result; } The iPhone 4 automatically load HD version of the image (sprite@2x.png) instead sprite.png. The original image has a scale 2, but the resulting image has a scale 1 and wrong size. How to handle this behavior taking into account the different scales for iPhone 3G[s] and the

Reading the iPhone's Ambient Light sensor

人走茶凉 提交于 2019-11-28 16:53:30
I notice on my iPhone, after a few seconds of being in direct sun light, the screen will adjust to become brighter, dimmer etc. I was wondering if there was a way to interact with this sensor? I have an application which is used outside. When you go into direct light, it becomes very difficult to see the screen for a few momments, before it adjusts. And even then, it's not always as bright as I'd like it to be. I would like to implement a high contrast skin for outdoor viewing, and a low contrast for indoor viewing. Is this possible to read light sensor data, and if so, how do I extract these

How could I create a shortcut on desktop in iOS through an app

坚强是说给别人听的谎言 提交于 2019-11-28 06:07:13
What do I mean is that I want to use the app to create a shortcut with icon on the desktop which will allow user to speed access some functions of this app. How could I do that, any suggestions? Or anyone have experience with this. An example: FaceDial I spent a good while trying to implement this functionality into an app recently and wanted to put out some of the resources I found on the subject to save someone else a major headache. This is becoming an increasingly popular feature and is used in major apps like Workflow and Facebook's Groups app. Given that Workflow is now an Apple app, it

Xcode: Could not locate device support files

血红的双手。 提交于 2019-11-28 03:10:25
As i am trying to run my application from newly updated Xcode 8 to my iPhone 4 which is running iOS 7.1.2 It throws below error, And, this is my Xcode version, Does anyone faced this issue before? Awaiting for your suggestions!! I had a similar problem because the app store version was missing iOS 10.1 support in Xcode 8 and they haven't rolled an update yet. This caused the "Xcode: Could not locate device support files" problem. You can download the latest update https://developer.apple.com/download/ and it is more current and supports iOS 10.1 (14B72c). Durai Amuthan.H Actually, there is a

What is the best way for supporting both screen resolution of iPhone4 and iPhone5 ? - Auto layout in only iOS6

柔情痞子 提交于 2019-11-27 20:40:51
Have anyone figured out how to support both screen resolution iPhone4 and iPhone 5 ? In iOS6 we have support of Autolayout. Can that be used for iPhone4-iPhone5 screen i.e. 320x480 and 320x568. If we use auto layout feature for that we will have to keep deployment target minimum to iOS6. What about iOS5 than ? What about iOS5 than ? Do we have to handle it programatically for different screen size ? I searched web and could not find exact answer for that so posting this question though having doubt of having downvotes. Please bear with me for that. I guess this question is very basic to

Compensating compass lag with the gyroscope on iPhone 4

北慕城南 提交于 2019-11-27 17:05:20
I've been experimenting with the compass and gyroscope on iPhone 4 and would like some help with an issue I'm having. I want to compensate for the slowness of the compass by using data from the gyroscope. Using CMMotionManager and its CMDeviceMotion object ( motionManager.deviceMotion ), I get the CMAttitude object. Correct me if I'm wrong (please), but here is what I've deduced from the CMAttitude object's yaw property (I don't need pitch nor roll for my purposes): yaw ranges from 0 to PI when the phone is pointing downwards (as indicated by deviceMotion.gravity.z ) and swinging