objective-c中NSNumber问题

爆出错误:

Incompatible pointer types assigning to 'UITextfield *_strong' from 'NSNumber *_strong

代码:

.h文件

@property (weak, nonatomic) IBOutlet UITextField *initialBudget;
@property (weak, nonatomic) IBOutlet UITextField *expenses;
@property (weak, nonatomic) IBOutlet UITextField *timeSpent;
@property (weak, nonatomic) IBOutlet UITextField *incomePerHour

计算:

- (IBAction)calculateResults:(id)sender {
    double budget = [initialBudget.text doubleValue ];
    double expense = [expenses.text doubleValue];
    double time = [timeSpent.text doubleValue];
    double hourlyIncome = (budget - expense)/time;
    NSNumber *resultNumber = [[NSNumber alloc] initWithDouble:hourlyIncome];
    incomePerHour = resultNumber;
};

问题出在这里

incomePerHour = resultNumber;

incomePerHour为UITextField 类型,而resultNumber为 NSNumber 类型。这两个不着边的对象怎可相互转换?

改成

incomePerHour.text=[NSString stringWithFormat:@"%f",hourlyIncome];

一楼说的对,这个是数据类型不匹配