error: framework not found ApplicationServices

Hi,
I am trying to learn this so bear with me.
I am trying to create an iphone app and so far i have implemented the code to connect the window, view and object together. Next I am trying to implement a custom view where I override the "(void)drawRect:(CGRect)rect". If I have just the method name and just have

CGContextRef context = UIGraphicsGetCurrentContext();

inside the method it runs fine. However as soon as I implement the code below