[ create a new paste ] login | about

Link: http://codepad.org/SYUMbMS3    [ raw code | output | fork ]

C, pasted on Jun 28:
/*NVAppDelegate - application:didFinishLaunchingWithOptions:*/
self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]];
self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]];
NVSubViewController *rootViewController = [[NVSubViewController alloc] initWithLayer:1 withNibName:@"NVSubViewController" bundle:nil];
UINavigationController *navigationController = [[UINavigationController alloc] initWithRootViewController:rootViewController];
self.navigationControllerDelegate = [[NVNavigationControllerDelegate alloc] init];
navigationController.delegate = self.navigationControllerDelegate;
self.viewController = navigationController;
self.window.rootViewController = self.viewController;
[self.window makeKeyAndVisible];
return YES;

/*NVSubViewController.h*/

#import <UIKit/UIKit.h>

@interface NVSubViewController : UIViewController

@property (weak, nonatomic) IBOutlet UIButton *previousButton, *nextButton;

@property (assign, nonatomic) NSUInteger layer;

@property (weak, nonatomic) IBOutlet UILabel *label;

- (IBAction)goToPreviousLayer:(id)sender;

- (IBAction)goToNextLayer:(id)sender;

- (id)initWithLayer:(NSUInteger)layer withNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil;

@end

/*NVSubViewController.m*/

@interface NVSubViewController ()

@end

@implementation NVSubViewController
@synthesize layer = layer_;
@synthesize label = label_;
@synthesize previousButton = previousButton_;
@synthesize nextButton = nextButton_;

- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil
{
    return [self initWithLayer:1 withNibName:nibNameOrNil bundle:nibBundleOrNil];
}

- (id)initWithLayer:(NSUInteger)layer withNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil {
    self = [self initWithNibName:nibNameOrNil bundle:nibBundleOrNil];
    if (self) {
        layer_ = layer;
    }
    return self;
}

- (UINavigationItem *)navigationItem {
    UINavigationItem *item = [[UINavigationItem alloc] initWithTitle:[NSString stringWithFormat:@"第%u層", self.layer]];
    return item;
}

- (void)viewDidLoad
{
    [super viewDidLoad];
    if (self.layer == 1) {
        label_.text = [NSString stringWithFormat:@"ここはアインクラッド最下層です。クリア目指してがんばろう!"];
        self.previousButton.enabled = NO;
    } else if (1< self.layer && self.layer < 100) {
        label_.text = [NSString stringWithFormat:@"ここはアインクラッド第%u層です。クリアまであと%u層です。", self.layer, 100-self.layer];
    } else {
        label_.text = [NSString stringWithFormat:@"ここはアインクラッド最上層です。おめでとう!クリアしました。"];
        self.nextButton.enabled = NO;
    }
    // Do any additional setup after loading the view from its nib.
}

- (void)goToPreviousLayer:(id)sender {
    [self.navigationController.navigationBar popNavigationItemAnimated:YES];
    [self.navigationController popViewControllerAnimated:YES];
}

- (void)goToNextLayer:(id)sender {
    NVSubViewController *nextViewController = [[NVSubViewController alloc] initWithLayer:self.layer+1 withNibName:@"NVSubViewController" bundle:nil];
    [self.navigationController pushViewController:nextViewController animated:YES];
}

- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
{
	return YES;
}

@end


Output:
Line 2: error: expected '=', ',', ';', 'asm' or '__attribute__' before '.' token
Line 3: error: expected '=', ',', ';', 'asm' or '__attribute__' before '.' token
Line 4: error: expected '=', ',', ';', 'asm' or '__attribute__' before '*' token
Line 4: error: stray '@' in program
Line 5: error: expected '=', ',', ';', 'asm' or '__attribute__' before '*' token
Line 6: error: expected '=', ',', ';', 'asm' or '__attribute__' before '.' token
Line 7: error: expected '=', ',', ';', 'asm' or '__attribute__' before '.' token
Line 8: error: expected '=', ',', ';', 'asm' or '__attribute__' before '.' token
Line 9: error: expected '=', ',', ';', 'asm' or '__attribute__' before '.' token
Line 10: error: expected identifier or '(' before '[' token
Line 11: error: expected identifier or '(' before 'return'
Line 23: error: UIKit/UIKit.h: No such file or directory
Line 17: error: stray '@' in program
Line 17: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'NVSubViewController'
Line 19: error: stray '@' in program
Line 21: error: stray '@' in program
In function 'property':
Line 21: error: expected declaration specifiers before 'NSUInteger'
Line 23: error: stray '@' in program
Line 23: error: expected declaration specifiers before 'property'
Line 25: error: expected declaration specifiers before '-' token
Line 27: error: expected declaration specifiers before '-' token
Line 29: error: expected declaration specifiers before '-' token
Line 31: error: stray '@' in program
Line 31: error: expected declaration specifiers before 'end'
Line 35: error: stray '@' in program
Line 37: error: stray '@' in program
Line 39: error: stray '@' in program
Line 40: error: stray '@' in program
Line 41: error: stray '@' in program
Line 41: error: expected declaration specifiers before 'synthesize'
Line 42: error: stray '@' in program
Line 42: error: expected declaration specifiers before 'synthesize'
Line 43: error: stray '@' in program
Line 43: error: expected declaration specifiers before 'synthesize'
Line 45: error: expected declaration specifiers before '-' token
Line 50: error: expected declaration specifiers before '-' token
Line 58: error: expected declaration specifiers before '-' token
Line 59: error: stray '@' in program
Line 63: error: expected declaration specifiers before '-' token
Line 67: error: stray '@' in program
Line 70: error: stray '@' in program
Line 72: error: stray '@' in program
Line 78: error: expected declaration specifiers before '-' token
Line 83: error: expected declaration specifiers before '-' token
Line 84: error: stray '@' in program
Line 88: error: expected declaration specifiers before '-' token
Line 93: error: stray '@' in program
Line 93: error: expected declaration specifiers before 'end'


Create a new paste based on this one


Comments: