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

Discussion in 'iPhone/iPad Programming' started by Darkroom, Dec 5, 2009.

  1. Guest

    Darkroom

    Joined:
    Dec 15, 2006
    Location:
    Montréal, Canada
    #1
    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>.

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

    Joined:
    May 10, 2009
    Location:
    Des Moines, WA
    #2
    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