MonkeyBusiness
MonkeyBusiness

Reputation: 379

Use C to generate dynamic HTML in iPad app?

I'm working on an iPad app that has a several complex tables I think might be best represented as HTML tables, except the data's all dynamic (variable number of columns and rows and cell contents). Since the rest of the app is all in C, is it possible to embed C in UIWebView to generate the dynamic content? Otherwise, I suppose I'll have to use JavaScript and live with a two code app. I don't think Table View is flexible enough, at least with my rudimentary xCode skills.

Thanks for any suggestions.

Upvotes: 1

Views: 310

Answers (1)

Tozar
Tozar

Reputation: 986

You could use loadHTMLString:buffer baseURL:nil to load in dynamically generated HTML. It would only be as difficult as you make it. In the simplest case, for each table you add <table> to the buffer, then for each row add the <tr> tags and for each column within the row add your <td> and print the data for that cell. At the end of each for loop print the appropriate end tags. The code will be as complex as you want the table to be.

Upvotes: 3

Related Questions