Sunday, 27 January 2013

import contacts to iphone simulator

Its quite some I wrote my previous blog. Now, here I am with new post called "Import Contacts to iPhone Simulators".

This Project is useful to iOS developers who needs to deal with AddressBook Framework and need to manipulates Contacts. Sometimes there is a situation where you need lots of contacts in your iOS Device/Simulator to test code but there are no contacts available and you don't have much time for that.

In this situation DummyContact project could life saver. It has following features.


  • Easy to setup
  • One click Add 100 records
  • One click Remove all records
  • It also supports iOS6
So try it and complete your task of manipulating AddressBook in smooth/smarter way.

Thursday, 8 November 2012

ar : is a fat file (use libtool(1) or lipo(1) and ar(1) on it)

Some times it happens like we have used two static libraries in our iOS project and we get error like duplicate symbols.

This may be due to similar classnames/symbols used in those two different static libraries. In such case what we can do ? We struggle to remove error due to these static libraries. But there is one way we can extract/remove objects from those static libraries with the use of ar command.

But using ar command is giving the error as fat file. This happened due to library you are using is fat library. Now what fat library means it contains more than one target architecture for e.g. armv6 and armv7.

For this kind of problem we can use lipo tool to extract a specific architecture into another .a file,
i.e. we can split that fat library in two different files supporting each architecture as armv6 and armv7.

How can we do that ? Its very simple,

lipo libYourLibrary. a -thin armv6 -output libYourLibraryarmv6.a
lipo libYourLibrary. a -thin armv7 -output libYourLibraryarmv7.a

Above commands will create two separate library for 2 different architecture. Now we can use ar command as these are not fat library. Lets remove/extract required objects from these 2 files with the use of following command,

ar -d libYourLibraryarmv6.a conflictingClass.o
ar -d libYourLibraryarmv7.a conflictingClass.o

If we don't get any error than we have removed conflictingClass from these library and we can now merget those 2 different architecture library into one as it was using i.e. rearchieve,

lipo libYourLibraryarmv6.a libYourLibraryarmv7.a -create -output libYourLibrary.a

And thats it. You are ready to rock.

Hope this helps some one as I struggled to figure out what to do in such case so I wrote this blog post.