live superbowl stream

live superbowl stream

Watch The Superbowl online

watch superbowl live

watch superbowl online

watch superbowl online

watch superbowl live

super bowl

Watch The Superbowl online

SuperBowl


Creating Finder’s “Open With” Contextual Menu

March 13th, 2011 vira Posted in cocoa No Comments »

Hello everyone and congrats with spring/Lion/iPad2! I haven’t written for such a long time and so many things have happened.

Open With Menu

'Open With' Menu

Today I want to share with you my experience of creating the analog of “Open With” menu, similar to Finder’s one. I’ve tried to create the exact copy of this menu: default application, list of other apps and “Other…” option. I use this menu in the one of our projects – MacHider and you have take a look of how it works.

When I’ve started to implement the menu, I was a bit surprised that this isn’t common component…After googling I haven’t found any ready to use solutions. So here is how I’ve implemented it :)
Read the rest of this entry »


Cocoa Tip: Filtering NSArray using NSPredicate

January 13th, 2010 vira Posted in Computer science, cocoa 1 Comment »

Today I’ve had a small task in one of my projects – to get subset of elements from NSArray. I’ve already started writing all this NSEnumerator’s stuff (need to support 10.4) when I remembered about NSPredicator. So, instead of iterating over an array and finding elements that satisfy some condition and adding them to some output array you just need to create predicate and filter your input array with it. Here is the sample code:

NSPredicate *predicate = [NSPredicate predicateWithFormat:@"storeState == 1"];
NSArray  *outputArray = [inputArray filteredArrayUsingPredicate:predicate];

Predicates language seems to be very powerful and simple. But I can’t tell you anything about performance, need to investigate.

UPDATE If you want to filter array with regular expressions just use a predicate like this one:

[NSPredicate predicateWithFormat:@"SELF MATCHES %@", regexp];

Further reading: Apple Predicates Programming Guide