cocoa-touch

Cocoa or Objective-C?

In regards to iPhone development, how do you now when your using a Cocoa vs pure Objective-C objects. For example, the following are Objective-C: NSTimer NSString int, float NSMutableArray But these are Cocoa: UILabel UIColor(?) UIView And to be clear, does Cocoa Touch == iPhone development Cocoa == Mac OS X development ...

How to properly release and switch views in multiview controller?

I'm trying to create a multiview controller for a game, in which one root view controller releases views before switching to another view. The sub view controllers are, in turn, sub-root view controllers themselves since they contain other view controllers. For instance, my singlePlayerViewController will have a shakeObjectViewControlle...

Best way to download large files from web to iPhone for writing to disk

In an iPhone app I currently have code for downloading a file from the Web to the iPhone and saving it to disk. The problem is that if the file is large then the memory usage of the app skyrockets and the app crashes. I am sure I am just not doing it the "proper" way. Currently I have the following: mediaData = [[NSData alloc] initWi...

Does UIWebView leak memory?

If your iPhone app uses a UIWebView, and loads many pages with large images, you may find that you are leaking memory. Can this be resolved? ...

UINavigationController and modalViewController problems

Hi I'm having this problem: I have a UITabBarController with UINavigationControllers in each tab. However, I'm trying to implement an action that, when I click on a button, should present me a new view with a UINavigationController (since it will be multi-view) in a modal way. What I've tried is to implement a new UIViewController, wi...

Discussion on 'didReceiveData' method for HTTP Connection

I created an indenpendent class for HTTP connection. All the connection works fine. The problem is that I find method 'didReceiveData' will be called AFTER the method who call the connection. (method 'didReceiveData' will be called after IBAction 'accept') - (IBAction)accept:(id)sender { [self connect:url]; //labelStr = ReturnS...

RESTful iPhone client and Model hierarchy

Hi all, I'm curious what strategy most of you are employing in order to build solid RESTful iPhone clients in respect to model hierarchies. What I mean by model hierarchies is that I have a REST server in which several resources have a correlation to each other. For instance, let's say for hypothetical purposes I have a REST server whic...

Question regarding updating a UITableViewCell on the iPhone

I'm looking to do something simple such as drilling down on a particular UITableViewCell, which brings up a detail view controller. Within there, the user has the capability to change the attribute for the model underneath the cell. For instance, If I'm displaying a list of quotes, and a user clicks on a quote and favorites it in the chi...

How can I transliterate chinese text to pinyin on iPhone?

The localization saga continues... So I'm trying to support collation of chinese text in my iPhone app, and after talking to a native chinese speaker, I think I understand how the chinese do it... Lets say you had the string 巴拉克·奥巴马 and you wanted to figure out which section of the chinese phonebook to put it in (in this example I'm ig...

Using MD5 hash on a string in cocoa?

I need to hash a string using the MD5 technique in cocoa. Any frameworks that are used must be able to be accessed on the iphone. please provide code if possible. ...

calling a C function using cocoa

I have a C function with the following method signature. NSString* md5( NSString *str ) How do I call this function, pass in a string, and save the returned string? I tried the following, but it did not work: NSString *temp= [[NSString alloc]initWithString:md5(password)]; thanks for your help ...

Finding a UIImage file type

Is there a way to determine what file type was used to create a UIImage? ...

UINavigationController with UITableView and UIView

I want to be able to switch between a UITableView and a standard UIView in a Parent View. Basically I have a UITableView that shows on load displaying a log of information. I want to have a segment control in the header of the Window that when the user taps, transitions to a Graph View which is a standard UIView. The UIViewController in...

How to add clear button to UITextField?

Same as http://stackoverflow.com/questions/320078/adding-the-clear-button-to-an-iphone-uitextfield but that one is old. I tried myUITextField.clearButtonMode = UITextFieldViewModeWhileEditing; but nothing is happening. What could be preventing it? ...

Resizing UITableView on RootController

Is it possible to resize the UITableView on the RootController of a nav based app? When RootViewController.xib is opened in IB, there isn't a view. Just the UITableView. Clicking the inspector and then the little yellow ruler, frame height is grayed out. I'm adding a toolbar programmatically to the RootViewController: [toolbar setFr...

iPhone Core Data Example produces exception

No longer under NDA. There was an ommision in the iPhone Core Data example, but is now corrected. Also the sample code was always correct, they just left out some details in the tutorial. (Please refer to iPhone Dev Forums for explanation) I built an app twice and received the same error twice (but in 2 different places): Termina...

Is there an iPhone SDK API that I can use to get the current wallpaper image?

Is there an iPhone SDK API that I can use to get the current wallpaper image? I would like to use this image in a game. ...

Where should I store an image selected on the iPhone?

I want to take a picture or select an existing picture from the users existing photos. What is the best way to do this? Specifically I am concerned where I should to store the image. The storage location should be private to the application. I need to be able to reuse the image as a background every time the application opens. Thanks! ...

Mac OSX/iPhone error handling in the App Delegate?

Hi all, I'm curious, how do most of you folks handle errors such as HTTP Forbidden or 5xx type requests from a server? Or say an exception is thrown in one of your UIViewControllers? Do you typically bubble up the error to the App Delegate and handle generic "window" level errors at that point? Do you couple errors directly into the UIV...

Objective C HTML escape/unescape

Wondering if there is an easy way to do a simple HTML escape/unescape in Objective C. What I want is something like this psuedo code: NSString *string = @"&lt;span&gt;Foo&lt;/span&gt;"; [string stringByUnescapingHTML]; Which returns <span>Foo</span> Hopefully unescaping all other HTML entities as well and even ASCII codes like Ӓ a...