Lion Xcode 4.2改版 objective-C 程式變動的記錄:
- main.m 繼承的改變
- UIButton文字大小設定
- Core Foundation URL Access Utilities Reference
/***********************************************************************/
main.m 繼承的改變:
原來:
int main(int argc, char *argv[])
{
NSAutoreleasePool * pool = [[NSAutoreleasePoolalloc] init];
int retVal = UIApplicationMain(argc, argv, nil, @"SampleAppDelegate");
[pool release];
return retVal;
}
新版:
int main(int argc, char *argv[])
{
@autoreleasepool {
returnUIApplicationMain(argc, argv, nil, NSStringFromClass([AnimButtonFlipAppDelegateclass]));
}
}
/***********************************************************************/
UIButton文字大小設定:
原來:
[button setFont:[UIFont boldSystemFontOfSize:24.0f]];
新版:
[button.titleLabel setFont: [UIFont boldSystemFontOfSize: 24.0f]];
/**********************************************************************/
Core Foundation URL Access Utilities Reference:
原來:
CFURLRef baseURL = (CFURLRef)[[NSURL alloc] initFileURLWithPath:sndpath];
新版:
CFURLRef baseURL = (__bridge CFURLRef)[[NSURL alloc] initFileURLWithPath:sndpath];