cocoa-touch

What is the Proper Way to Dynamically Create Content For a UIView?

I have a tableView with a list of items. When a selection is made, a new view controller is pushed on the tableView's navigationController viewController stack. My question is this: one of the views in the view hierarchy associated with the pushed view controller requires the fetching of data from the network before it can render it's c...

Cocoa Touch UITableView Data

I am working for the first time in objective c and have come across an issue that I have not seen an answer for. I am loading a set of data from a JSON data set and using it to populate a UITableView within a UITableViewController. First when the view is loaded (viewDidLoad) I populate the array with the JSON data from a URL. Next th...

Sending email in iPhone

Hi all, In my application I have to send feedback to the client's email. Here is my code, -(void) send:(id) sender { [self sendEmailTo:[txtTo text] withSubject:[txtSubject text] withBody:[txtBody text]]; } -(void) sendEmailTo:(NSString *)to withSubject:(NSString *) subject withBody:(NSString*)body { NSString *mailString = [N...

Returning errors in objective-c

Im newish to objective-c and am starting to wonder what is the common/standard/proper way for handling and catching errors? It seems like it might be possible to use NSError to do this, is that a good idea or a hijack of cocoa? ...

What is the most robust way to force a UIView to redraw?

I have a UITableView with a list of items. Selecting an item pushes a viewController that then proceeds to do the following. from method viewDidLoad I fire off a URLRequest for data that is required by on of my subviews - a UIView subclass with drawRect overridden. When the data arrives from the cloud I start building my view hierarchy. ...

Retrieving cells in tableview

I have a tableview that once a cell is clicked, it pushes tableViewB, which contains customcells. These cells contain TextFields. Once the user does any updating, they click "Save", which then pops tableViewB and goes to the first tableview. I would like to get all of the textfield values from tableViewB when Save is clicked. What is...

NSMutableArray converted into UICachedDeviceRGBColor at execution time

Hi guys! Now I'm working on an iPhone project and I'm using instances of the class NSMutableArray and suddenly, with no reason, at execution time the NSMutableArray converts into a UICachedDeviceRGBColor becoming unusable. I do not know what to do, the same object had been working fine until today. I got this error: *** -[UICachedDe...

Fastest way to handle UIImagePickerController compression

What's the fastest way of getting a picture into a SQLite data store for compression, so I can return control to the user? I'm using UIImagePickerController to take pictures in my application. The problem is using the picture is quite slow, because of the speed of UIImageJPEGRepresentation. I want to push JPEG compression into a backgr...

makeKeyAndVisible & makeKeyWindow - uiwindow in iphone

In every application, there is always written as [window makeKeyAndVisible]; What is mean by makeKey? ...

Re-used UITableViewCell showing old UIImageView for a moment then switches to correct image.

So I've built a custom cell for a UITableView. My subclassed UITableViewCell has a UIImageView in it. When scrolling through the table view, as the new cells appear, the "left-over" images from the dequeued cells are shown for a moment until the new image loads in it's place. I've tried [cell.myImage setImage:nil] but that doesn't s...

Is Apple's iPhone SDK 3.0 CoreDataBooks example broken?

I've come across this issue in my application, and have reproduced it using Apple's CoreDataBooks codebase with 0 modifications to the code. The problem is if you make an edit to a managed object, and save the context, with the result being a section with only one row now having no rows, and a new section created with the resulting objec...

Which mobile platform would be more rewarding to learn as a developer (iPhone vs Palm Pre vs. Android)?

I am interested in getting my feet wet in PDA/mobile development. The only two drivers for me are the drive to learn cool (or at least, new) stuff, and may be to code some app that I felt I really needed but lacked. As such, I would like to know what the comparative benefits/downsides would be for me as a developer in choosing one of t...

UIView. How do I place a subview behind it's parent superview

I'm doing a bit of UIView wrangling and am stuck. It is straightforward changing the "z" order of sibling subviews. [mySuperview sendSubviewToBack:mySubview] places mySubview behind all it's siblings. But how do I place a subview behind it's parent? Thanks, Doug ...

AVAudioPlayer turns off iPod - how to work around?

I use AVAudioPlayer to play sounds in my app, but it turns off the iPod when a sound plays. Is there a way to prevent this? I don't want to use System Sounds because I can't control their volume. Thanks for your help. ...

If a method is called at the exact same time twice, how to only execute it once?

We have a method in the iPhone SDK that is a delegate method. Problem is, the OS calls this method twice at the exact same time. This method does some heavy lifting so I don't want to execute the logic twice. What is a good way to detect this and prevent one of the two from running? Forgot to mention that, it is called from different ...

How do i subclass a UIView?

This may seem like a stupid question, but i can't quite remember how to subclass a UIView. Can anyone point me in the right direction? ...

Link with File's Owner problem

I created a nib file "WebViewController.xib". And try to link the UIView with File's Owner. But it doesn't work. Also sometimes with other nib files, I deleted a connection from View Connections->Referencing Outlet, then tried to connect again, but it can't link with File's Owner anymore. How to fix this? Thank you. ...

UILabel instead of the default pin on MKMapView

Is it possible to have our own UILabel or some other type of text instead of the default pin in MapKit map on iPhone? ...

iPhone keyboard-button style for any UIView / UIButton?

Hi guys, I have a custom keyboard in my app and I'd like to have it look similar to the original iPhone keyboard (especially the buttons), just like it has been realized in Twitterrific, for example. Can you point me to a resource where I could find such code, either as a custom drawRect method or as a TTStyle pipeline? Cheers MrMage ...

iPhone settings styles for static library / framework

I'm looking for a clean way to be able to define a global styles for an application, fonts , colors etc. I have build a static library to be included with other apps, each app has its own styles, border, fills, backgrounds. How could i with cocoa enable a system that i could set certain styles for that library. I looked at Joe Hewitt's ...