GCD, NSOperation and Core Data/ Files on disk

Core data is fast, even on iOS, where handheld devices lack in speed when compared to desktop computers. However, there will be times where you will be required to do some heavy reading, wether that will be plain files from disk or information stored in Core Data. In my case, I initially tried to load too much data from a Core Data database using GCD, resulting in deadlocks, and later, I tried that using NSOperation. To save many people from frustration, I thought I should post my experiences and some general guidelines here.

Continue reading

Fedora 16 on Macbook Impressions

Fedora 15 was a mixed bag of impressions for me, but overrall, it was a nice update… or should I say, a nice revamp?

Fedora 15 took a giant leap backwards by depriving the entire OS of many features that its predecessors had, in favor of a more user friendly graphics environment, and a new UI and shell basis for more features to be implemented in future releases. Right until then, I was using Ubuntu for my Linux needs, because it was simple to set up, reliable, and had a very large user base, so help was easier to get.

Continue reading

UniLib Creator (beta)

Universal Library Creator (Unilib) is an small application created in my spare time to facilitate operations done on static and dynamic libraries on iOS and OS X.

It combines some pretty neat stuff I wanted to try for so long using system services. I began writing some code for system services some time ago, and this is a project I made for myself, and thing it will help others.

It has helped me in many occasions, especially with Xcode 4. On iOS, the static libraries produced are for the actual device or the iPhone. It’s never for both. I don’t know why Apple hasn’t included this functionality in XCode 4, since it was already included in Xcode 3. All I know, is that I had found it hard to distribute my static libraries without giving the code, since the user would have to link them against the device or the simulator depending on the test environment, never both.

Some features:

  • Combine static FAT or plain libraries to make FAT static libraries for both OS X and iPhone
  • Obtain info about a static library like the architectures in it, and the object files in it
  • Exctract specific applications from a library.
  • Really UGLY user interface for the time being. Will certainly be improved.

Unilib is currently in bleeding edge beta, with only those basic functions implemented. It will be updated constantly, until it reaches to a point where it will be a commercial application for the Mac Application Store. So far it is free for use.

Requires Lion and an Intel 64-bit platform.

You can download the application here. It also includes some basic auto-update mechanism. Will add more features in future releases.

PCRE for iPhone

Lately, I’ve been working on a project requiring heavy use of regular expressions on Cocoa. Foundation frameworks do not offer built in support for regular expressions. Instead, they do heavy work using NSScanner, and NSPredicate classes.

 A framework was created to solve this problem, called RegexKitLite, but it’s heavy use of and linking to Apple’s internal ICU framework, makes it very dangerous to App Store Rejection, when talking about applications for iPhone.

So, I’ve been searching for something like PCRE for iPhone, and I couldn’t find it anywhere. Therefore, I downloaded, and compiled the famous and standard PCRE library for  the iPhone as a dylib. I know that for some of you this can be a difficult process, so I will describe the steps here.

Continue reading

Installing Portable Dynamic (And Static) Libraries On OS X

Last Update: 07-02-2009

I recently decided to install portable Libraries on my Mac, a procedure that has never been proven easy for me for the past years. In order to port my programs from one platform to another, I must have downloaded portable libraries that exist in all platforms, such as PCRE (perl compatible regular expressions library for C and C++).

The problem is that when I try to install the libraries, I mostly encounter errors and problems during compilation while using the “make” tool of UNIX. This is due to the developers not being careful to handle all different system versions. Even when I did manage to install the necessary libraries, I couldn’t find a way to make them work with Xcode.

So what do you do when you need to install a portable Library and use it with Xcode?

Continue reading