Post not yet marked as solved
I've just fixed very strange bug / error/ undocumented feature on my Xcode conf.
When I was running the latest Xcode 13.4.1 and highlight / autocompletion stopped working as I believe since macOS Monterey upgrade (before I ran Xcode 12) since I "fixed" some conf values by running defaults write com.apple.dt.Xcode some keys.
Now I fixed It by deleting that edited config and re-running Xcode again and now it shows me autocompletion suggestions and follows headers when I press @@
defaults delete com.apple.dt.Xcode
I just prepared this post with the ending: What should I do to make it possible to work? Appreciate for any help (Show live issues is turned on). Since I solved it I leave these words to let anyone who needs it to fix the issue with this mini tutorial.
It somehow doesn't affect Swift code.
Here's the stripped version of my old broken conf produced by defaults read com.apple.dt.Xcode:
{
BuildSystemScheduleInherentlyParallelCommandsExclusively = 1;
CurrentAlertPreferencesSelection = "Xcode.AlertEvent.BuildStart";
"DTDKCrashLogSortDescriptors4.5" = (
{
NSAscending = 0;
NSKey = processName;
NSSelector = "compare:";
},
{
NSAscending = 1;
NSKey = type;
NSSelector = "compare:";
},
{
NSAscending = 0;
NSKey = dateTime;
NSSelector = "compare:";
}
);
DVTTextAutoSuggestCompletions = 1;
DVTTextCompletionRecentCompletions = (
NSString
);
DVTTextIndentCase = 0;
DVTTextIndentTabWidth = 2;
DVTTextIndentWidth = 2;
DVTTextShowMinimap = 0;
DVTTextSoloBraceIndentWidth = 2;
DVTTextWrappedLinesIndentWidth = 2;
IBAppliesAutoResizingRulesWhileResizing = 0;
IBDesktopImageCacheVersionKey = "12.4-13F17a";
IBGlobalLastEditorDocumentClassName = IBStoryboardDocument;
IBGlobalLastEditorTargetRuntime = "IBCocoaTouchFramework-fifteenAndLater";
IBPreferencesMigrated = 1;
IBShowingMinimapStoryboard = 0;
IBViewSizeInspectorPreferredRectTypeName = frame;
IDEActivityLogShowsAllBuildSteps = 1;
IDEActivityLogShowsAnalyzerResults = 1;
IDEActivityLogShowsErrors = 1;
IDEActivityLogShowsWarnings = 1;
"IDEAnalyticsMetricsNotifications.AnalyticsMetricsNotificationsController.lastRefreshAttemptDate" = "2022-06-08 04:27:07 +0000";
IDEAppearance = 0;
IDEBuildLocationStyle = Unique;
IDECopyFilesToTargetGroup = 0;
IDECreateGroupsForFolders = 0;
IDEDebugSessionShowDisassemblyWhenDebugging = 0;
IDEDisableGitSupportForNewProjects = 1;
IDEDisableStateRestoration = 1;
IDEDocSearchSelectedReferenceIdentifier = occ;
IDEExtensionsBuiltPriorToXcode12 = (
);
IDEFileExtensionDisplayMode = 1;
"IDEFileTemplateChooserAssistantSelectedTemplateName_iOS" = "Source/Header File";
"IDEFileTemplateChooserAssistantSelectedTemplateName_macOS" = "Source/Header File";
IDEFileTemplateChooserAssistantSelectedTemplateSection = "com.apple.platform.macosx";
IDEHasConvertedXcode3BuildPrefs = 1;
IDEIndexDisable = 1;
IDEIndexShowLog = 0;
IDEKeyBindingCurrentPreferenceSet = "Default.idekeybindings";
IDEKeyBindingExcludedPreferenceSet = (
Default
);
IDELastBreakpointActionClassName = IDESoundBreakpointAction;
IDELogNavigatorGroupByKey = 0;
IDEMaxParallelTestingWorkersMac = 0;
IDEOpenQuicklyPreferSwiftGeneratedInterface = 0;
"IDEOpenQuicklyWindowController.width" = 454;
IDEProductsViewControllerSourceListSplitPosition = 215;
IDEProfileActionSelectedTab = Info;
IDEProvisioningTeamManagerLastSelectedTeamID = XXXXXXXXXX;
IDEProvisioningTeams = {
"my@email.com" = (
{
isFreeProvisioningTeam = 1;
teamID = XXXXXXXXXX;
teamName = "Larry Moore (Personal Team)";
teamType = "Personal Team";
}
);
};
IDEShowPrebuildLogs = 0;
IDESoundBreakpointActionDefaultNameKey = Pop;
IDESourceControlPreferencesVersion = 201;
IDESuppressStandardArchitecturesUpgrade = 0;
IDESuppressStopExecutionWarning = 1;
IDESuppressStopExecutionWarningTarget = "IDESuppressStopExecutionWarningTargetValue_Stop";
IDESwiftPackageAdditionAssistantRecentlyUsedPackages = (
);
IDESwiftPackageCollectionsAddedDefaultCollectionsDVTToolsVersion = "Xcode 13.3.1";
IDETestActionSelectedTab = Info;
IDETouchBarSimulatorIsVisible = 0;
IDEUserWantsToEnableDeveloperSystemPolicyMode = 0;
LastProcessNameAttachedTo = Riot;
NSColorPanelMode = 1;
NSColorPickerPreferredRGBEntryMode = 2;
NSColorPickerSlidersDefaults = 1;
NSNavPanelExpandedStateForSaveMode = 1;
PBXNumberOfParallelBuildSubtasks = 10;
PMPrintingExpandedStateForPrint2 = 0;
PegasusMultipleCursorsEnabled = 1;
ShowBuildOperationDuration = 1;
Xcode3BuildSettingsEditorDisplayMode = 0;
Xcode3BuildSettingsEditorMode = 0;
Xcode3ProjectEditorSourceListVisible = 1;
"Xcode3ProjectTemplateChooserAssistantSelectedTemplateName_iOS" = "Application/App";
"Xcode3ProjectTemplateChooserAssistantSelectedTemplateName_macOS" = "Application/App";
Xcode3ProjectTemplateChooserAssistantSelectedTemplateSection = "com.apple.platform.iphoneos";
"Xcode3TargetTemplateChooserAssistantSelectedTemplateName_iOS" = "Application/App";
"Xcode3TargetTemplateChooserAssistantSelectedTemplateName_macOS" = "Application/Command Line Tool";
Xcode3TargetTemplateChooserAssistantSelectedTemplateSection = "com.apple.platform.macosx";
}
The only suspicious key is DVTTextAutoSuggestCompletions = 1; in this old config that might have stopped autocompletion.
Post not yet marked as solved
I got this error building PyTorch 1.12 on OS X Monterey 12.4, XCode 13.4 in the linker:
ld: in lib/libnnpack.a(conv1x1.py.o), section __TEXT/__const address out of range for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
% clang --version
Apple clang version 13.1.6 (clang-1316.0.21.2.5)
Target: x86_64-apple-darwin21.5.0
Thread model: posix
InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin
% lipo -info ./build/lib/*.a
Non-fat file: ./build/lib/libXNNPACK.a is architecture: x86_64
Non-fat file: ./build/lib/libasmjit.a is architecture: x86_64
Non-fat file: ./build/lib/libbenchmark.a is architecture: x86_64
Non-fat file: ./build/lib/libbenchmark_main.a is architecture: x86_64
Non-fat file: ./build/lib/libcaffe2_protos.a is architecture: x86_64
Non-fat file: ./build/lib/libclog.a is architecture: x86_64
Non-fat file: ./build/lib/libcpuinfo.a is architecture: x86_64
Non-fat file: ./build/lib/libcpuinfo_internals.a is architecture: x86_64
Non-fat file: ./build/lib/libdnnl.a is architecture: x86_64
Non-fat file: ./build/lib/libfbgemm.a is architecture: x86_64
Non-fat file: ./build/lib/libfmt.a is architecture: x86_64
Non-fat file: ./build/lib/libfoxi_loader.a is architecture: x86_64
Non-fat file: ./build/lib/libgmock.a is architecture: x86_64
Non-fat file: ./build/lib/libgmock_main.a is architecture: x86_64
Non-fat file: ./build/lib/libgtest.a is architecture: x86_64
Non-fat file: ./build/lib/libgtest_main.a is architecture: x86_64
Non-fat file: ./build/lib/libkineto.a is architecture: x86_64
Non-fat file: ./build/lib/libnnpack.a is architecture: x86_64
Non-fat file: ./build/lib/libnnpack_reference_layers.a is architecture: x86_64
Non-fat file: ./build/lib/libonnx.a is architecture: x86_64
Non-fat file: ./build/lib/libonnx_proto.a is architecture: x86_64
Non-fat file: ./build/lib/libprotobuf-lite.a is architecture: x86_64
Non-fat file: ./build/lib/libprotobuf.a is architecture: x86_64
Non-fat file: ./build/lib/libprotoc.a is architecture: x86_64
Non-fat file: ./build/lib/libpthreadpool.a is architecture: x86_64
Non-fat file: ./build/lib/libpytorch_qnnpack.a is architecture: x86_64
Non-fat file: ./build/lib/libqnnpack.a is architecture: x86_64
(base) davidlaxer@x86_64-apple-darwin13 pytorch
linkText
linkText
Any suggestions?
Post not yet marked as solved
It's easy in Visual Studio.
https://disk.yandex.ru/i/NML0t6lA_cMWhw
https://disk.yandex.ru/i/dQ-uwkLKA_eAiQ
i used dev c++ on windows before this and it works just fine when i use command like this
system("color E0");
system("cls");
system("pause");
system("title test");
but in Xcode, when i run it they said the command is not found. may i know how to fix this ? thank you
Post not yet marked as solved
Hello,
I want use PyMC3 on my computer. I need g++ for that, which is installed via command line tools. I have command line tools installed together with xcode, but when I run my code, g++ headers are not found and I'm prompted to install g++ with command line tools. I redo the installation and when I re-run my code, I get the same message. Also when I do g++ --version I get the following message:
ebuild: error: SDK "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX11.3.sdk@" cannot be located.
g++: error: Failed to determine realpath of '/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX11.3.sdk@' (errno=No such file or directory)
g++: error: sh -c '/Applications/Xcode.app/Contents/Developer/usr/bin/xcodebuild -sdk /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX11.3.sdk@ -find g++ 2> /dev/null' failed with exit code 16384: (null) (errno=No such file or directory)
xcode-select: Failed to locate 'g++', requesting installation of command line developer tools.
Another thing is that, the version of SKD in my directory is,
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX12.3.sdk@.
But g++ is looking for MacOSX11.3.sdk@.
How can I fix this problem?
I currently have OS monterey 12.0.1.
Post not yet marked as solved
Hey guys I am starting to learn coding and I don't know how but I activate something and I don't know to turn it off and everytime I run a program this appears on the screen.
Can someone help?
Post not yet marked as solved
I want to develop based on iOS and I did some verifications based on xCode Instruments firstly. But there are some confusions on the verification results.
I did the test to open a file in 1KB size.
The analysis results from xCode Instruments is as followings:
In "Disk Usage", it shows that there are 4KB "Page In" operations. (Please refer to P1.png attached)
In "Virtual Memory Trace", it shows totally 4-times of "File Backed Page In" operations, and each operation size is 16K. (Please refer to P2.png & P3.png attached)
That is, Size of "File Backed Page In" is around 4*16K=64KB.
I did similar tests on different size of files.
Every time the values of "Disk Usage"->"Page In" and "Virtual Memory Trace"->"File Backed Page In" are not matched (In this example, the two results are 4KB vs. 64KB).
I think that both values represent disk IO size of the process and they should be in the same value for the same process.
Why the values are different?
What are the differences between this two options in xCode Instrument tool?
Thanks.
Post not yet marked as solved
I want to develop based on iOS and I did some verifications based on xCode Instruments firstly.
But there are some confusions on the verification results.
I did the test to open a file in 1KB size.
The analysis results from xCode Instruments is as followings:
In "Disk Usage", it shows that there are 4KB "Page In" operations. (Please refer to P1.png attached)
In "Virtual Memory Trace", it shows totally 4-times of "File Backed Page In" operations, and each operation size is 16K. (Please refer to P2.png & P3.png attached)
That is, Size of "File Backed Page In" is around 4*16K=64KB.
I did similar tests on different size of files.
Every time the values of "Disk Usage"->"Page In" and "Virtual Memory Trace"->"File Backed Page In" are not matched (In this example, the two results are 4KB vs. 64KB).
I think that both values represent disk IO size of the process and they should be in the same value for the same process.
Why the values are different?
What are the differences between this two options in xCode Instrument tool?
Thanks a lot.
Post not yet marked as solved
Hello. I have a M1 Mac mini with MacOS 12.1 (MacOS Monterey).
I have written a C++ program in the inbuilt vim text editor for sorting an Array of integers in ascending order using Merge Sort Algorithm. The compiler I am using is the official Clang compiler. MI tried the g++ command as well as clang++ command to compile the program. (Actually both the commands run clang compiler only)
The weird thing I am facing is that sometimes it replaces some integers in the output with random integers. I have attached the screenshot. But this behaviour is not observed when I copied the same program in my windows PC.
Please help in this regard.
I am attaching the C++ program file as well as the screenshot of the output.
MergeSort.cpp
Post not yet marked as solved
Hello,
I know that we can capture object using reality kit and create a 3D model of the real world object. Can we also use reality kit to scan a human and create a 3D model of the human along with the skeletal structure. So we can use the same scanned human in the motion capture and display the motion animation with the real person.
Thanks & Regards,
Rakesh
Post not yet marked as solved
Recently, I am learning some knowledge about OpenCV on Mac, refer to the online tutorial to configure OpenCV of C++ on Xcode, and implement some simple examples on Xcode.
The biggest problem encountered is how to preview the image in debug mode. The cv::Mat image cannot be previewed directly, which is very unfriendly for debugging. I also found some solutions to this problem on the Internet, and these results are disappointing, at least for me as a programming beginner. I hope that this function implemented by xcode has the corresponding "OpenCV Image Viewer" plug-in on other IDEs on Mac such as Pycharm and CLion, and the "Image Watch" plug-in corresponding to Visual Studio on Windows.
For me, this feature is necessary. According to this idea, is it a wrong choice to learn OpenCV C++ with Xcode, and embracing CLion on a Mac is the best choice for me? (Considering that Xcode is an IDE for Swift, I don't know much about Swift.) The process of implementing these simple examples on Xcode is still very enjoyable. I like Xcode's UI design. Therefore, I still hope that there is the best way to solve this problem in Xcode.
The following is an example of running C++ OpenCV on Xcode:
Xcode Version: 13.2.1 (13C100)
OpenCV Version: stable 4.5.3 (bottled)
Post not yet marked as solved
Currently in Xcode 13, clang static analyzer is not analyzing Swift Language. Will Clang Static Analyzer eventually support Swift Language in the upcoming releases?
Post not yet marked as solved
Hello everyone.
I have an issue with an iOS react-native app after the iOS 15 upgrade but with not a crash.
If someone opens the app after ~1 hour from the last time he/she opened it, the app skips the SplashScreen, and after that nothing renders correctly. The positioning and order of components are wrong. also only happens in some devices like iPhone 12 pro max running 15.1.1 any help would be highly appreciated I'm counting on these forms other than that there is no way to debug such an issue or to put any log because even log will not identify issue
Post not yet marked as solved
Hello Developers,
I am using Xcode(Rosetta Enabled) in macBook Air (2020) with M1 Chip.
I am facing an issue with Xcode 13.1 in macOS 12.0.1
whenever I run my project in my device first time it's running successfully but when i do some changes in code and re run the project then it's not responding at all. I need to force quit and re open the xcode do all stuff.
I am facing this is issue with my project only..for all other projects Xcode working fine and seamless
So I am not understanding what is the issue with my project
So If anybody face similar issue please help me
Thank you
Report
ld: warning: dylib (/usr/local/Cellar/gcc/11.2.0/lib/gcc/11/libstdc++.dylib) was built for newer macOS version (11.3) than being linked (11.0)
this warning is showing up in the terminal every time I run C++ code in it using g++ compiler.
how to get rid of it ?
I have tried to reinstall Xcode- command line tools but it doesn't seem to solve the problem.
Post not yet marked as solved
Since I have upgraded my macOS to Monterey, it couldn't run the cython files. I already installed xcode and the path of /Library/Developer/CommandLineTools/usr/bin
contains clang
but by running the following command
python setup.py build_ext --inplace
it return the error:
clang-10: error: linker command failed with exit code 1 (use -v to see invocation)
error: command 'x86_64-apple-darwin13.4.0-clang' failed with exit status 1
even it created the build and .c and .so files it couldn't compile and find c/c+ libs like:
cython_modules.c:620:10: fatal error: 'numpy/arrayobject.h' file not found
#include "numpy/arrayobject.h"
^~~~~~~~~~~~~~~~~~~~~
1 error generated.
Post not yet marked as solved
I've received this message when I try to run the program:
"Failed to install the requested application
The bundle identifier of the application could not be determined.
Ensure that the application's Info.plist contains a value for CFBundleIdentifier."
What I can do to fix it?
Post not yet marked as solved
when I use. low version of Xcode13, I run a iOS project is ok.
when I. use Xcode13, I got a link problem,
"
ld: library not found for -lbz2.1.0.5
clang: error: linker command failed with exit code 1 (use -v to see invocation)
"
-lbz2.1.0.5 is what framwork?
what should I Do?
I. just use The Legacy Build System build! I don`t know is there have influence! who can help me !
Post not yet marked as solved
After upgrading to Xcode 13.0 (13a233), the code prompt of our project OC file is super slow. It takes about 10 seconds for smart Lenovo to come out. The swift file is OK, and the prompt is very fast.
After trying to create a new project, the prompt is also very fast. It seems that there is a problem with our project settings. But I tried to modify some settings, but I still couldn't solve it.
We are a swift mixed project dominated by OC. The project folder has 5.37gb and has not been disassembled into small projects. At present, there are about 1000 warnings. I wonder whether it is related to this.
Unrelated to notebook, MacOS version and Xcode settings have been excluded because project members are experiencing this problem. It's no problem to open other similar large swift based hybrid projects.
Our project is divided into 10 configurations according to different server environments. It is estimated that it is related to the setting of build setting. It is unclear how to modify it.
Does anyone know how modification can make code Association faster? thank you!
Post not yet marked as solved
Hi everyone,
I got an error when compile c++ with xcode 13.
> 'notify_one' is unavailable
'wait' is unavailable
This is my code in main.mm :
#include <iostream>
#include <atomic>
#include <thread>
std::atomic_flag condAtomicFlag{};
std::atomic<int> counter{};
constexpr int countlimit = 1000000;
void ping() {
while(counter <= countlimit) {
condAtomicFlag.clear();
condAtomicFlag.test_and_set();
++counter;
condAtomicFlag.notify_one();
}
}
void pong() {
while(counter < countlimit) {
condAtomicFlag.wait(false);
condAtomicFlag.clear();
condAtomicFlag.notify_one();
}
}
int main() {
auto start = std::chrono::system_clock::now();
condAtomicFlag.test_and_set();
std::thread t1(ping);
std::thread t2(pong);
t1.join();
t2.join();
std::chrono::duration<double> dur = std::chrono::system_clock::now() - start;
std::cout << "Duration: " << dur.count() << " seconds" << std::endl;
}
I researched and found Apple clang not support "notify_one" and "wait" function
If have any solution for my issue
Thank you