Error when trying to use ( print ) array employees in RaiseMan

When I try to print array employees:

@IBAction func doTest(sender: AnyObject) {
print( “employees =”, employees )
I get error:
employees = fatal error: NSArray element failed to match the Swift Array Element type

Is there a work around for this?

There is a coding error in that print statement.

You have used the print function incorrectly.

If you read the user manual, you will see something like this:

print(_:separator:terminator:) Writes the textual representations of items, separated by separator and terminated by terminator, into the standard output.

Now, try the following print statement.

print ("employees = \(employees)")

Thanks for your quick reply. However I get the same result with print (“employees = (employees)”)

Also with both the following error message is given in the listing:
Thread 1:EXC_BAD_INSTRUCTIO(code=EXC_1386_INVOP,subcode=0x0)

If I don’t enter any data with Add Employee, either print statement gives employees = [ ] and no error

The solution to printing in Chapter 27 also fixed this problem.