Es mostren els missatges amb l'etiqueta de comentaris iOS development. Mostrar tots els missatges
Es mostren els missatges amb l'etiqueta de comentaris iOS development. Mostrar tots els missatges

dimarts, d’agost 28, 2012

Property lists and push vs. modal segues

This is the first post about findings on developing an application for iOS. I've just finished  (well, almost) the Coding Together course for CS193P. The course itself ended yesterday. I'm developing a real application to be submitted to Apple in the near future but I have not presented it inside the course as the timing did not suit me.
Developing the first version of the application I discovered this:

  • property lists need to have strings as keys, otherwise when you write them to file or URL the method will return NO. This can be inferred from the fact that the property list editor in Xcode has no UI for setting the type of the keys, only for the type of the values.
  • Xcode allows you to choose Push as type of a segue even if you are not inside a Navigation Controller, although the Push type in fact makes sense only when you are inside a Navigation Controller. The initial version of my app just had a Tab Bar Controller, there will be a Navigation Controller but there is not any right now. So I had to choose Modal as segue type, since choosing Push results in the segue not being performed when you click on the button that should perform it, no exception or warning appears.

dissabte, d’agost 25, 2012

Showing static content in a iPhone/iPad app

I'm writing an application which shows some static text in one of its parts. The text is descriptive and quite long and with format, with different sections, emphasized stuff, underlined stuff, and so on, so a UIWebView is best suited for this (a UITextView applies its formatting to the whole of the text it shows).
Initially I thought I would be taking advantage of the fact that UIWebView can also show Word files or PDFs. But neither was usable, for some reason or other the PDF could not be pinched for zooming and was too small to be read. The Word could be pinched but panning to the right to read each line is not that usable.
I decided therefore to use HTML for the web view and found the plentiful information about HTML for iOS Safari available in the Apple documentation. Though the doc just doesn't suggest any application to create that HTML.  HTML has been around for so long... yet a suggestion would have been useful.
First I looked at iWeb, which is a cool program to create a website but not really suited for what I needed. Besides, it has been discontinued.
After googling around, I settled for Komodo Edit, which is free and is quite lightweight yet helpful. But my HTML had accented characters and it does not support them out of the box so I had to replace all "é" with "ampersand e acute" and the same for all other accented characters, which is not cool.
At least now the text flows nicely and is scrollable.