cocoa-touch

Am I always responsible for didReceiveMemoryWarning being invoked by the iPhone OS?

Hi all, I have a quick inquiry regarding how and when didReceiveMemoryWarning gets invoked. I completely understand how to properly use the method. My question that I cannot find in documentation however, is whether or not it is my fault for the way I'm managing my memory footprint for this method being invoked? Is it possible that I'm...

Has anyone implemented the PayPal API through a native iPhone app?

It seems the only way to stay "in app" is to give them a UIWebView of the paypal mobile site and let them complete the transaction there, otherwise the user would need to use their API key. Does this sound right and has anyone got or seen any sample code? I have to think this is a common piece of code. Thanks, Corey UPDATE: Will Appl...

What data type do I use for an integer in SOAP XML in Cocoa?

I imagine it is just an int, but I want to verify. Thanks Corey ...

Multiple-line cursor movements in XCode

I'd like to map a key to move the cursor in the XCode up by ten lines. Of course, I want another one to move down too. The key mapping would ideally be something like 'Control-Alt-P'. Is there a way to achieve this in XCode without resorting to Automator? Ashley has the answer below, the formatting was a little different as the pro...

iPhone Map Rendering

Hello, I'm with building a map application for iPhone, and I wanted to ask what the best way is for bringing maps from a website onto the iPhone. I want to fetch small images of size 80x80 and show them. This kind of activity might be achieved by using UIKit or OpenGL ES. Also if you can bring to my notice some kind of achievement and...

UINavigationController Auto-Rotation to Landscape does not update UIView frame

I'm working on an application that operates entirely in landscape mode (UIStatusBarHidden=YES and UIInterfaceOrientation=UIInterfaceOrientationLandscapeRight). I'm using a NavigationController, with my rootViewController (MainViewController) setup like this: - (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfac...

which features do you look forward to the most in iPhone SDK 3?

Which of the new features are you looking forward to the most in iPhone SDK 3.0? Is it one of the main advertised six new things, or something smaller? Something in the "1,000 new APIs", perhaps? ...

iPhone application is crashing and not leaving behind a .crash log file

Hi folks, I'm working on catching a seriously insidious bug that's happening in my code. The problem is, the bug is completely random and can happen either 9 minutes into the application's runtime or 30 minutes. I've gone ahead and added the fabulous PLCrashReporter to my project (http://code.google.com/p/plcrashreporter) and that works...

How to make swoosh graphic/sound effect?

I have a UIImageView that can be dragged around with a finger. It is sized to an image in it, such as a ball or square. If the user accelerates very quicker, I'd like to trail the object with a blur of itself to give the appearance of going fast. Like what happens with warp speed. I also have a swoosh sound. I'd like the sound to l...

What happens when dragging off screen?

I have an object that can be dragged around. Once the user's finger goes off screen and comes back, I loose the ability to drag the object. If the user then does another touch and drag, everything is fine. How can I get notified once the user's finger drags back onto the screen? Since touchesBegan doesn't fire, I don't get any noti...

What happens exactly, when I set an property to nil in the dealloc method?

Example -(void)dealloc { self.myOutletProperty = nil; [super dealloc]; } I guess that a sort-of virtual setter will be called. But what exactly happens here? Why nil? ...

How do I find out if I need to retain or assign an property?

Are there any good rules to learn when I should use retain, and when assign? ...

Resizing an image with stretchableImageWithLeftCapWidth

I'm trying to resize an image using stretchableImageWithLeftCapWidth: it works on the simulator, but on the device, vertical green bars appears. I've tried to use imageNamed, imageWithContentOfFile and imageWithData lo load the image, it doesnt change. UIImage *bottomImage = [[UIImage imageWithData: [NSData dataWithContentsOfFile: [...

Do I have to release the nib's top level objects if I don't load the nib manually?

As I understand it, I do have to release the top level objects (including window, custom controller objects, ...) from my Nib file, if I load it programmatically by myself. But do I have to care about them in an simple view-based application that has only one main nib file? And would I have to care about them when having an view-based ...

Why does my iPhone app crash when not launched by xcode

The iPhone app I am developing has a strange quirk where it runs ok when xcode has launched it, but not when launched directly on the device. I've checked the crash logs and the exception seems to be occurring in libxml2.2 in xmlParseCharData. It's quite a big xml document that is being parsed so I think that might be the problem. I t...

How to traverse the class hierarchy through a variable assignment in Cocoa Touch?

I have created a UIViewController class called MyViewController with a UIImageView in its XIB file. I then import this class into another class. I make an instance of the class and I change the image in the UIImageView using code: myViewController.myImageView.image = [UIImage imageNamed:@"myImage.png"]; This works swimmingly. My app i...

Programmatically retrieve memory usage on iPhone

I'm trying to retrieve the amount of memory my iPhone app is using at anytime, programmatically. Yes I'm aware about ObjectAlloc/Leaks. I'm not interested in those, only to know if it's possible to write some code and get the amount of bytes being used and report it via NSLog. Thanks. ...

NSURLRequest - encode url for NSURLRequest POST Body (iPhone objective-C)

I am sending a post using NSURLRequest. NSURL *url = [NSURL URLWithString:someUrlString]; NSMutableURLRequest *theRequest = [NSMutableURLRequest requestWithURL:url]; NSString *msgLength = [NSString stringWithFormat:@"%d", [parameterString length]]; [theRequest addValue: msgLength forHTTPHeaderField:@"Content-Length"]; [theRequest setHT...

disable/enable return key in UITextField?

Is there a way to programatically enable and disable return key on the UIKeyboard? The closest I could find is enablesReturnKeyAutomatically, but that only will tell whether to disable it at all. ...

iPhone - how to get user's date format

Hi, How can I know what date format user prefers? Is there a way to read it from phone's local settings? Does the user prefer to read date in format "dd/mm/yyyy" or "mm/dd/yyyy"? Thank you in advance. ...