And following is content of html file which display local image from resource file. We can use "qrc:/" to locate file from resource file.

<html>
<h2> Simple in application help</h2>
<p>
Sample application that show how simple in application
help system can be created using <b>Qt Webkit's QWebView.</b>
Following image is to demostrate how file or image can
be used from Qt's resource file.
</p>
<img src="qrc:/cloud.png" />
<p>
Hope this will help some one.
</p>
</html>

Sunday, February 13, 2011

Recently I was working on iPhone project that required to post message on Facebook wall.

There is already official facebook API for iOS SDK, which we can use for interacting with Facebook.

You can download Facebook API from GitHub repository using following command.
git clone git://github.com/facebook/facebook-ios-sdk.git

To use downloaded facebook API, you need to bring all facebook API source code under your project. To do this you can just drag it's src folder and drop it under your project in XCode.

Before you start coding, you need a valid facebook application id, you can get one from Developer App. And you need to add this App ID in "fbYOUR_APP_ID" format to your project's .plist file like shown in following snapshot.

Now you are ready to use Facebook iPhone SDK. Main interface class to invoke Facebook API is "Facebook". Following is code to use Facebook class to login and autorize application to use user's facebook account.

Friday, February 4, 2011

Recently while working on iPhone code, I required to store my custom structure in to NSMutableDictionary.

Well, NSMutableDictioary only store object derived from NSObject, so either we can make our structure, a class which is derived from NSObject and that's quite heavy and inefficient solution.

Better solution is to store custom structure in NSValue object and save NSValue to NSMutableDictionary.

As apple document suggest, The purpose of NSValue is to allow items of int, float, and char, pointers, structures and object ids data types to be added to collection objects such as instances of NSArray or NSSet, which require their elements to be objects.

Following is simple code that show how custom structure can be store in NSMutableDictionary.