Is #import <CoreGraphics/CoreGraphics.h> No Longer Required?

Discussion in 'iOS Programming' started by Darkroom, Dec 5, 2009.

  1. Guest


    Dec 15, 2006
    Montréal, Canada
    i've noticed since the early versions of iPhone SDK that the Core Graphics framework is automatically linked to new projects along with UIKit and Foundation.

    just now i've realized that one of my classes which uses Core Graphics will still function (in the simulator, haven't tried on device) even without #import <CoreGraphics/CoreGraphics.h>.

    //stuff like this
    CGImageRef imageRef = [image CGImage];
    CGColorSpaceRef colorSpace = CGColorSpaceCreateDeviceRGB();	
    NSUInteger imageRefHeight = CGImageGetHeight(imageRef);
    shouldn't the compiler be freaking out?
  2. macrumors 6502a

    May 10, 2009
    Des Moines, WA
    If you follow it back I think you'll find 'UIKit.h', included in your '_Prefix.pch', drags it in for you.

Share This Page