In this article I’ll try to cover one of the C# 4.0 innovations. One of the new features is covariance and contravariance on type parameters that is now supported by generic delegates and generic interfaces. First let’s see what does these words mean :)
Generally if we have some entity (interface or delegate) that is generic on type T – some Entity<T>, and two concrete entities Entity<A> and Entity<B> where B inherits from A, then there are no inheritance relationships between Entity<A> and Entity<B>. Covariance (and contravariance) adds such relationships:
Have just reached a list of top 25 most dangerous programming errors that was released by cyber security experts a week ago. An important one, I think :) And with this list are provided resources and solutions to be used to eliminate these errors if they’re present. Also seems like this list is to be used for code certifications and for software testing tools. But first of all it should be used by us, developers :)
Today I’ll show how to parse date from RSS feed to NSDate in iPhone application.
When processing several RSS feeds, it is usual task to arrange and sort them by date. Therefore text representation of date need to be transformed to NSDate.
My googling of solutions for this issue resulted in use of [NSCalendarDate dateWithNaturalLanguageString:string] function. As I wrote before, NSCalendarDate is not supported under iPhone OS, so this way lacks.
Another way is to parse date via NSDateFormatter, but I didn’t find any full solution. So let’s write it :)
A week ago I found some annoying thing about iPhone OS and iPhone simulator. As a result you cannot be really sure that application that works great on simulator whould even be compiled for device.
Unpretty thing that I found is that NSCalendarDate and NSURLDownload classes are not supported on iPhone OS. But they are do supported on simulator! Code is not compiled in device mode with error that class is unknown. Seems to be a simulator bug :(
Please, be careful, and do not use NSCalendarDate and NSURLDownload. Also test your application on a device regularly. If you do not have a device, just build your app (Cmd-B) in device mode, to be sure it is successfully compiled.
Few month ago I started to develop iPhone application for a new customer. Having a lot of .NET experience before (and no Objective-C experience), I was discouraged with absence of garbage collector. Yep, garbage collection is unfortunately not supported under iPhone OS, it is supported only under Mac OS X. Dealing with manual memory allocation/deallocation, releasing/retaining/autoreleasing took time in researches until I’ve reached a good article at stepwise.com. In a bit of information are described common memory management rules and common mistakes. Here it is:
I decided to start my own blog :) The reason why is because on my latest project I was need to search answers to my questions over the internet, and many answers were found in blogs. So, I thought, it is a goog idea to share my own knowledge and experience with whole world IT community.
So let’s start and I hope somebody finds my posts helpful :)