How to fix uiviewadditions errors (Manually Three20 to Xcode project)

Standard

UITouch ivars have been removed of the iOS 6 SDK headers. Fix by this code





#ifdef __IPHONE_6_0
@implementation UITouch (TTCategory)
NSTimeInterval _timestamp;
UITouchPhase _phase;
UITouchPhase _savedPhase;
NSUInteger _tapCount;
UIWindow *_window;
UIView *_view;
UIView *_gestureView;
UIView *_warpedIntoView;
NSMutableArray *_gestureRecognizers;
NSMutableArray *_forwardingRecord;

CGPoint _locationInWindow;
CGPoint _previousLocationInWindow;
UInt8 _pathIndex;
UInt8 _pathIdentity;
float _pathMajorRadius;
struct {
    unsigned int _firstTouchForView:1;
    unsigned int _isTap:1;
    unsigned int _isDelayed:1;
    unsigned int _sentTouchesEnded:1;
    unsigned int _abandonForwardingRecord:1;
} _touchFlags;

///////////////////////////////////////////////////////////////////////////////////////////////////
- (id)initInView:(UIView *)view location:(CGPoint)location {
self = [super init];
  if (self) {
    _tapCount = 1;
    _locationInWindow = location;
    _previousLocationInWindow = location;

    UIView *target = [view.window hitTest:_locationInWindow withEvent:nil];
    _view = [target retain];
    _window = [view.window retain];
    _phase = UITouchPhaseBegan;
    _touchFlags._firstTouchForView = 1;
    _touchFlags._isTap = 1;
    _timestamp = [NSDate timeIntervalSinceReferenceDate];
  }
  return self;
}


///////////////////////////////////////////////////////////////////////////////////////////////////
- (void)changeToPhase:(UITouchPhase)phase {
  _phase = phase;
  _timestamp = [NSDate timeIntervalSinceReferenceDate];
}


@end
#endif

https://github.com/facebook/three20/pull/809

Add Three20 : http://www.youtube.com/watch?v=huNoG3qM0cM&feature=g-list&list=PLvdcn28_WxZFt658gmYDhLPfT1X7EJ-XI