Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

Kapthehat

macrumors member
Original poster
Jul 1, 2013
51
0
Hi

I am working through Apress Beginning IOS 6 development. I am on chapter 4 and have a couple of errors. Firstly I cant seem to connect the "label" to the .m file. Ctrl dragging has no affect - although a blue line appears, nothing appears in the .m file (i.e no pop up appears).

Also I get an error stating property 'sliderlabel' not found on the object of type BIDController ? (see screenshot). Thanks

here's the .h file :-

Code:
//
//  BIDViewController.h
//  Control Fun
//
//  Created by Kapil Kapur on 19/07/2013.
//  Copyright (c) 2013 Apress. All rights reserved.
//

#import <UIKit/UIKit.h>

@interface BIDViewController : UIViewController
@property (strong, nonatomic) IBOutlet UIView *nameField;

@property (weak, nonatomic) IBOutlet UITextField *numberField;

-(IBAction)textFieldDoneEditing:(id)sender;
-(IBAction)backgroundTap:(id)sender;

@end


and the .m file is below:-

Code:
/
//  BIDViewController.m
//  Control Fun
//
//  Created by Kapil Kapur on 19/07/2013.
//  Copyright (c) 2013 Apress. All rights reserved.
//

#import "BIDViewController.h"

@interface BIDViewController ()

@end

@implementation BIDViewController

- (void)viewDidLoad
{
    [super viewDidLoad];
	// Do any additional setup after loading the view, typically from a nib.
}

- (void)didReceiveMemoryWarning
{
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

-(IBAction)textFieldDoneEditing:(id)sender
{
    [sender resignFirstResponder];
}

-(IBAction)backgroundTap:(id)sender{
    [self.nameField resignFirstResponder];
    [self.numberField resignFirstResponder];
    
}
- (IBAction)sliderChanged:(UISlider *)sender {
    int progress =lroundf(sender.value);
    self.sliderLabel.text= [NSString stringWithFormat:@"%d",progress];
}

@end
 

Attachments

  • Screen Shot 2013-07-22 at 15.28.03.png
    Screen Shot 2013-07-22 at 15.28.03.png
    440.9 KB · Views: 108

waterskier2007

macrumors 68000
Jun 19, 2007
1,871
228
Novi, MI
I may be reading wrong, but I believe you want to drag the slider label to the .h file rather than the .m file

If you are dragging it to the .m file you may want to drag it to the @interface area of the .m file
 

Kapthehat

macrumors member
Original poster
Jul 1, 2013
51
0
thanks - slightly confused by your question. How am I mean to declare it ? I did use the .m file,

regards

Kaps
 

Kapthehat

macrumors member
Original poster
Jul 1, 2013
51
0
got it resolved - for some reason the slider bar had not connected properly to the view (thought it was). all ok now. thanks for your help.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.