Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //
- // ViewController.m
- // Storage
- //
- // Created by Pierre Boulay on 2014-09-06.
- // Copyright (c) 2014 Pierre Boulay. All rights reserved.
- //
- #import "ViewController.h"
- #import "AppDelegate.h"
- @interface ViewController ()
- @end
- @implementation ViewController
- - (void)viewDidLoad // Called after the controller's view is loaded into memory
- {
- [super viewDidLoad];
- AppDelegate *appDelegate = [[UIApplication sharedApplication] delegate];
- [appDelegate logString:@"viewDidLoad"];
- }
- - (void)didReceiveMemoryWarning // Sent to the view controller when the app receives a memory warning
- {
- [super didReceiveMemoryWarning];
- AppDelegate *appDelegate = [[UIApplication sharedApplication] delegate];
- [appDelegate logString:@"!!! didReceiveMemoryWarning !!!"];
- [appDelegate receiveMemoryWarning]; // Allons sauvegarder les informations
- }
- #pragma mark - Méthode qui joue du -segue-
- -(void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender
- {
- if([segue.identifier isEqualToString:@"segFromVC"])
- {
- popPopViewController *popVC = (popPopViewController *)segue.destinationViewController;
- [popVC setDelegate:self]; // On laisse notre "adresse" pour que le -viewController- puisse nous appeler
- }
- }
- #pragma mark - Les boutons du ViewController
- - (IBAction)faire1:(id)sender
- {
- NSMutableArray * llogArray = [[NSMutableArray alloc]init];
- AppDelegate *appDelegate = [[UIApplication sharedApplication] delegate];
- llogArray = [appDelegate getLog];
- NSString *myArrayString = [llogArray description]; // A string that represents the contents of the array, formatted as a property list. (read-only)
- self.texteLog.text = myArrayString; // Affiche dans le -textView-
- }
- - (IBAction)clearLog:(id)sender
- {
- AppDelegate *appDelegate = [[UIApplication sharedApplication] delegate];
- [appDelegate clearLog];
- self.texteLog.text = @"...";
- }
- #pragma mark - Méthode du protocol <PopOverDelegate>, elle est appelée du -popOverView-
- - (void) clickBack:(int)backCode
- {
- // NSLog(@"clickBack %d", backCode);
- if (backCode == 1) [self faire1:self];
- if (backCode == 2) [self clearLog:self];
- }
- @end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement