Converting to Storyboards Release Notes
2013-01-12 20:42
399 查看
StoryboardingisanewwaytocreateuserinterfacesforiOSapplications,beginningwithiOS5andXcode4.2.Usingstoryboards,youcandesigntheviewcontrollersthatcomposeyourapplicationasscenesintheXcodedesigncanvasandvisuallydefinethenavigationbetweenthescenesusingsegues.
ThereareafewstepsyouneedtotaketoconvertanexistingiOSapplicationprojecttousestoryboards.Inaddition,thereareothernewpatternsyoucanadopt.
Listing1-2Minimalapplicationdelegateimplementationfile
Inthe
Changeittolooklikethis:
ThereareafewstepsyouneedtotaketoconvertanexistingiOSapplicationprojecttousestoryboards.Inaddition,thereareothernewpatternsyoucanadopt.
ConfiguretheApplicationDelegate
Theapplicationdelegateisresponsibleforloadingthestoryboardandmanagingthewindow.Youneedtospecifythenameoftheapplicationdelegateclassin,andensurethattheapplicationdelegatehasapropertycalledUIApplicationMain
window.Ifyoudon’thaveanexistingapplicationdelegateclass,youneedtocreateone.Aminimalimplementationwouldlooklikethis:Listing1-1Minimalapplicationdelegateheaderfile
#import<UIKit/UIKit.h> |
@interfaceAppDelegate:NSObject<UIApplicationDelegate> |
@property(strong,nonatomic)UIWindow*window; |
@end |
#import"AppDelegate.h" |
@implementationAppDelegate |
@synthesizewindow=_window; |
@end |
main.mfile,settheapplicationdelegateclassin
UIApplicationMain.Yourexistingmain.mfileprobablylookssomethinglikethis:
#import<UIKit/UIKit.h> |
intmain(intargc,char*argv[]){ |
NSAutoreleasePool*pool=[[NSAutoreleasePoolalloc]init]; |
intretVal=UIApplicationMain(argc,argv,nil,nil); |
[poolrelease]; |
returnretVal; |
} |
#import<UIKit/UIKit.h> |
#import"AppDelegate.h" |
intmain(intargc,char*argv[]){ |
@autoreleasepool{ |
returnUIApplicationMain(argc,argv,nil,NSStringFromClass([AppDelegateclass])); |
} |
} |
相关文章推荐
- 转换到 StoryBoard 的发布说明(Converting to Storyboards Release Notes)
- 转换到 StoryBoard 的公布说明(Converting to Storyboards Release Notes)
- 迁移至ARC版本说明(Transitioning to ARC Release Notes)
- Transitioning to ARC Release Notes
- Transitioning to ARC Release Notes
- Transitioning to ARC Release Notes
- Transitioning to ARC Release Notes
- Converting Storyboard from iPhone to iPad
- Transitioning to ARC Release Notes
- Transitioning to ARC Release Notes
- [翻译]Transitioning to ARC Release Notes中文版
- ios 迁移至ARC版本说明(Transitioning to ARC Release Notes)
- Conflicting collector combinations in option list; please refer to the release notes for the combina
- Magic xpa 2.5发布 Magic xpa 2.5 Release Notes
- Error:Error converting bytecode to dex: Cause: java.lang.RuntimeException: Exception parsing classes
- In an iOS 5 Storyboard, how do you push a new scene to the original view controller from a Popover?
- Converting the app to landscape
- converting char array to string type
- 机器学习基石notes-Lecture2 Learning to Answer Yes/No
- Converting FC layers to CONV layers