September 14, 2010
couchDB and the iOS environment
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
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.
- Drag your ttf files into the Resources group of your project selecting the copy checkbox.
- Open your applications’ info.plist found in the Resources group.
- Control-click on any of the properties and select New
- Select ‘fonts provided by application’
- Expand the resource just created by clicking the triangle button on the left of the description
- Enter Freshman.ttf in the Value column (You would put the name of your font file here)
- Control-click the Freshman.ttf row and select Add Row
- Enter PFHandbookProRegular.ttf in the Value column(You would put the name of another font you want to use here)
- 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.