2017-01-26 1 views
0

더블 타입 변수 operand을 AnyObject 배열에 추가하려고했습니다.Double은 AnyObject 배열에 추가 할 수 없습니까?

private var internalProgram = [AnyObject]() 
internalProgram.append(operand) 

그러나, Argument type 'Double' does not conform to expected type 'AnyObject'으로 나타냈다. operandAnyObject으로 전송해야합니까?

답변

0
let numberOperand = NSNumber(double: operand) 
yourArrayOfAnyObject.append(numberOperand) 
관련 문제