• python
  • javascript
  • reactjs
  • sql
  • c#
  • java
Facebook Twitter Instagram
Devs Fixed
  • python
  • javascript
  • reactjs
  • sql
  • c#
  • java
Devs Fixed
Home ยป Resolved: Code crashing when calling function that formats an Objects properties into a String?

Resolved: Code crashing when calling function that formats an Objects properties into a String?

0
By Isaac Tonny on 18/06/2022 Issue
Share
Facebook Twitter LinkedIn

Question:

Im trying to make a function that takes an objects properties and formats them into a String, then printing out that String as a “Description”. When I run my code, I get an error “Thread 1:EXC_BAD_ACCESS (code=1, address=0x16)” with the return String highlighted red.
This is the function:
Here is the call:
From what I’ve tested the object has been initialized correctly, I’m not really sure where to go from here.

Answer:

The format seems to be wrong, you have to use correct format if you want to use that method, therefore, have to use %d for integer, %f for float example:
But still, recommended way for using String in swift is to use \(), like:

If you have better answer, please add a comment about this, thank you!

swift
Share. Facebook Twitter LinkedIn

Related Posts

Resolved: How to efficient create SimpleITK image?

01/04/2023

Resolved: How can I write CSS selector(s) that apply to table rows for all td elements on that row after a td with a certain class?

01/04/2023

Resolved: How do I use SetWindowText with Unicode in Win32 using PowerShell?

01/04/2023

Leave A Reply

© 2023 DEVSFIX.COM

Type above and press Enter to search. Press Esc to cancel.