cocoa-touch

What's the best way to handle landscape/portrait differences in IB?

I have a view that supports landscape and portrait viewing, with the controls all moving around when you switch from one to the other. I'm currently doing this by setting the .center of each one of my controls when the user rotates the phone. The problem is that this is tedious, and requires a lot of code, and seems to defeat the purpose...

How to scale a UIImageView proportionally ?

I have a UIImageView and the objective is to scale it down proportionally by giving it either a height or width. UIImage *image = [[UIImage alloc] initWithData:[NSData dataWithContentsOfURL:[NSURL URLWithString:@"http://farm4.static.flickr.com/3092/2915896504_a88b69c9de.jpg"]]]; UIImageView *imageView = [[UIImageView alloc] initWithIma...

Add Custom Controls to MoviePlayer

I am trying to figure out how to add a custom control to the iPhone MoviePlayer. For an example of what I am trying to do see the following image. I am trying to add something like the controls on the right and left of the basic movie controls. I had done this in the Open SDK by adding a subclass to the playerview, but now in the off...

How can I disable the UITableView selection highlighting?

When you tap a row in a UITableView, the row is highlighted and selected. Is it possible to disable this so tapping a row does nothing? ...

Can I access the keychain on the iPhone?

This question discusses encrypting data on the iPhone using the crypt() function. As an alternative, is there a keychain on the iPhone and if so, what code would I use to access it in order to store login details and then retrieve them for us in an application? ...

Is there a way to control the animation on a UITableView scrollToRowAtIndexPath?

I would like to modify the animation duration and attach a callback to be called when the animation finishes when calling scrollToRowAtIndexPath with animated:YES but I can't find a handle to its animation proxy or any other way to do it. Anyone know if this is possible? ...

Is there a performance hit for using UIImage in CALayer?

I'm using a whole bunch of CALayers, creating a tile-based image not unlike GoogleMaps (different versions of the same image with more/less detail). The code I'm using to do this is: UIImage* image = [self loadImage:obj.fileName zoomLevel:obj.zoomLevel]; [CATransaction setValue:(id)kCFBooleanTrue forKey:kCATransactionDisableAct...

Rounded Corners on UIImage

I'm trying to draw images on the iPhone using with rounded corners, a la the contact images in the Contacts app. I've got code that generally work, but it occasionally crashes inside of the UIImage drawing routines with an EXEC_BAD_ACCESS - KERN_INVALID_ADDRESS. I thought this might be related to the cropping question I asked a few weeks...

UIImageView not displaying in UITableView header

My problem is that I can't seem to get the image from my bundle to display properly. This method is in the view controller that controls the tableview. headerView is loaded with the tableview in the .nib file and contains a few UILabels (not shown) that load just fine. Any ideas? - (void)viewDidLoad { [super viewDidLoad]; [[sel...

iphone crash reporter

Is it possible to access the crash log over the application? The last.fm client showed me today a "we found a crash log" altert with the option to send it, so I think it must be possible. ...

How do you make an UIPickerView component wrap around ?

I would like to show a set of consecutive numbers in a UIPickerView component but have it wrap around like the seconds component of the Clock->Timer application. The only behavior I can enable looks like the hours component of the Timer application, where you can scroll in only one direction. ...

UUID mismatch detected with the loaded library

I get a "UUID mismatch" warning at the console when I try to build and run my app on my iPhone. warning: UUID mismatch detected with the loaded library - on disk is: /Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS2.1.sdk/usr/lib/liblockdown.dylib =uuid-mismatch-with-loaded-file,file="/Developer/Platforms/iPhoneOS...

Right way to implement TouchesMoved ?

I have a custom UIView that generates a set of subviews and display them in rows and columns like tiles. What I am trying to achieve is to allow the user to touch the screen and as the finger move, the tiles beneath it disappears. The code below is the custom UIView that contains the tiles: - (id)initWithFrame:(CGRect)frame { if ...

How do you set the hardware volume in an iPhone app?

Some iPhone applications, such as Pandora seem to directly manipulate the hardware volume and respond to physical volume button. How is this done? AudioSessionServices allows you to get the current hardware output volume with the kAudioSessionProperty_CurrentHardwareOutputVolume property, but it is (allegedly) read-only. ...

UIView scale to 0 using CGAffineTransformMakeScale

Is it possible to scale a UIView down to 0 (width and height is 0) using CGAffineTransformMakeScale? view.transform = CGAffineTransformMakeScale(0.0f, 0.0f); Why would this throw an error of "<Error>: CGAffineTransformInvert: singular matrix." ? Update: There is another way of scaling down a UIView to 0 [UIView beginAnimations:n...

stitch picture in iphone

Hi, I want to stitch 2 pieces of png side by side. In Cocoa, I would use [NSImage initWithSize], and then just drawInRect. But UIImage don't have initWithSize class, how would I do this now? ...

loading custom framework in iphone

Hi, I'm trying to use an external framework for UPnP browsing on the iPhone. The framework works perfectly on the Mac, But when I copy it to the iPhone app, it wouldn't run even if there's no code using the framework yet. It gives weird error that I can't understand. [Session started at 2008-10-20 15:32:34 +0200.] objc[2701]: Class ...

How to change Text Rotation Axis

I am using CGContextShowText to display text, but when rotation using CGAffineTransformation, the rotation axis is located at the left, not at the center of the drawn text, the code I am using is this: CGContextSaveGState(context); CGContextSelectFont(context, "Helvetica", 20, kCGEncodingMacRoman); CGContextSetCharacterSpacing (context,...

Ruby on iPhone

Hi I'm looking into iPhone development, and objective-c is not be my preferred language. As far as I can see at this moment Ruby cannot be used to talk to Cocoa-touch at the moment on the iPhone. So my question is, am I wrong? Can I use Ruby on the iPhone to develop Cocoa-touch applications. And what is the future looking like for Ruby ...

How to share custom data between iPhone applications?

If I make two iPhone applications, how can/should I share custom data (not contacts and stuff like that) among them? Thanks! ...