iphone4

iPhone 4.0 on iPhone but still Ad-Hoc compile for 3.1.3?

Device: Version : 3.1 Build: 3511 Device: iPhone OS: iPhone OS 4.0 xCode 3.2.2 (Old) xCode 3.2.3 (New; For iPhone 4.0 Beta) Background: As you can see I installed 4.0 on my iPhone as I read on this forum it's really hard to near impossible to downgrade back to 3.1.3, but it's my only device I have and use for development. When I ...

iPhone 4: when to save data?

I have an app (a game) which saves data: game state, high scores, achievements, etc. Currently the app delegate does this on applicationWillTerminate:. After playing around with iPhone 4 for a bit, it seems that applications pretty much never terminate: they just run in the background forever, unless the user goes out of their way to q...

Do background applications *ever* quit in iOS 4?

I don't fully understand Apple's iOS 4 model, I've been poring through documentation for hours, but I still appreciate some help. Do backgrounded iPhone apps ever quit? For example, when I close a location-tracking app such as Loopt, it will be backgrounded but will it subscribe to the OS's significant locations service? According to ap...

CGContext text drawing doesn't scale up on iPhone 4

I am trying to create an app that scales up nicely on the iPhone 4. Currently most of it scales up perfectly, except for one crucial piece: the text that I draw inside a CALayer, inside its drawInContext: method. Here is my code: - (void)drawInContext:(CGContextRef)context { UIGraphicsPushContext(context); CGContextSetGrayFill...

UIActivityIndicatorView doesn't work on iPhone 4 with iOS4

I noticed in one of my apps that the activity indicator doesn't seem to work on an iPhone 4. It works fine on an old iPhone upgraded to iOS 4 just not on an iPhone 4. Does anyone know why it isn't working? ...

UIImagePNGRepresentation() and scale (iPhone 4 screen)

I've got some image generating code that uses UIGraphicsBeginImageContext(), UIGraphicsGetImageFromCurrentImageContext() and UIImagePNGRepresentation() to do some drawing, then save it to disk as a PNG for later use. Does UIImagePNGRepresentation() take into account scale? As in, if I have an image that is 20 points wide, will the resul...

Previewing on iPhone 4

Besides the obvious answer of "buy an iphone 4" (I'm in Australia so that's not possible at the moment) - is there an easy way of checking how your app looks on the new iPhone 4. I have a background image in my app which I want to check how it scales. Any suggestions? ...

How use CGImageCreateWithImageInRect for iPhone 4 (HD)?

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 resul...

Is there a way to dim the LED light on the iPhone 4?

Is there a method or property that allows you to set the brightness of the LED light on the iPhone 4? ...

How can you turn on the led light on the iphone 4?

I just want to be able to turn on the led light. Is there a simple way to do this, or am I going to need to, say, set up the phone to take a video, simulate it videoing with the light on, but not save the video? Something like that? Thanks. ...

How to convert NSString to NSNumber without using numberfromstring

I want to convert NSString to NSNumber without using numbreFromString: method? The numbreFromString: metgod is acting weirdly in 4.0. So i want to use an alternative to convert NSString to NSNumber. Please Help me.... +(NSString *)formatText:(NSString *) text withLocalSettings:(BOOL) isLacale { NSNumber *aNsNumber= [numberFormatter ...

how to run audio after the application hes entered in backgroundMode in iPhone 4.0

hello all, I have tried several forums but still unable to get the answer.. I am developing an application which does radio streaming in iPhone 4.0 Now i want that the audio of the radio must continue even after the application is in suspended state.. Also i have an .m3u file which contains 3 urls of .mp3 So i also want that if one mp3...

Does iphone 4 have automatic data persistence?

I loaded some app projects that I had been developing using the iPhone 3.1.3 Simulator. Now I got the 4.0 package, and for some reason when I hit the home button of the simulator to go the home screen and then go back to the app, it's in the same position as I left it. Is this now standard? What if I don't want it to do this? I'd rat...

Turn on torch/flash on iPhone 4

I know that the only way to turn on the flash and keep it on on iPhone 4 is by turning the video camera on. I'm not too sure of the code though. Here is what I am trying: -(IBAction)turnTorchOn { AVCaptureSession *captureSession = [[AVCaptureSession alloc] init]; AVCaptureDevice *videoCaptureDevice = [AVCaptureDevice defaultDeviceWithMe...

Video with iPhone 3.0 OS application getting crash while running in iphone 4.0 OS.

Hi, I am having a crash issue while playing video in iphone 4.0 OS. Actually, I have created application with base SDK 3.0 and now i am just installing application to 4.0 OS device. It is not working in that... I have debugged that issue and found that in 4.0 OS, apple change the framework and methods to play the video. Any one help m...

iPhone Game Center iOS4 support my game? How?

I'm currently building a multiplayer game for the iOS4 and I am trying to understand how I can make it support Game Center when it is released? Is there ANY documentation on it? I can't find it anywhere I'm using cocos2d to build my game and am currently not finished, but would like to be able to code directly in hopes of the game bein...

UITableViewCell in iPhone 4 and iPhone 3G/GS

Hi all, I am creating a custom UITableViewCell class in my iPhone app, but I am unclear how to state the dimensions given that the iPhone 2G/3G/3GS and iPhone 4 have different resolution screens. Clearly, when I programmatically add an element, I'll use calculated coordinates based on the screen resolution, but when I am in interface...

colorWithPatternImage with iPhone 4 Retina Display ([email protected])

Thanks to SO's search function blowing up whenever I enter "@2x", it's difficult to tell whether this has already been asked... I've been using colorWithPatternImage: to build tiled background images for my various views. However, these predictably look like trash when viewed on the new iPhone 4 display. So I've built @2x versions of ...

Specify two icon sizes in iPhone4/iPad app

Hello The iPad and iPhone4 both are armv7 (not 6), and I'm curious to know how to specify two separate icon sizes given that the target architecture is exactly the same. Specifying two in a typical universal app is simple, however I'm not sure how to do this. I can't find it in the documentation, although it may be! (Sorry if it is; ...

How to add retina images to svn.

Hi all I need to help for you. I made images for retina display like "**@2x.png". but it can not add to svn like this. ******-no-iMac-2:baz shunter$ svn add retina_images/[email protected] svn: warning: 'retina_images/foo' not found I know how to add resource each like this. ******-no-iMac-2:baz shunter$ svn add retina_images/[email protected]@ ...