xcode에서 ios 6을 개발하기 시작했습니다. 하지만 초보 개발자로서, 나는 문제가되었습니다. 3 장의 'ios5 개발 시작 : ios sdk 탐색'에서 'Button fun'예제의 가이드를 따릅니다.xcode에 선언되지 않은 식별자
.h 코드에서 이미 선언 한 식별자 'statusText'에 문제가 있습니다.
내 코드는 지금까지 어떤 도움을 주시면 감사하겠습니다. 미리 감사드립니다. PLS,
내 BIDViewController.h 그렇게
#import <UIKit/UIKit.h>
@interface BIDViewController : UIViewController
@property (weak, nonatomic) IBOutlet UILabel *
statusText;
- (IBAction)buttonPress:(UIButton *)sender;
@end`
처럼 내 BIDViewController.m 내가 책을 따랐지만이 발생하는 이유를 이해할 수없는 것 때문에
#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)buttonPress:(UIButton *)sender {
NSString *title = [sender titleForState:<#(UIControlState)#>];
statusText.text = [NSString stringWithFormat:@"%@ button pressed.", title];
}
@end
같다 도움.
는 는
정확한 문제는 무엇입니까? 컴파일러 문제 또는 런타임 오류? – tomasmcguinness