I am writing a image viewer application, which I need to set as default application for jpeg/gif files. There is an API LSGetApplicationForItem/Info for getting information on what is the default application. But I am not able to find an API where I can set my application as the default viewer for image files.
Can you please help
There's not a public API to do that, as far as I know. Instead, you register, using Info.plist (or the Document Types section of the Info editor in Xcode), that you are a provider of viewing and/or editing for whatever file types you are interested in. This will cause the system to choose your app if there's no other app who can open those file types, and will put you in the running if the user chooses Open With from the context menu when selecting a file in the Finder.