Hello, I am very new to objective c and have decided to learn some so I can try and make some apps and what not for fun. I am very young but I know a fair bit of Java, quite a bit of EE standard web dev, and also a little Python. Anyway, I was following a short tutorial by this guy and I have come across an issue. My ViewController.m is here:
After
, there is the error "No visible @interface for 'UIView' declares the selector 'addSubView'" which I have read about and is quite common. However, I am not sure how to fix it. I would appreciate some advice.
Sam
P.s. Just in case, my ViewController.h is here:
Code:
//
// ViewController.m
// basicsvapp
//
// Created by Samuel Bird on 19/04/2014.
// Copyright (c) 2014 Samuel Bird. All rights reserved.
//
#import "ViewController.h"
@interface ViewController ()
@end
@implementation ViewController
- (void)viewDidLoad
{
[super viewDidLoad];
// Do any additional setup after loading the view, typically from a nib.
UILabel *label = [[UILabel alloc] initWithFrame:CGRectMake(0, 0, 200, 50)];
label.text = @"Hello Again";
[self.view addSubView:label];
- (void)didReceiveMemoryWarning
{
[super didReceiveMemoryWarning];
// Dispose of any resources that can be recreated.
}
@end
After
Code:
[self.view addSubView:label];
Sam
P.s. Just in case, my ViewController.h is here:
Code:
#import <UIKit/UIKit.h>
@interface ViewController : UIViewController
@end