Post

Replies

Boosts

Views

Activity

std::string Leak
Here's how I can reproduce the memory leak: On the home page, I press button A, which calls a method in the view model that creates a std::string using std.string as documented here. Then, I press button B on the home page that opens a modal view. Then, instruments detects a leak of 192 bytes, and the stack trace points to the string I created. It doesn't really make sense to me why there would be a memory leak relating to std::string, so I am asking here. Thanks!
0
0
390
Aug ’23
I am trying to mix Swift and C++, and my C++ class has errors "expected ';' after top level declarator" and "unknown type name 'class'; did you mean 'Class'?"
I am attempting to create a C++ file called Fish and to display the fish's num in my SwiftUI app. However, I am encountering the errors "expected ';' after top level declarator" and "unknown type name 'class'; did you mean 'Class'?". It appears that Xcode thinks that the file is a C file. How should I address these errors?
3
0
1.4k
Jul ’23