1
我開始在objective-c中編程。 我收到編譯器錯誤Use of undeclared identifier when calling method
。調用方法時使用未聲明的標識符
頭文件
//ViewController.h
typedef enum direction {north, south, west, east} Direction;
- (int)TurnRadius:(Direction) currentDirection:(Direction)intendedDirection;
實現文件:
//ViewController.m
#import "ViewController.h"
@implementation ViewController
- (int)TurnRadius:(Direction) currentDirection : (Direction) intendedDirection {
//Irrelevant implementation details
}
- (IBAction)buttonTapped:(UIButton *)sender {
[TurnRadius north west]; //ERROR IS HERE
}
任何想法? 謝謝。
謝謝!這工作。 – s123