//我环顾四周,似乎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
答案 0 :(得分:0)
您已在界面中定义了tbTeamPlayerActionMdon:但实现中的tbTeamPlayerMdon
答案 1 :(得分:0)
您需要将 tbTeamPlayerActionMdon 操作方法添加到.m文件中,如下所示:
- (IBAction)tbTeamPlayerActionMdon:(id)sender {
}