How would you design a question/answer view (iPhone SDK)

Posted by Aurélien Vallée on Stack Overflow See other posts from Stack Overflow or by Aurélien Vallée
Published on 2010-03-27T12:45:59Z Indexed on 2010/03/27 12:53 UTC
Read the original article Hit count: 356

Filed under:
|
|
|
|

I'm new to iPhone development, and I have a question on how to create a view for my application.

The view should display a problem (using formatted/syntax highlighted text), and multiple possible answers. The user should be able to click on an answer to validate it.

Currently, I am trying to use a UITableView embedding UIWebView as contentView. That allows me to display formatted text easily. The problem is that it is a real pain to compute and adjust the height of the cells. I have to preload the webview, call sizeToFit, get its height, and update the cell accordingly. This process should be done for the problem and the answers (as they are HTML formatted text too).

It's such a pain that I am planning to switch to something else. I thought using only a big UIWebView and design everything in HTML. But I looked at some articles describing how to communicate between the HTML page and the ObjectiveC code. This seems to involve some awful tricks too...

So... that's it, I don't really know what I should do. I guess some of you dealt with such things before, and would provide some greatly appreciated tips :)

© Stack Overflow or respective owner

Related posts about iphone

Related posts about SDK