September 14, 2010

couchDB and the iOS environment

Posted in iPhone development tagged , , , , , , at 8:16 pm by tetontech

Recently I got a ping from a QuickConnect user regarding connecting to couchDB. For those that don’t know couchDB is a document storage database. It is written in Erlang and, if I remember correctly, uses the Mnesia a database written in Erlang. couchDB also uses the HTTP protocol and JSON for communication.

As I went back and spent a few minutes with couchDB again I realized that the Objective-C version of the QCFamily Enterprise Data Sync feature that I will be presenting at the iPhoneDevCon on the 27th – 30th of September, 2010 needs only minor modifications to work with couchDB. I hadn’t thought of this before and was pleased that with these minor modifications couchDB could be added to Oracle, MySQL, and other relational databases that are supported.

Too much fun!

September 3, 2010

Using Custom fonts in your iOS application

Posted in iPhone development tagged , , , , , at 12:18 am by tetontech

I have found that there are quite a few postings out there about how to use custom fonts in your application.  It is unfortunate that I didn’t find  a single one that actually helped me use a custom font.  Most of them echoed each other and gave misleading or erroneous advice.  Because of this I am going to post how to actually use a custom font in your app.

First, you must be aware that custom fonts are added on a per-application basis.  You can not add a font to your iOS device and have it be available for all of your applications.

Second, no code needs to be added in order for you to use the custom font or fonts in a QuickConnectFamily hybrid iOS application or any other application that uses the UIWebView.

Third, no @font-face CSS call is needed in your application.

Fourth, this example will show two custom fonts being added and used.  The first is the Freshman font, the second is the PF Handbook Pro Normal font.  Both of these are available as ttf files.

OK.  So here is how we do it.

  1. Drag your ttf files into the Resources group of your project selecting the copy checkbox.
  2. Open your applications’ info.plist found in the Resources group.
  3. Control-click on any of the properties and select New
  4. Select ‘fonts provided by application’
  5. Expand the resource just created by clicking the triangle button on the left of the description
  6. Enter Freshman.ttf in the Value column (You would put the name of your font file here)
  7. Control-click the Freshman.ttf row and select Add Row
  8. Enter PFHandbookProRegular.ttf in the Value column(You would put the name of another font you want to use here)
  9. Use the font in your CSS or directly in an inline style.  Both now work.

Hopefully this will clear things up regarding using custom fonts.

%d bloggers like this: