ios4

Is UIImageWriteToSavedPhotosAlbum slow in iOS SDK 4.0?

I use UIImageWriteToSavedPhotosAlbum to save picture to album. But after updated to iOS SDK 4.0, I noticed that it was slowed down significantly. It's about 20 seconds, between UIImageWriteToSavedPhotosAlbum was issued and completionSelector was triggered. Can anyone help on this problem? ...

How should I approach building a Universal iOS app that will include iOS 4 features, even though the iPad doesn't yet run iOS 4?

I'd like build a game for both the iPhone and iPad. As such, it would make sense to start this project from scratch as a universal app. However, iPhone and iPad currently run two different versions of the iOS since iOS 4 isn't available for the iPad yet. There are two iOS 4 features (GameCenter and iAd) that I would like to support in...

Screen Shot on iPhone

Hi All, I have a bit of code that does what I want and takes a screen shot. Apple have now said that screen shots have to be taken not using UIGetScreenImage(), but UIGraphicsBeginImageContextWithOptions. Could anyone point me in the right direction. Here's a snippet of code that shows how I am doing it at the moment. CGImageRef inImag...

load photo from device in iOS4

Hi,guys. i want to load "amount of UIImages" from PhotoAlbum at a time and display on the UIView. in iOS3 ,it may like : NSString *file_path = @"/var/mobile/Media/DCIM/100APPLE/" NSArray *imageSource = [fileManager contentsOfDirectoryAtPath:file_path error:nil] ; UIImage *image = [UIImage imageWithContentsOfFile:[imageSource objectAt...

Now allocating four times the memory with @2x images

Now that UIImage imageNamed is using @2x images for iOS4's retina display, there is an obvious concern that since the images are now twice the size (pixels x pixels), that they will also be twice four times the size in memory. I know everyone stated something like you have a limit of 24mb in memory for the old devices (even though that ...

Styling the UIPopOverViewController

Hi there, I've seen a few apps on the iPad recently adding a bit of design to the pop overs. Does anyone have any pointers on how you would go about changing the pop overs design without writing your own? I'm hoping to achieve something like the pop overs in iBook or Calcbot. Cheers ...

How to handle multitasking in OpenGL ES based apps on iOS 4?

I'm watching a WWDC video (session 105) that's talking about multitasking with iOS 4. Something interesting was just mentioned: "any GPU usage while your app is in either of the background states results in automatic termination of the app. This includes any calls to OpenGL." How does one handle this "requirement" if the ...

Does multitasking really matter for simple iPhone games?

I'm making a relatively simple OpenGL ES based iPhone game. While testing on the iPhone 4 I've noticed that multitasking doesn't "work". Specifically the app is automatically terminated when it's put into the background state (I think this is due to making OpenGL calls in the background and/or not releasing some resources). Since the ...

iPhone (iOS4): is it possible to play music/sound during an active call?

Hi all! I want to allow user to switch to my app during a phone call and play some sound that the second person will hear. I see here that it was possible even before iOS4 and here that no one knows how to do it. I will really appreciate if someone will spread some light on this issue. Thank you. ...

iphone - can a bitmap be stamped in a path in quartz?

I have to draw a line between two points using quartz. At some point I have this code: CGContextBeginPath(ctx); CGContextMoveToPoint(ctx, lastPoint.x, lastPoint.y); CGContextAddLineToPoint(ctx, currentPoint.x, currentPoint.y); CGContextStrokePath(ctx); This lines will create a hard line between the points currentPoint and lastPoint. ...

Why can't new ObjC classes descend from UIViewController?

So, I've been making iOS apps since the first iPod touch came out, but something has always flabbergasted me; why is the list of new Cocoa Touch classes restricted to subclasses of NSObject, UIView, and UITableView? I routinely make subclasses of UIImageView and UIViewController. Am I "Doing It Wrong™?" Have I totally misunderstood MVC...

iphone sdk: Is it possible to play audio playlist in the background in iOS 4

I tried to implement this. My original post is here http://stackoverflow.com/questions/3297571/iphone-playing-audio-playlist-in-the-background So after some testing I begin to doubt whether it's even possible. does anyone know whether it's possible to use AVAudioPlayer to play multiple tracks in the background? I myself haven't found a...

Localizing app icons in iOS 4

Ok, this one is driving me crazy... I've had my app icon localized using InfoPlist.strings with language-specific CFBundleIconFile values (selecting different icon for each of the supported languages). Since iOS 4 this method no longer works, and I'm struggling to find one that does. Apple docs state that it should be enough to put co...

Accessing UIViewController from UITableViewController?

In iOS4, I want to use MPMoviePlayerController. I have a UIViewController that I pass to a custom class that manages MPMoviePlayerController. That plays video fine. I have another view that is a UITableViewController. Passing the UITableViewController to my UIViewController property on the video class doesn't work. I just get soun...

NSXMLParser crashing on faulty xmls, no correct error handling?

Hi Anyone else experiencing crashes deep down in the iPhone libraries when NSXMLParser parses an xml containing errors? I thought it was supposed to call: (void)parser:(NSXMLParser *)parser parseErrorOccurred:(NSError *)parseError but instead it crashes the entire app somewhere inside _xmlRaiseError. Is anyone else experiencing thi...

"unrecognized selector" error. Cannot figure it out

I've been trying to get OAuth for Twitter to work on my iPhone application for the last couple of days, and I cannot for the life of me figure out why I'm getting this error. I've changed the way I've been approaching this for a while now, but still nothing. So I turn to SO to hopefully figure it out. The tutorial is linked here. Downlo...

Writing Playlists to iTunes in iOS SDK

The Apple documentation on the MPMediaPlaylist class is pre-iOS4, so it definitively states that you cannot write new playlists to iTunes on the phone with the SDK. However, with the iOS4 update, users can create and save new playlists on the phone. Is this functionality offered to developers as well? If so, could someone point me to app...

iPhone simulator only shows a black screen after launching the app

Hi I am moving my 3.x app to use iOS4 features like background processing, fast-app switching. I have been able to get the app running fine. But now whenever I launch the app on the simulator, it just shows a black screen. The app launches, status in XCode changes to running but nothing shows up other than the black screen. The app run...

How to write this method in Objective-C?

I just started Objective-C recently, and this has once again gotten me to the point of asking SO for help. I need to rewrite this method so that I can call it using [self URLEncodedString]; This is what the method currently looks like - - (NSString *)URLEncodedString { NSString *result = (NSString *)CFURLCreateStringByAddingPerce...

Terminate Safari or Mail

Hello there, I am quite new here so I do not know many things. And the first thing I do not know is how to Terminate any running process programmatically, e.g. taping on the button; e.g. Mail or Safari. If it is possible, do not show me the whole code, just the proper way I have to try. Thanks. ...