Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #import <UIKit/UIKit.h>
- #pragma mark Detail interface
- @interface Detail : UIViewController {}
- @end
- #pragma mark Detail implementation
- @implementation Detail
- @end
- #pragma mark RootViewController interface
- @interface RootViewController : UITableViewController {}
- @end
- #pragma mark RootViewController implementation
- @implementation RootViewController
- - (void)viewWillAppear:(BOOL)animated {
- [super viewWillAppear:animated];
- self.title = @"root";
- }
- - (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView { return 1; }
- - (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section { return 1; }
- - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
- static NSString *CellIdentifier = @"Cell";
- UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier];
- if (cell == nil) { cell = [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellIdentifier] autorelease]; }
- cell.textLabel.text = @"Click meee";
- return cell;
- }
- - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
- Detail *detailViewController = [[Detail alloc] initWithNibName:@"Detail" bundle:nil];
- [self.navigationController pushViewController:detailViewController animated:YES];
- #pragma mark QUESTION
- //Why doesn't this release show up in Instruments?
- [detailViewController release];
- }
- @end
- #pragma mark PopDeallocAppDelegate interface
- @interface PopDeallocAppDelegate : NSObject <UIApplicationDelegate> {
- UIWindow *window;
- UINavigationController *navigationController;
- }
- @property (nonatomic, retain) IBOutlet UIWindow *window;
- @property (nonatomic, retain) IBOutlet UINavigationController *navigationController;
- @end
- #pragma mark PopDeallocAppDelegate implementation
- @implementation PopDeallocAppDelegate
- @synthesize window;
- @synthesize navigationController;
- - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
- [window addSubview:navigationController.view];
- [window makeKeyAndVisible];
- return YES;
- }
- - (void)applicationWillResignActive:(UIApplication *)application {}
- - (void)applicationDidEnterBackground:(UIApplication *)application {}
- - (void)applicationWillEnterForeground:(UIApplication *)application {}
- - (void)applicationDidBecomeActive:(UIApplication *)application {}
- - (void)applicationWillTerminate:(UIApplication *)application {}
- - (void)applicationDidReceiveMemoryWarning:(UIApplication *)application {}
- - (void)dealloc {
- [navigationController release];
- [window release];
- [super dealloc];
- }
- @end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement