0

// 我环顾四周,似乎incomplete implementation你的代码中有一个错误,但我似乎找不到它,请帮助我。

ScrollerViewController.m:

//
//  ScrollerViewController.m
//  Coach App Restore
//
//  Created by Marco Donkers on 10/4/12.
//  Copyright (c) 2012 Marco Donkers. All rights reserved.
//

#import "ScrollerViewController.h"

@interface ScrollerViewController()

@end

@implementation ScrollerViewController // incomplete implementation

NSString *combinedString;
NSString *teamString;
int integerMdon = 1;

@synthesize lblTeamPlayerMdon;
@synthesize tbTeamPlayerMdon;
@synthesize playerNumberMdon;
@synthesize sliderNumberMdon;
@synthesize lblPlayerNumberMdon;
@synthesize switchRingLeaderMdon;
@synthesize lblTeam;


- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil
{
self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];
    if (self) 
    {
    // Custom initialization
    }
return self;
}

- (void)viewDidLoad
{

[super viewDidLoad];
[self loadString:@"Number":teamString];
tbTeamPlayerMdon.text = teamString;

}

- (void)didReceiveMemoryWarning
{
[super didReceiveMemoryWarning];
// Dispose of any resources that can be recreated.
}
-(void)SaveTextBox:(NSString*)string :(NSString*)stringsave
{

NSString *savestring = string;
NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults];
[defaults setObject:savestring forKey:stringsave];
[defaults synchronize];
}

-(void)loadString:(NSString *)location:(NSString *)saveInString
{
NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults];
NSString *loadstring = [defaults objectForKey:location];
saveInString = loadstring;
}
- (IBAction)sliderPlayerNumberMdon:(id)sender
{
integerMdon = (int)sliderNumberMdon.value;
    playerNumberMdon.text = [[NSString alloc]initWithFormat:@"%d", integerMdon];

lblPlayerNumberMdon.text = [[NSString alloc] initWithFormat:@"%d", integerMdon];
}

- (IBAction)ringLeaderMdon:(id)sender
{

}

- (IBAction)tbTeamPlayerMdon:(id)sender
{
combinedString = [teamString stringByAppendingString:playerNumberMdon.text];
[self SaveTextBox:tbTeamPlayerMdon.text :combinedString];
lblTeamPlayerMdon.text = tbTeamPlayerMdon.text;
}

@end

ScrollerViewController.h:

//
//  ScrollerViewController.h
//  Coach App Restore
//
//  Created by Marco Donkers on 10/4/12.
//  Copyright (c) 2012 Marco Donkers. All rights reserved.
//

#import <UIKit/UIKit.h>

@interface ScrollerViewController : UIViewController
@property (weak, nonatomic) IBOutlet UILabel *lblTeam;
@property (weak, nonatomic) IBOutlet UISwitch *switchRingLeaderMdon;
@property (weak, nonatomic) IBOutlet UISlider *sliderNumberMdon;
@property (weak, nonatomic) IBOutlet UILabel *lblTeamPlayerMdon;
@property (weak, nonatomic) IBOutlet UITextField *tbTeamPlayerMdon;
@property (weak, nonatomic) IBOutlet UILabel *playerNumberMdon;
@property (weak, nonatomic) IBOutlet UILabel *lblPlayerNumberMdon;
- (IBAction)sliderPlayerNumberMdon:(id)sender;
- (IBAction)ringLeaderMdon:(id)sender;
- (IBAction)tbTeamPlayerActionMdon:(id)sender;

@end
4

2 回答 2

0

您已经在界面中定义了 tbTeamPlayerActionMdon: 但在实现中定义了 tbTeamPlayerMdon

于 2012-10-05T07:55:39.663 回答
0

您需要将tbTeamPlayerActionMdon操作方法添加到 .m 文件,如下所示:

- (IBAction)tbTeamPlayerActionMdon:(id)sender {

}
于 2012-10-05T07:57:46.543 回答