fix compilation error in xcodebuild command line, which are caused by ios6 deprecated marcos and enums

This commit is contained in:
walzer 2012-09-27 00:44:40 +08:00
parent 70e16a5835
commit c9772c76ec
8 changed files with 30 additions and 16 deletions

View File

@ -118,18 +118,17 @@
}
size.width = MIN(size.width, origSize.width);
// adjust the point for alignment
switch ((NSTextAlignment)self.textAlignment) {
case NSTextAlignmentLeft:
switch (self.textAlignment) {
case UITextAlignmentLeft:
break;
case NSTextAlignmentCenter:
case UITextAlignmentCenter:
point.x += (origSize.width - size.width) / 2.0f;
break;
case NSTextAlignmentRight:
case UITextAlignmentRight:
point.x += origSize.width - size.width;
break;
case NSTextAlignmentJustified:
case NSTextAlignmentNatural:
default: break;
default:
break;
}
[self.text drawAtPoint:point forWidth:size.width withZFont:actualFont lineBreakMode:self.lineBreakMode];
} else {

View File

@ -637,19 +637,18 @@ static CGSize drawOrSizeTextConstrainedToSize(BOOL performDraw, NSString *string
// draw
if (performDraw) {
switch ((NSTextAlignment)alignment) {
case NSTextAlignmentLeft:
switch (alignment) {
case UITextAlignmentLeft:
drawPoint.x = 0;
break;
case NSTextAlignmentCenter:
case UITextAlignmentCenter:
drawPoint.x = (constrainedSize.width - lineSize.width) / 2.0f;
break;
case NSTextAlignmentRight:
case UITextAlignmentRight:
drawPoint.x = constrainedSize.width - lineSize.width;
break;
case NSTextAlignmentJustified:
case NSTextAlignmentNatural:
default: break;
default:
break;
}
NSUInteger stopGlyphIdx = glyphIdx;
NSUInteger lastRunIdx = currentRunIdx;

View File

@ -57,15 +57,21 @@
return UIInterfaceOrientationIsLandscape( interfaceOrientation );
}
// For ios6, use supportedInterfaceOrientations & shouldAutorotate instead
- (NSUInteger) supportedInterfaceOrientations{
// For ios6.0 and higher, use supportedInterfaceOrientations & shouldAutorotate instead
- (NSUInteger) supportedInterfaceOrientations
{
#ifdef __IPHONE_6_0
return UIInterfaceOrientationMaskLandscape;
#endif
}
- (BOOL) shouldAutorotate {
return YES;
}
- (void)didReceiveMemoryWarning {
// Releases the view if it doesn't have a superview.
[super didReceiveMemoryWarning];

View File

@ -59,7 +59,9 @@
// For ios6, use supportedInterfaceOrientations & shouldAutorotate instead
- (NSUInteger) supportedInterfaceOrientations{
#ifdef __IPHONE_6_0
return UIInterfaceOrientationMaskLandscape;
#endif
}
- (BOOL) shouldAutorotate {

View File

@ -59,7 +59,9 @@
// For ios6, use supportedInterfaceOrientations & shouldAutorotate instead
- (NSUInteger) supportedInterfaceOrientations{
#ifdef __IPHONE_6_0
return UIInterfaceOrientationMaskLandscape;
#endif
}
- (BOOL) shouldAutorotate {

View File

@ -42,7 +42,9 @@
// For ios6, use supportedInterfaceOrientations & shouldAutorotate instead
- (NSUInteger) supportedInterfaceOrientations{
#ifdef __IPHONE_6_0
return UIInterfaceOrientationMaskLandscape;
#endif
}
- (BOOL) shouldAutorotate {

View File

@ -42,7 +42,9 @@
// For ios6, use supportedInterfaceOrientations & shouldAutorotate instead
- (NSUInteger) supportedInterfaceOrientations{
#ifdef __IPHONE_6_0
return UIInterfaceOrientationMaskLandscape;
#endif
}
- (BOOL) shouldAutorotate {

View File

@ -59,7 +59,9 @@
// For ios6, use supportedInterfaceOrientations & shouldAutorotate instead
- (NSUInteger) supportedInterfaceOrientations{
#ifdef __IPHONE_6_0
return UIInterfaceOrientationMaskLandscape;
#endif
}
- (BOOL) shouldAutorotate {