Search code examples
c++iosclibxl

Passing const char to incompatible type double


Whenever i define this string as a number, it gives me the error 'Passing const char to incompatible type double'. When i define the string as xlSheetWriteStr there are no issues but when i define it as a number it gives me the error.

Here is the code with the issue -

 xlSheetWriteNum(sheet, 2, 1,[self.personcityTextField.text UTF8String], 0);

Thanks in advance.


Solution

  • The fourth parameter to xlSheetWriteNum expects a double and not a string value. Try this:

    xlSheetWriteNum(sheet, 2, 1, [self.personcityTextField.text doubleValue], 0);