├── .gitignore ├── README ├── changeViewController.xcodeproj └── project.pbxproj └── changeViewController ├── AppDelegate.h ├── AppDelegate.m ├── FirstViewController.h ├── FirstViewController.m ├── FirstViewController.xib ├── MainViewController.h ├── MainViewController.m ├── MainViewController.xib ├── SecondViewController.h ├── SecondViewController.m ├── SecondViewController.xib ├── ThirdViewController.h ├── ThirdViewController.m ├── ThirdViewController.xib ├── changeViewController-Info.plist ├── changeViewController-Prefix.pch ├── en.lproj └── InfoPlist.strings └── main.m /.gitignore: -------------------------------------------------------------------------------- 1 | project.xcworkspace 2 | xcuserdata 3 | -------------------------------------------------------------------------------- /README: -------------------------------------------------------------------------------- 1 | The sample code is modified from http://easymorse-iphone.googlecode.com/svn/trunk/changeViewController, the original author is marcus wang, his blog is http://wangjun.easymorse.com/?p=1630. 2 | 3 | I change his sample code a little to watch the view load and unload event when receiving memory warning. I also have a blog to introduce the new APIs about UIViewController on iOS5, it is from http://blog.devtang.com/blog/2012/02/06/new-methods-in-uiviewcontroller-of-ios5/ 4 | -------------------------------------------------------------------------------- /changeViewController.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 46; 7 | objects = { 8 | 9 | /* Begin PBXBuildFile section */ 10 | 2CA944E114BD82320045D2B8 /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 2CA944E014BD82320045D2B8 /* UIKit.framework */; }; 11 | 2CA944E314BD82320045D2B8 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 2CA944E214BD82320045D2B8 /* Foundation.framework */; }; 12 | 2CA944E514BD82320045D2B8 /* CoreGraphics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 2CA944E414BD82320045D2B8 /* CoreGraphics.framework */; }; 13 | 2CA944EB14BD82320045D2B8 /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 2CA944E914BD82320045D2B8 /* InfoPlist.strings */; }; 14 | 2CA944ED14BD82320045D2B8 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 2CA944EC14BD82320045D2B8 /* main.m */; }; 15 | 2CA944F114BD82320045D2B8 /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 2CA944F014BD82320045D2B8 /* AppDelegate.m */; }; 16 | 2CA944FA14BD82A70045D2B8 /* MainViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 2CA944F814BD82A70045D2B8 /* MainViewController.m */; }; 17 | 2CA944FB14BD82A70045D2B8 /* MainViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = 2CA944F914BD82A70045D2B8 /* MainViewController.xib */; }; 18 | 2CA9450414BD84880045D2B8 /* FirstViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 2CA9450214BD84880045D2B8 /* FirstViewController.m */; }; 19 | 2CA9450514BD84880045D2B8 /* FirstViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = 2CA9450314BD84880045D2B8 /* FirstViewController.xib */; }; 20 | 2CA9450914BD849A0045D2B8 /* SecondViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 2CA9450714BD849A0045D2B8 /* SecondViewController.m */; }; 21 | 2CA9450A14BD849A0045D2B8 /* SecondViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = 2CA9450814BD849A0045D2B8 /* SecondViewController.xib */; }; 22 | 2CA9450E14BD84AD0045D2B8 /* ThirdViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 2CA9450C14BD84AC0045D2B8 /* ThirdViewController.m */; }; 23 | 2CA9450F14BD84AD0045D2B8 /* ThirdViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = 2CA9450D14BD84AC0045D2B8 /* ThirdViewController.xib */; }; 24 | /* End PBXBuildFile section */ 25 | 26 | /* Begin PBXFileReference section */ 27 | 2CA944DC14BD82320045D2B8 /* changeViewController.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = changeViewController.app; sourceTree = BUILT_PRODUCTS_DIR; }; 28 | 2CA944E014BD82320045D2B8 /* UIKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = UIKit.framework; path = System/Library/Frameworks/UIKit.framework; sourceTree = SDKROOT; }; 29 | 2CA944E214BD82320045D2B8 /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; }; 30 | 2CA944E414BD82320045D2B8 /* CoreGraphics.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreGraphics.framework; path = System/Library/Frameworks/CoreGraphics.framework; sourceTree = SDKROOT; }; 31 | 2CA944E814BD82320045D2B8 /* changeViewController-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "changeViewController-Info.plist"; sourceTree = ""; }; 32 | 2CA944EA14BD82320045D2B8 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = ""; }; 33 | 2CA944EC14BD82320045D2B8 /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; 34 | 2CA944EE14BD82320045D2B8 /* changeViewController-Prefix.pch */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "changeViewController-Prefix.pch"; sourceTree = ""; }; 35 | 2CA944EF14BD82320045D2B8 /* AppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = ""; }; 36 | 2CA944F014BD82320045D2B8 /* AppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = ""; }; 37 | 2CA944F714BD82A70045D2B8 /* MainViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MainViewController.h; sourceTree = ""; }; 38 | 2CA944F814BD82A70045D2B8 /* MainViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MainViewController.m; sourceTree = ""; }; 39 | 2CA944F914BD82A70045D2B8 /* MainViewController.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = MainViewController.xib; sourceTree = ""; }; 40 | 2CA9450114BD84880045D2B8 /* FirstViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = FirstViewController.h; sourceTree = ""; }; 41 | 2CA9450214BD84880045D2B8 /* FirstViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = FirstViewController.m; sourceTree = ""; }; 42 | 2CA9450314BD84880045D2B8 /* FirstViewController.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = FirstViewController.xib; sourceTree = ""; }; 43 | 2CA9450614BD849A0045D2B8 /* SecondViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SecondViewController.h; sourceTree = ""; }; 44 | 2CA9450714BD849A0045D2B8 /* SecondViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SecondViewController.m; sourceTree = ""; }; 45 | 2CA9450814BD849A0045D2B8 /* SecondViewController.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = SecondViewController.xib; sourceTree = ""; }; 46 | 2CA9450B14BD84AC0045D2B8 /* ThirdViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ThirdViewController.h; sourceTree = ""; }; 47 | 2CA9450C14BD84AC0045D2B8 /* ThirdViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ThirdViewController.m; sourceTree = ""; }; 48 | 2CA9450D14BD84AC0045D2B8 /* ThirdViewController.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = ThirdViewController.xib; sourceTree = ""; }; 49 | /* End PBXFileReference section */ 50 | 51 | /* Begin PBXFrameworksBuildPhase section */ 52 | 2CA944D914BD82320045D2B8 /* Frameworks */ = { 53 | isa = PBXFrameworksBuildPhase; 54 | buildActionMask = 2147483647; 55 | files = ( 56 | 2CA944E114BD82320045D2B8 /* UIKit.framework in Frameworks */, 57 | 2CA944E314BD82320045D2B8 /* Foundation.framework in Frameworks */, 58 | 2CA944E514BD82320045D2B8 /* CoreGraphics.framework in Frameworks */, 59 | ); 60 | runOnlyForDeploymentPostprocessing = 0; 61 | }; 62 | /* End PBXFrameworksBuildPhase section */ 63 | 64 | /* Begin PBXGroup section */ 65 | 2CA944D114BD82310045D2B8 = { 66 | isa = PBXGroup; 67 | children = ( 68 | 2CA944E614BD82320045D2B8 /* changeViewController */, 69 | 2CA944DF14BD82320045D2B8 /* Frameworks */, 70 | 2CA944DD14BD82320045D2B8 /* Products */, 71 | ); 72 | sourceTree = ""; 73 | }; 74 | 2CA944DD14BD82320045D2B8 /* Products */ = { 75 | isa = PBXGroup; 76 | children = ( 77 | 2CA944DC14BD82320045D2B8 /* changeViewController.app */, 78 | ); 79 | name = Products; 80 | sourceTree = ""; 81 | }; 82 | 2CA944DF14BD82320045D2B8 /* Frameworks */ = { 83 | isa = PBXGroup; 84 | children = ( 85 | 2CA944E014BD82320045D2B8 /* UIKit.framework */, 86 | 2CA944E214BD82320045D2B8 /* Foundation.framework */, 87 | 2CA944E414BD82320045D2B8 /* CoreGraphics.framework */, 88 | ); 89 | name = Frameworks; 90 | sourceTree = ""; 91 | }; 92 | 2CA944E614BD82320045D2B8 /* changeViewController */ = { 93 | isa = PBXGroup; 94 | children = ( 95 | 2CA944EF14BD82320045D2B8 /* AppDelegate.h */, 96 | 2CA944F014BD82320045D2B8 /* AppDelegate.m */, 97 | 2CA944E714BD82320045D2B8 /* Supporting Files */, 98 | 2CA944F714BD82A70045D2B8 /* MainViewController.h */, 99 | 2CA944F814BD82A70045D2B8 /* MainViewController.m */, 100 | 2CA944F914BD82A70045D2B8 /* MainViewController.xib */, 101 | 2CA9450114BD84880045D2B8 /* FirstViewController.h */, 102 | 2CA9450214BD84880045D2B8 /* FirstViewController.m */, 103 | 2CA9450314BD84880045D2B8 /* FirstViewController.xib */, 104 | 2CA9450614BD849A0045D2B8 /* SecondViewController.h */, 105 | 2CA9450714BD849A0045D2B8 /* SecondViewController.m */, 106 | 2CA9450814BD849A0045D2B8 /* SecondViewController.xib */, 107 | 2CA9450B14BD84AC0045D2B8 /* ThirdViewController.h */, 108 | 2CA9450C14BD84AC0045D2B8 /* ThirdViewController.m */, 109 | 2CA9450D14BD84AC0045D2B8 /* ThirdViewController.xib */, 110 | ); 111 | path = changeViewController; 112 | sourceTree = ""; 113 | }; 114 | 2CA944E714BD82320045D2B8 /* Supporting Files */ = { 115 | isa = PBXGroup; 116 | children = ( 117 | 2CA944E814BD82320045D2B8 /* changeViewController-Info.plist */, 118 | 2CA944E914BD82320045D2B8 /* InfoPlist.strings */, 119 | 2CA944EC14BD82320045D2B8 /* main.m */, 120 | 2CA944EE14BD82320045D2B8 /* changeViewController-Prefix.pch */, 121 | ); 122 | name = "Supporting Files"; 123 | sourceTree = ""; 124 | }; 125 | /* End PBXGroup section */ 126 | 127 | /* Begin PBXNativeTarget section */ 128 | 2CA944DB14BD82320045D2B8 /* changeViewController */ = { 129 | isa = PBXNativeTarget; 130 | buildConfigurationList = 2CA944F414BD82320045D2B8 /* Build configuration list for PBXNativeTarget "changeViewController" */; 131 | buildPhases = ( 132 | 2CA944D814BD82320045D2B8 /* Sources */, 133 | 2CA944D914BD82320045D2B8 /* Frameworks */, 134 | 2CA944DA14BD82320045D2B8 /* Resources */, 135 | ); 136 | buildRules = ( 137 | ); 138 | dependencies = ( 139 | ); 140 | name = changeViewController; 141 | productName = changeViewController; 142 | productReference = 2CA944DC14BD82320045D2B8 /* changeViewController.app */; 143 | productType = "com.apple.product-type.application"; 144 | }; 145 | /* End PBXNativeTarget section */ 146 | 147 | /* Begin PBXProject section */ 148 | 2CA944D314BD82310045D2B8 /* Project object */ = { 149 | isa = PBXProject; 150 | attributes = { 151 | LastUpgradeCheck = 0420; 152 | }; 153 | buildConfigurationList = 2CA944D614BD82310045D2B8 /* Build configuration list for PBXProject "changeViewController" */; 154 | compatibilityVersion = "Xcode 3.2"; 155 | developmentRegion = English; 156 | hasScannedForEncodings = 0; 157 | knownRegions = ( 158 | en, 159 | ); 160 | mainGroup = 2CA944D114BD82310045D2B8; 161 | productRefGroup = 2CA944DD14BD82320045D2B8 /* Products */; 162 | projectDirPath = ""; 163 | projectRoot = ""; 164 | targets = ( 165 | 2CA944DB14BD82320045D2B8 /* changeViewController */, 166 | ); 167 | }; 168 | /* End PBXProject section */ 169 | 170 | /* Begin PBXResourcesBuildPhase section */ 171 | 2CA944DA14BD82320045D2B8 /* Resources */ = { 172 | isa = PBXResourcesBuildPhase; 173 | buildActionMask = 2147483647; 174 | files = ( 175 | 2CA944EB14BD82320045D2B8 /* InfoPlist.strings in Resources */, 176 | 2CA944FB14BD82A70045D2B8 /* MainViewController.xib in Resources */, 177 | 2CA9450514BD84880045D2B8 /* FirstViewController.xib in Resources */, 178 | 2CA9450A14BD849A0045D2B8 /* SecondViewController.xib in Resources */, 179 | 2CA9450F14BD84AD0045D2B8 /* ThirdViewController.xib in Resources */, 180 | ); 181 | runOnlyForDeploymentPostprocessing = 0; 182 | }; 183 | /* End PBXResourcesBuildPhase section */ 184 | 185 | /* Begin PBXSourcesBuildPhase section */ 186 | 2CA944D814BD82320045D2B8 /* Sources */ = { 187 | isa = PBXSourcesBuildPhase; 188 | buildActionMask = 2147483647; 189 | files = ( 190 | 2CA944ED14BD82320045D2B8 /* main.m in Sources */, 191 | 2CA944F114BD82320045D2B8 /* AppDelegate.m in Sources */, 192 | 2CA944FA14BD82A70045D2B8 /* MainViewController.m in Sources */, 193 | 2CA9450414BD84880045D2B8 /* FirstViewController.m in Sources */, 194 | 2CA9450914BD849A0045D2B8 /* SecondViewController.m in Sources */, 195 | 2CA9450E14BD84AD0045D2B8 /* ThirdViewController.m in Sources */, 196 | ); 197 | runOnlyForDeploymentPostprocessing = 0; 198 | }; 199 | /* End PBXSourcesBuildPhase section */ 200 | 201 | /* Begin PBXVariantGroup section */ 202 | 2CA944E914BD82320045D2B8 /* InfoPlist.strings */ = { 203 | isa = PBXVariantGroup; 204 | children = ( 205 | 2CA944EA14BD82320045D2B8 /* en */, 206 | ); 207 | name = InfoPlist.strings; 208 | sourceTree = ""; 209 | }; 210 | /* End PBXVariantGroup section */ 211 | 212 | /* Begin XCBuildConfiguration section */ 213 | 2CA944F214BD82320045D2B8 /* Debug */ = { 214 | isa = XCBuildConfiguration; 215 | buildSettings = { 216 | ALWAYS_SEARCH_USER_PATHS = NO; 217 | ARCHS = "$(ARCHS_STANDARD_32_BIT)"; 218 | CLANG_ENABLE_OBJC_ARC = YES; 219 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 220 | COPY_PHASE_STRIP = NO; 221 | GCC_C_LANGUAGE_STANDARD = gnu99; 222 | GCC_DYNAMIC_NO_PIC = NO; 223 | GCC_OPTIMIZATION_LEVEL = 0; 224 | GCC_PREPROCESSOR_DEFINITIONS = ( 225 | "DEBUG=1", 226 | "$(inherited)", 227 | ); 228 | GCC_SYMBOLS_PRIVATE_EXTERN = NO; 229 | GCC_VERSION = com.apple.compilers.llvm.clang.1_0; 230 | GCC_WARN_ABOUT_MISSING_PROTOTYPES = YES; 231 | GCC_WARN_ABOUT_RETURN_TYPE = YES; 232 | GCC_WARN_UNUSED_VARIABLE = YES; 233 | IPHONEOS_DEPLOYMENT_TARGET = 5.0; 234 | SDKROOT = iphoneos; 235 | }; 236 | name = Debug; 237 | }; 238 | 2CA944F314BD82320045D2B8 /* Release */ = { 239 | isa = XCBuildConfiguration; 240 | buildSettings = { 241 | ALWAYS_SEARCH_USER_PATHS = NO; 242 | ARCHS = "$(ARCHS_STANDARD_32_BIT)"; 243 | CLANG_ENABLE_OBJC_ARC = YES; 244 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 245 | COPY_PHASE_STRIP = YES; 246 | GCC_C_LANGUAGE_STANDARD = gnu99; 247 | GCC_VERSION = com.apple.compilers.llvm.clang.1_0; 248 | GCC_WARN_ABOUT_MISSING_PROTOTYPES = YES; 249 | GCC_WARN_ABOUT_RETURN_TYPE = YES; 250 | GCC_WARN_UNUSED_VARIABLE = YES; 251 | IPHONEOS_DEPLOYMENT_TARGET = 5.0; 252 | OTHER_CFLAGS = "-DNS_BLOCK_ASSERTIONS=1"; 253 | SDKROOT = iphoneos; 254 | VALIDATE_PRODUCT = YES; 255 | }; 256 | name = Release; 257 | }; 258 | 2CA944F514BD82320045D2B8 /* Debug */ = { 259 | isa = XCBuildConfiguration; 260 | buildSettings = { 261 | GCC_PRECOMPILE_PREFIX_HEADER = YES; 262 | GCC_PREFIX_HEADER = "changeViewController/changeViewController-Prefix.pch"; 263 | INFOPLIST_FILE = "changeViewController/changeViewController-Info.plist"; 264 | PRODUCT_NAME = "$(TARGET_NAME)"; 265 | WRAPPER_EXTENSION = app; 266 | }; 267 | name = Debug; 268 | }; 269 | 2CA944F614BD82320045D2B8 /* Release */ = { 270 | isa = XCBuildConfiguration; 271 | buildSettings = { 272 | GCC_PRECOMPILE_PREFIX_HEADER = YES; 273 | GCC_PREFIX_HEADER = "changeViewController/changeViewController-Prefix.pch"; 274 | INFOPLIST_FILE = "changeViewController/changeViewController-Info.plist"; 275 | PRODUCT_NAME = "$(TARGET_NAME)"; 276 | WRAPPER_EXTENSION = app; 277 | }; 278 | name = Release; 279 | }; 280 | /* End XCBuildConfiguration section */ 281 | 282 | /* Begin XCConfigurationList section */ 283 | 2CA944D614BD82310045D2B8 /* Build configuration list for PBXProject "changeViewController" */ = { 284 | isa = XCConfigurationList; 285 | buildConfigurations = ( 286 | 2CA944F214BD82320045D2B8 /* Debug */, 287 | 2CA944F314BD82320045D2B8 /* Release */, 288 | ); 289 | defaultConfigurationIsVisible = 0; 290 | defaultConfigurationName = Release; 291 | }; 292 | 2CA944F414BD82320045D2B8 /* Build configuration list for PBXNativeTarget "changeViewController" */ = { 293 | isa = XCConfigurationList; 294 | buildConfigurations = ( 295 | 2CA944F514BD82320045D2B8 /* Debug */, 296 | 2CA944F614BD82320045D2B8 /* Release */, 297 | ); 298 | defaultConfigurationIsVisible = 0; 299 | }; 300 | /* End XCConfigurationList section */ 301 | }; 302 | rootObject = 2CA944D314BD82310045D2B8 /* Project object */; 303 | } 304 | -------------------------------------------------------------------------------- /changeViewController/AppDelegate.h: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.h 3 | // changeViewController 4 | // 5 | // Created by marcus wang on 12-1-11. 6 | // Copyright (c) 2012年 __MyCompanyName__. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface AppDelegate : UIResponder 12 | 13 | @property (strong, nonatomic) UIWindow *window; 14 | 15 | @end 16 | -------------------------------------------------------------------------------- /changeViewController/AppDelegate.m: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.m 3 | // changeViewController 4 | // 5 | // Created by marcus wang on 12-1-11. 6 | // Copyright (c) 2012年 __MyCompanyName__. All rights reserved. 7 | // 8 | 9 | #import "AppDelegate.h" 10 | 11 | #import "MainViewController.h" 12 | 13 | @implementation AppDelegate 14 | 15 | @synthesize window = _window; 16 | 17 | - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions 18 | { 19 | self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]]; 20 | // Override point for customization after application launch. 21 | MainViewController *mainViewController=[[MainViewController alloc] initWithNibName:@"MainViewController" bundle:nil]; 22 | self.window.rootViewController=mainViewController; 23 | [self.window makeKeyAndVisible]; 24 | return YES; 25 | } 26 | 27 | - (void)applicationWillResignActive:(UIApplication *)application 28 | { 29 | /* 30 | Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state. 31 | Use this method to pause ongoing tasks, disable timers, and throttle down OpenGL ES frame rates. Games should use this method to pause the game. 32 | */ 33 | } 34 | 35 | - (void)applicationDidEnterBackground:(UIApplication *)application 36 | { 37 | /* 38 | Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later. 39 | If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits. 40 | */ 41 | } 42 | 43 | - (void)applicationWillEnterForeground:(UIApplication *)application 44 | { 45 | /* 46 | Called as part of the transition from the background to the inactive state; here you can undo many of the changes made on entering the background. 47 | */ 48 | } 49 | 50 | - (void)applicationDidBecomeActive:(UIApplication *)application 51 | { 52 | /* 53 | Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface. 54 | */ 55 | } 56 | 57 | - (void)applicationWillTerminate:(UIApplication *)application 58 | { 59 | /* 60 | Called when the application is about to terminate. 61 | Save data if appropriate. 62 | See also applicationDidEnterBackground:. 63 | */ 64 | } 65 | 66 | @end 67 | -------------------------------------------------------------------------------- /changeViewController/FirstViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // FirstViewController.h 3 | // changeViewController 4 | // 5 | // Created by marcus wang on 12-1-11. 6 | // Copyright (c) 2012年 __MyCompanyName__. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface FirstViewController : UIViewController 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /changeViewController/FirstViewController.m: -------------------------------------------------------------------------------- 1 | // 2 | // FirstViewController.m 3 | // changeViewController 4 | // 5 | // Created by marcus wang on 12-1-11. 6 | // Copyright (c) 2012年 __MyCompanyName__. All rights reserved. 7 | // 8 | 9 | #import "FirstViewController.h" 10 | 11 | @implementation FirstViewController 12 | 13 | - (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil 14 | { 15 | self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil]; 16 | if (self) { 17 | // Custom initialization 18 | } 19 | return self; 20 | } 21 | 22 | - (void)didReceiveMemoryWarning 23 | { 24 | // Releases the view if it doesn't have a superview. 25 | [super didReceiveMemoryWarning]; 26 | 27 | // Release any cached data, images, etc that aren't in use. 28 | } 29 | 30 | #pragma mark - View lifecycle 31 | 32 | - (void)viewDidLoad 33 | { 34 | [super viewDidLoad]; 35 | // Do any additional setup after loading the view from its nib. 36 | debugMethod(); 37 | } 38 | 39 | - (void)viewDidUnload 40 | { 41 | [super viewDidUnload]; 42 | // Release any retained subviews of the main view. 43 | // e.g. self.myOutlet = nil; 44 | debugMethod(); 45 | } 46 | 47 | - (void)viewWillAppear:(BOOL)animated { 48 | [super viewWillAppear:animated]; 49 | debugMethod(); 50 | } 51 | 52 | - (void)viewDidAppear:(BOOL)animated { 53 | [super viewDidAppear:animated]; 54 | debugMethod(); 55 | } 56 | 57 | - (void)viewWillDisappear:(BOOL)animated { 58 | [super viewWillDisappear:animated]; 59 | debugMethod(); 60 | } 61 | 62 | - (void)viewDidDisappear:(BOOL)animated { 63 | [super viewDidDisappear:animated]; 64 | debugMethod(); 65 | } 66 | 67 | - (void)willMoveToParentViewController:(UIViewController *)parent { 68 | debugMethod(); 69 | } 70 | 71 | - (void)didMoveToParentViewController:(UIViewController *)parent { 72 | debugMethod(); 73 | } 74 | 75 | - (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation 76 | { 77 | // Return YES for supported orientations 78 | return (interfaceOrientation == UIInterfaceOrientationPortrait); 79 | } 80 | 81 | @end 82 | -------------------------------------------------------------------------------- /changeViewController/FirstViewController.xib: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 1280 5 | 11C74 6 | 1938 7 | 1138.23 8 | 567.00 9 | 10 | com.apple.InterfaceBuilder.IBCocoaTouchPlugin 11 | 933 12 | 13 | 14 | IBProxyObject 15 | IBUIView 16 | IBUILabel 17 | 18 | 19 | com.apple.InterfaceBuilder.IBCocoaTouchPlugin 20 | 21 | 22 | PluginDependencyRecalculationVersion 23 | 24 | 25 | 26 | 27 | IBFilesOwner 28 | IBCocoaTouchFramework 29 | 30 | 31 | IBFirstResponder 32 | IBCocoaTouchFramework 33 | 34 | 35 | 36 | 274 37 | 38 | 39 | 40 | 292 41 | {{132, 127}, {85, 21}} 42 | 43 | 44 | 45 | _NS:328 46 | NO 47 | YES 48 | 7 49 | NO 50 | IBCocoaTouchFramework 51 | 留言及回复 52 | 53 | 1 54 | MCAwIDAAA 55 | 56 | 57 | 1 58 | 10 59 | 60 | 1 61 | 17 62 | 63 | 64 | Helvetica 65 | 17 66 | 16 67 | 68 | 69 | 70 | {320, 345} 71 | 72 | 73 | 74 | 75 | 3 76 | MC42NjY2NjY2NjY3AA 77 | 78 | IBCocoaTouchFramework 79 | 80 | 81 | 82 | 83 | 84 | 85 | view 86 | 87 | 88 | 89 | 3 90 | 91 | 92 | 93 | 94 | 95 | 0 96 | 97 | 98 | 99 | 100 | 101 | 1 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | -1 110 | 111 | 112 | File's Owner 113 | 114 | 115 | -2 116 | 117 | 118 | 119 | 120 | 4 121 | 122 | 123 | 124 | 125 | 126 | 127 | FirstViewController 128 | com.apple.InterfaceBuilder.IBCocoaTouchPlugin 129 | UIResponder 130 | com.apple.InterfaceBuilder.IBCocoaTouchPlugin 131 | com.apple.InterfaceBuilder.IBCocoaTouchPlugin 132 | com.apple.InterfaceBuilder.IBCocoaTouchPlugin 133 | 134 | 135 | 136 | 137 | 138 | 4 139 | 140 | 141 | 142 | 143 | FirstViewController 144 | UIViewController 145 | 146 | IBProjectSource 147 | ./Classes/FirstViewController.h 148 | 149 | 150 | 151 | 152 | 0 153 | IBCocoaTouchFramework 154 | YES 155 | 3 156 | 933 157 | 158 | 159 | -------------------------------------------------------------------------------- /changeViewController/MainViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // MainViewController.h 3 | // changeViewController 4 | // 5 | // Created by marcus wang on 12-1-11. 6 | // Copyright (c) 2012年 __MyCompanyName__. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface MainViewController : UIViewController 12 | { 13 | 14 | IBOutlet UIView *contentView; 15 | 16 | IBOutlet UIButton *firstButton; 17 | 18 | IBOutlet UIButton *secondButton; 19 | 20 | IBOutlet UIButton *thirdButon; 21 | 22 | UIViewController *currentViewController; 23 | 24 | } 25 | 26 | -(IBAction)onClickbutton:(id)sender; 27 | 28 | @end 29 | -------------------------------------------------------------------------------- /changeViewController/MainViewController.m: -------------------------------------------------------------------------------- 1 | // 2 | // MainViewController.m 3 | // changeViewController 4 | // 5 | // Created by marcus wang on 12-1-11. 6 | // Copyright (c) 2012年 __MyCompanyName__. All rights reserved. 7 | // 8 | 9 | #import "MainViewController.h" 10 | 11 | #import "FirstViewController.h" 12 | 13 | #import "SecondViewController.h" 14 | 15 | #import "ThirdViewController.h" 16 | 17 | @implementation MainViewController 18 | 19 | - (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil 20 | { 21 | self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil]; 22 | if (self) { 23 | // Custom initialization 24 | } 25 | return self; 26 | } 27 | 28 | - (void)didReceiveMemoryWarning 29 | { 30 | // Releases the view if it doesn't have a superview. 31 | [super didReceiveMemoryWarning]; 32 | } 33 | 34 | #pragma mark - View lifecycle 35 | 36 | FirstViewController *firstViewController; 37 | SecondViewController *secondViewController; 38 | ThirdViewController *thirdViewController; 39 | 40 | - (void)viewDidLoad 41 | { 42 | [super viewDidLoad]; 43 | // Do any additional setup after loading the view from its nib. 44 | 45 | firstViewController=[[FirstViewController alloc] initWithNibName:@"FirstViewController" bundle:nil]; 46 | [self addChildViewController:firstViewController]; 47 | 48 | secondViewController=[[SecondViewController alloc] initWithNibName:@"SecondViewController" bundle:nil]; 49 | [self addChildViewController:secondViewController]; 50 | 51 | thirdViewController=[[ThirdViewController alloc] initWithNibName:@"ThirdViewController" bundle:nil]; 52 | [self addChildViewController:thirdViewController]; 53 | 54 | [contentView addSubview:thirdViewController.view]; 55 | 56 | currentViewController=thirdViewController; 57 | 58 | } 59 | 60 | - (void)viewDidUnload 61 | { 62 | [super viewDidUnload]; 63 | } 64 | 65 | - (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation 66 | { 67 | return (interfaceOrientation == UIInterfaceOrientationPortrait); 68 | } 69 | -(IBAction)onClickbutton:(id)sender 70 | { 71 | if ((currentViewController==firstViewController&&[sender tag]==1)||(currentViewController==secondViewController&&[sender tag]==2) ||(currentViewController==thirdViewController&&[sender tag]==3) ) { 72 | return; 73 | } 74 | UIViewController *oldViewController=currentViewController; 75 | switch ([sender tag]) { 76 | case 1: 77 | { 78 | NSLog(@"留言及回复"); 79 | [self transitionFromViewController:currentViewController toViewController:firstViewController duration:1 options:UIViewAnimationOptionTransitionCurlUp animations:^{ 80 | } completion:^(BOOL finished) { 81 | if (finished) { 82 | currentViewController=firstViewController; 83 | }else{ 84 | currentViewController=oldViewController; 85 | } 86 | }]; 87 | } 88 | break; 89 | case 2: 90 | { 91 | NSLog(@"生日提醒"); 92 | [self transitionFromViewController:currentViewController toViewController:secondViewController duration:1 options:UIViewAnimationOptionTransitionCurlDown animations:^{ 93 | 94 | } completion:^(BOOL finished) { 95 | if (finished) { 96 | currentViewController=secondViewController; 97 | }else{ 98 | currentViewController=oldViewController; 99 | } 100 | }]; 101 | } 102 | break; 103 | case 3: 104 | { 105 | NSLog(@"好友申请"); 106 | [self transitionFromViewController:currentViewController toViewController:thirdViewController duration:1 options:UIViewAnimationOptionTransitionCrossDissolve animations:^{ 107 | 108 | } completion:^(BOOL finished) { 109 | if (finished) { 110 | currentViewController=thirdViewController; 111 | }else{ 112 | currentViewController=oldViewController; 113 | } 114 | }]; 115 | } 116 | break; 117 | default: 118 | break; 119 | } 120 | } 121 | @end 122 | -------------------------------------------------------------------------------- /changeViewController/MainViewController.xib: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 1280 5 | 11C74 6 | 1938 7 | 1138.23 8 | 567.00 9 | 10 | com.apple.InterfaceBuilder.IBCocoaTouchPlugin 11 | 933 12 | 13 | 14 | IBProxyObject 15 | IBUIView 16 | IBUIButton 17 | 18 | 19 | com.apple.InterfaceBuilder.IBCocoaTouchPlugin 20 | 21 | 22 | PluginDependencyRecalculationVersion 23 | 24 | 25 | 26 | 27 | IBFilesOwner 28 | IBCocoaTouchFramework 29 | 30 | 31 | IBFirstResponder 32 | IBCocoaTouchFramework 33 | 34 | 35 | 36 | 274 37 | 38 | 39 | 40 | 292 41 | {320, 37} 42 | 43 | 44 | 45 | _NS:225 46 | NO 47 | 1 48 | IBCocoaTouchFramework 49 | 0 50 | 0 51 | 1 52 | 留言及回复 53 | 54 | 3 55 | MQA 56 | 57 | 58 | 1 59 | MC4xOTYwNzg0MzQ2IDAuMzA5ODAzOTMyOSAwLjUyMTU2ODY1NgA 60 | 61 | 62 | 3 63 | MC41AA 64 | 65 | 66 | 2 67 | 15 68 | 69 | 70 | Helvetica-Bold 71 | 15 72 | 16 73 | 74 | 75 | 76 | 77 | 292 78 | {{0, 36}, {320, 37}} 79 | 80 | 81 | 82 | _NS:225 83 | NO 84 | 2 85 | IBCocoaTouchFramework 86 | 0 87 | 0 88 | 1 89 | 生日提醒 90 | 91 | 92 | 1 93 | MC4xOTYwNzg0MzQ2IDAuMzA5ODAzOTMyOSAwLjUyMTU2ODY1NgA 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 292 102 | {{0, 72}, {320, 37}} 103 | 104 | 105 | 106 | _NS:225 107 | NO 108 | 3 109 | IBCocoaTouchFramework 110 | 0 111 | 0 112 | 1 113 | 好友申请 114 | 115 | 116 | 1 117 | MC4xOTYwNzg0MzQ2IDAuMzA5ODAzOTMyOSAwLjUyMTU2ODY1NgA 118 | 119 | 120 | 121 | 122 | 123 | 124 | 125 | 292 126 | {{0, 112}, {320, 345}} 127 | 128 | 129 | 130 | _NS:196 131 | 132 | 3 133 | MQA 134 | 135 | 2 136 | 137 | 138 | IBCocoaTouchFramework 139 | 140 | 141 | {{0, 20}, {320, 460}} 142 | 143 | 144 | 145 | 146 | 1 147 | MC4yOTczMTUwMDIzIDEgMC4yNTQ2NDQwMDc1AA 148 | 149 | 150 | IBCocoaTouchFramework 151 | 152 | 153 | 154 | 155 | 156 | 157 | view 158 | 159 | 160 | 161 | 3 162 | 163 | 164 | 165 | contentView 166 | 167 | 168 | 169 | 12 170 | 171 | 172 | 173 | thirdButon 174 | 175 | 176 | 177 | 13 178 | 179 | 180 | 181 | secondButton 182 | 183 | 184 | 185 | 14 186 | 187 | 188 | 189 | firstButton 190 | 191 | 192 | 193 | 15 194 | 195 | 196 | 197 | onClickbutton: 198 | 199 | 200 | 7 201 | 202 | 7 203 | 204 | 205 | 206 | onClickbutton: 207 | 208 | 209 | 7 210 | 211 | 8 212 | 213 | 214 | 215 | onClickbutton: 216 | 217 | 218 | 7 219 | 220 | 9 221 | 222 | 223 | 224 | 225 | 226 | 0 227 | 228 | 229 | 230 | 231 | 232 | 1 233 | 234 | 235 | 236 | 237 | 238 | 239 | 240 | 241 | 242 | 243 | -1 244 | 245 | 246 | File's Owner 247 | 248 | 249 | -2 250 | 251 | 252 | 253 | 254 | 4 255 | 256 | 257 | 258 | 259 | 5 260 | 261 | 262 | 263 | 264 | 6 265 | 266 | 267 | 268 | 269 | 11 270 | 271 | 272 | 273 | 274 | 275 | 276 | MainViewController 277 | com.apple.InterfaceBuilder.IBCocoaTouchPlugin 278 | UIResponder 279 | com.apple.InterfaceBuilder.IBCocoaTouchPlugin 280 | com.apple.InterfaceBuilder.IBCocoaTouchPlugin 281 | com.apple.InterfaceBuilder.IBCocoaTouchPlugin 282 | com.apple.InterfaceBuilder.IBCocoaTouchPlugin 283 | com.apple.InterfaceBuilder.IBCocoaTouchPlugin 284 | com.apple.InterfaceBuilder.IBCocoaTouchPlugin 285 | 286 | 287 | 288 | 289 | 290 | 17 291 | 292 | 293 | 294 | 295 | MainViewController 296 | UIViewController 297 | 298 | onClickbutton: 299 | id 300 | 301 | 302 | onClickbutton: 303 | 304 | onClickbutton: 305 | id 306 | 307 | 308 | 309 | UIView 310 | UIButton 311 | UIButton 312 | UIButton 313 | 314 | 315 | 316 | contentView 317 | UIView 318 | 319 | 320 | firstButton 321 | UIButton 322 | 323 | 324 | secondButton 325 | UIButton 326 | 327 | 328 | thirdButon 329 | UIButton 330 | 331 | 332 | 333 | IBProjectSource 334 | ./Classes/MainViewController.h 335 | 336 | 337 | 338 | 339 | 0 340 | IBCocoaTouchFramework 341 | YES 342 | 3 343 | 933 344 | 345 | 346 | -------------------------------------------------------------------------------- /changeViewController/SecondViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // SecondViewController.h 3 | // changeViewController 4 | // 5 | // Created by marcus wang on 12-1-11. 6 | // Copyright (c) 2012年 __MyCompanyName__. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface SecondViewController : UIViewController 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /changeViewController/SecondViewController.m: -------------------------------------------------------------------------------- 1 | // 2 | // SecondViewController.m 3 | // changeViewController 4 | // 5 | // Created by marcus wang on 12-1-11. 6 | // Copyright (c) 2012年 __MyCompanyName__. All rights reserved. 7 | // 8 | 9 | #import "SecondViewController.h" 10 | 11 | @implementation SecondViewController 12 | 13 | - (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil 14 | { 15 | self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil]; 16 | if (self) { 17 | // Custom initialization 18 | } 19 | return self; 20 | } 21 | 22 | - (void)didReceiveMemoryWarning 23 | { 24 | // Releases the view if it doesn't have a superview. 25 | [super didReceiveMemoryWarning]; 26 | 27 | // Release any cached data, images, etc that aren't in use. 28 | } 29 | 30 | #pragma mark - View lifecycle 31 | 32 | - (void)viewDidLoad 33 | { 34 | [super viewDidLoad]; 35 | // Do any additional setup after loading the view from its nib. 36 | debugMethod(); 37 | } 38 | 39 | - (void)viewDidUnload 40 | { 41 | [super viewDidUnload]; 42 | // Release any retained subviews of the main view. 43 | // e.g. self.myOutlet = nil; 44 | debugMethod(); 45 | } 46 | 47 | - (void)viewWillAppear:(BOOL)animated { 48 | [super viewWillAppear:animated]; 49 | debugMethod(); 50 | } 51 | 52 | - (void)viewDidAppear:(BOOL)animated { 53 | [super viewDidAppear:animated]; 54 | debugMethod(); 55 | } 56 | 57 | - (void)viewWillDisappear:(BOOL)animated { 58 | [super viewWillDisappear:animated]; 59 | debugMethod(); 60 | } 61 | 62 | - (void)viewDidDisappear:(BOOL)animated { 63 | [super viewDidDisappear:animated]; 64 | debugMethod(); 65 | } 66 | 67 | - (void)willMoveToParentViewController:(UIViewController *)parent { 68 | debugMethod(); 69 | } 70 | 71 | - (void)didMoveToParentViewController:(UIViewController *)parent { 72 | debugMethod(); 73 | } 74 | 75 | 76 | - (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation 77 | { 78 | // Return YES for supported orientations 79 | return (interfaceOrientation == UIInterfaceOrientationPortrait); 80 | } 81 | 82 | @end 83 | -------------------------------------------------------------------------------- /changeViewController/SecondViewController.xib: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 1280 5 | 11C74 6 | 1934 7 | 1138.23 8 | 567.00 9 | 10 | com.apple.InterfaceBuilder.IBCocoaTouchPlugin 11 | 931 12 | 13 | 14 | IBProxyObject 15 | IBUIView 16 | IBUILabel 17 | 18 | 19 | com.apple.InterfaceBuilder.IBCocoaTouchPlugin 20 | 21 | 22 | PluginDependencyRecalculationVersion 23 | 24 | 25 | 26 | 27 | IBFilesOwner 28 | IBCocoaTouchFramework 29 | 30 | 31 | IBFirstResponder 32 | IBCocoaTouchFramework 33 | 34 | 35 | 36 | 274 37 | 38 | 39 | 40 | 292 41 | {{61, 96}, {213, 136}} 42 | 43 | 44 | _NS:328 45 | NO 46 | YES 47 | 7 48 | NO 49 | IBCocoaTouchFramework 50 | 生日提醒 51 | 52 | 1 53 | MCAwIDAAA 54 | 55 | 56 | 1 57 | 10 58 | 59 | 1 60 | 17 61 | 62 | 63 | Helvetica 64 | 17 65 | 16 66 | 67 | 68 | 69 | {320, 345} 70 | 71 | 72 | 73 | 1 74 | MC4yNTI2MDE5MzI1IDAuNjE2MzE3NjQ2NyAxAA 75 | 76 | IBCocoaTouchFramework 77 | 78 | 79 | 80 | 81 | 82 | 83 | view 84 | 85 | 86 | 87 | 3 88 | 89 | 90 | 91 | 92 | 93 | 0 94 | 95 | 96 | 97 | 98 | 99 | 1 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | -1 108 | 109 | 110 | File's Owner 111 | 112 | 113 | -2 114 | 115 | 116 | 117 | 118 | 4 119 | 120 | 121 | 122 | 123 | 124 | 125 | SecondViewController 126 | com.apple.InterfaceBuilder.IBCocoaTouchPlugin 127 | UIResponder 128 | com.apple.InterfaceBuilder.IBCocoaTouchPlugin 129 | com.apple.InterfaceBuilder.IBCocoaTouchPlugin 130 | com.apple.InterfaceBuilder.IBCocoaTouchPlugin 131 | 132 | 133 | 134 | 135 | 136 | 4 137 | 138 | 139 | 140 | 141 | SecondViewController 142 | UIViewController 143 | 144 | IBProjectSource 145 | ./Classes/SecondViewController.h 146 | 147 | 148 | 149 | 150 | 0 151 | IBCocoaTouchFramework 152 | YES 153 | 3 154 | 931 155 | 156 | 157 | -------------------------------------------------------------------------------- /changeViewController/ThirdViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // ThirdViewController.h 3 | // changeViewController 4 | // 5 | // Created by marcus wang on 12-1-11. 6 | // Copyright (c) 2012年 __MyCompanyName__. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface ThirdViewController : UIViewController 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /changeViewController/ThirdViewController.m: -------------------------------------------------------------------------------- 1 | // 2 | // ThirdViewController.m 3 | // changeViewController 4 | // 5 | // Created by marcus wang on 12-1-11. 6 | // Copyright (c) 2012年 __MyCompanyName__. All rights reserved. 7 | // 8 | 9 | #import "ThirdViewController.h" 10 | 11 | @implementation ThirdViewController 12 | 13 | - (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil 14 | { 15 | self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil]; 16 | if (self) { 17 | // Custom initialization 18 | } 19 | return self; 20 | } 21 | 22 | - (void)didReceiveMemoryWarning 23 | { 24 | [super didReceiveMemoryWarning]; 25 | } 26 | 27 | #pragma mark - View lifecycle 28 | 29 | - (void)viewDidLoad 30 | { 31 | [super viewDidLoad]; 32 | debugMethod(); 33 | } 34 | 35 | - (void)viewDidUnload 36 | { 37 | [super viewDidUnload]; 38 | debugMethod(); 39 | } 40 | 41 | - (void)viewWillAppear:(BOOL)animated { 42 | [super viewWillAppear:animated]; 43 | debugMethod(); 44 | } 45 | 46 | - (void)viewDidAppear:(BOOL)animated { 47 | [super viewDidAppear:animated]; 48 | debugMethod(); 49 | } 50 | 51 | - (void)viewWillDisappear:(BOOL)animated { 52 | [super viewWillDisappear:animated]; 53 | debugMethod(); 54 | } 55 | 56 | - (void)viewDidDisappear:(BOOL)animated { 57 | [super viewDidDisappear:animated]; 58 | debugMethod(); 59 | } 60 | 61 | - (void)willMoveToParentViewController:(UIViewController *)parent { 62 | debugMethod(); 63 | } 64 | 65 | - (void)didMoveToParentViewController:(UIViewController *)parent { 66 | debugMethod(); 67 | } 68 | 69 | 70 | 71 | - (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation 72 | { 73 | // Return YES for supported orientations 74 | return (interfaceOrientation == UIInterfaceOrientationPortrait); 75 | } 76 | 77 | @end 78 | -------------------------------------------------------------------------------- /changeViewController/ThirdViewController.xib: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 1280 5 | 11C74 6 | 1934 7 | 1138.23 8 | 567.00 9 | 10 | com.apple.InterfaceBuilder.IBCocoaTouchPlugin 11 | 931 12 | 13 | 14 | IBProxyObject 15 | IBUIView 16 | IBUILabel 17 | 18 | 19 | com.apple.InterfaceBuilder.IBCocoaTouchPlugin 20 | 21 | 22 | PluginDependencyRecalculationVersion 23 | 24 | 25 | 26 | 27 | IBFilesOwner 28 | IBCocoaTouchFramework 29 | 30 | 31 | IBFirstResponder 32 | IBCocoaTouchFramework 33 | 34 | 35 | 36 | 274 37 | 38 | 39 | 40 | 292 41 | {{150, 142}, {68, 21}} 42 | 43 | 44 | _NS:328 45 | NO 46 | YES 47 | 7 48 | NO 49 | IBCocoaTouchFramework 50 | 好友申请 51 | 52 | 1 53 | MCAwIDAAA 54 | 55 | 56 | 1 57 | 10 58 | 59 | 1 60 | 17 61 | 62 | 63 | Helvetica 64 | 17 65 | 16 66 | 67 | 68 | 69 | {320, 345} 70 | 71 | 72 | 73 | 1 74 | MSAwLjQ4NzExMjIzNzggMC4zMDgwOTEwNDg0AA 75 | 76 | IBCocoaTouchFramework 77 | 78 | 79 | 80 | 81 | 82 | 83 | view 84 | 85 | 86 | 87 | 3 88 | 89 | 90 | 91 | 92 | 93 | 0 94 | 95 | 96 | 97 | 98 | 99 | 1 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | -1 108 | 109 | 110 | File's Owner 111 | 112 | 113 | -2 114 | 115 | 116 | 117 | 118 | 4 119 | 120 | 121 | 122 | 123 | 124 | 125 | ThirdViewController 126 | com.apple.InterfaceBuilder.IBCocoaTouchPlugin 127 | UIResponder 128 | com.apple.InterfaceBuilder.IBCocoaTouchPlugin 129 | com.apple.InterfaceBuilder.IBCocoaTouchPlugin 130 | com.apple.InterfaceBuilder.IBCocoaTouchPlugin 131 | 132 | 133 | 134 | 135 | 136 | 4 137 | 138 | 139 | 140 | 141 | ThirdViewController 142 | UIViewController 143 | 144 | IBProjectSource 145 | ./Classes/ThirdViewController.h 146 | 147 | 148 | 149 | 150 | 0 151 | IBCocoaTouchFramework 152 | YES 153 | 3 154 | 931 155 | 156 | 157 | -------------------------------------------------------------------------------- /changeViewController/changeViewController-Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleDisplayName 8 | ${PRODUCT_NAME} 9 | CFBundleExecutable 10 | ${EXECUTABLE_NAME} 11 | CFBundleIconFiles 12 | 13 | CFBundleIdentifier 14 | com.qat-audio.${PRODUCT_NAME:rfc1034identifier} 15 | CFBundleInfoDictionaryVersion 16 | 6.0 17 | CFBundleName 18 | ${PRODUCT_NAME} 19 | CFBundlePackageType 20 | APPL 21 | CFBundleShortVersionString 22 | 1.0 23 | CFBundleSignature 24 | ???? 25 | CFBundleVersion 26 | 1.0 27 | LSRequiresIPhoneOS 28 | 29 | UISupportedInterfaceOrientations 30 | 31 | UIInterfaceOrientationPortrait 32 | UIInterfaceOrientationLandscapeLeft 33 | UIInterfaceOrientationLandscapeRight 34 | 35 | 36 | 37 | -------------------------------------------------------------------------------- /changeViewController/changeViewController-Prefix.pch: -------------------------------------------------------------------------------- 1 | // 2 | // Prefix header for all source files of the 'changeViewController' target in the 'changeViewController' project 3 | // 4 | 5 | #import 6 | 7 | #ifndef __IPHONE_3_0 8 | #warning "This project uses features only available in iOS SDK 3.0 and later." 9 | #endif 10 | 11 | #ifdef __OBJC__ 12 | #import 13 | #import 14 | #endif 15 | 16 | #define debugMethod() NSLog(@"%s", __func__) 17 | -------------------------------------------------------------------------------- /changeViewController/en.lproj/InfoPlist.strings: -------------------------------------------------------------------------------- 1 | /* Localized versions of Info.plist keys */ 2 | 3 | -------------------------------------------------------------------------------- /changeViewController/main.m: -------------------------------------------------------------------------------- 1 | // 2 | // main.m 3 | // changeViewController 4 | // 5 | // Created by marcus wang on 12-1-11. 6 | // Copyright (c) 2012年 __MyCompanyName__. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | #import "AppDelegate.h" 12 | 13 | int main(int argc, char *argv[]) 14 | { 15 | @autoreleasepool { 16 | return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class])); 17 | } 18 | } 19 | --------------------------------------------------------------------------------