我刚刚开始进行 iOS 开发,由于警告而有点卡住了。构建成功,但这个警告让我很困扰。我检查了其他一些答案,但无法弄清楚出了什么问题。
Waring - 不完整的实现
复数.h
#import <Foundation/Foundation.h>
@interface ComplexNumbers : NSObject
-(void) setReal: (double)a;
-(void) setImaginary: (double)b;
-(void) print; // display as a + bi
-(double) real;
-(double) imaginary;
@end
复数.m
#import "ComplexNumbers.h"
@implementation ComplexNumbers // Incomplete implementation
{
double real;
double imaginary;
}
-(void) print
{
NSLog(@"%f + %fi",real,imaginary);
}
-(void) setReal:(double)a
{
real = a;
}
-(void) setImaginary:(double)b
{
imaginary = b;
}
@end