I "upgraded" to XCode 9 today, hoping that it would support the new ISO Appendix K safe string functions (it doesn't). It has always been difficult to get XCode to update a Mac application's Help Book. In the past I have been able to do it by following these instructions:Delete any other versions of the app and empty the trash.Update the Help.plistCreate a new Help.helpindex file using the Help IndexerRemove the help folder from project.Delete the system’s cached help folder using the terminal command: rm -rf ~/Library/Caches/com.apple.help*Sometimes it helps to restart your machine nowSometimes it helps to execute the termanal command rm -rf ~/Library/Caches/com.apple.help* againClean and rebuild the project without the Help folderAdd the new Help folder, clean and rebuildCheck to be sure that the new help book is addedNow this doesn't work. When I run my project with the new Help Book the Help Book window says:The selected topic is currently unavailable.The topic you were trying to view could not be found.XCode logs:2017-09-20 13:45:49.466114-0600 app[2349:187674] Entering AHRegisterHelpBookWithURL2017-09-20 13:45:49.466228-0600 app[2349:187674] Entering AHRegisterHelpBookWithURL: 0Can anyone tell me how to get XCode 9 to do this?
My project contains both .c and .m files. The Application is not completely localized. Method invocations in .m files llike this:[myButton setTitle: @"out of range"];are reported as:"User-facing text should use localized string macro"This also creates an interesting side effect. All of the conditional statements in the same file are reported as "Assuming 'variable' is equal to constant.For example:if(variable == 0) is reported as an error - "Assuming 'variable' is equal 0".Does anyone else have this problem? Can I make it stop? Should I report this to Apple as a bug?
In 2011 ISO substantially rewrote the C language. I didn't hear about this so I found out about it the hard way - my program crashed when I called a C function that copied from a location, to a location in the same buffer. It turns out that the ISO C adopted in 2012 was designed to be safer and the run time is supposed to crash when you do this. This is to make it harder to create an array overflow. According to the ISO C documentation, in the new language spec, there are safe versions of dangerous functions like strcpy(). These have the same function name with a "_s"suffix. For example you can use strcpy_s() instead of the old strcpy(). According to the ISO standard you can use these if you #define __STDC_WANT_LIB_EXT1__ as something other than 0 (the examples define it as 1) before you #include the <library>. In my projects this does nothing - the new safe "_s" functions aren't found. I can't find __STDC_WANT_LIB_EXT1__ any where in my projects, for example in the headers. Is there some framework I need to add?I can't find any documentation for this new ISO standard C here at developer support - not in developer documentation or in these forums.How can I implement the new ISO C?
When I copy an address in a buffer to another location in the same buffer the application crashes. It logs: "detected source and destination buffer overlap" EXC_BAD_INSTRUCTION (code=EXCI386_INVOP, subcode=0x0)for examplechar myBuffer[1024];while myBuffer[0] == ' 'strcpy(myBuffer, myBuffer + 1); or alternatelystrcpy(myBuffer, &myBuffer[1]);This should strip leading spaces from a buffer of text. This is perfectly legitimate in all versions of C and has been OK in all versions of XCode and all C compilers since C was invented.This is in XCode 8.3.3 (8E3004b)Seriously Apple, you just broke hundreds of millions of lines of source code. Is there any way for me to fix this other than re-writing the text editing code in thousands of appplications and hundreds of millions of lines of source code?Can I use some other compiler?The Code Analyser doesn't find these Can I get it to?Can I fix the build settings so the LLVM compiler won't break this?C IS NOT Swift. Apple doesn't need to save me from myself. PLEASE HELP ME!
I'm using Xcode 8.3.3 to work on a Mac application, written in Objective C. In both the project and target settings the Apple LLVM 8.1 Warnings - Deprecated Functions are set to yes. My project called CGContextShowTextAtPoint(params). It was pointed out by a user that this was causing text to be displayed incorrectly. I looked at the documentation and it shows this function to be deprecated in OS X 10.9.Why doesn't Xcode complain about this when I build my project? Is it possible that I'm also missing other deprecated functions?Also the documentation used to mention newer functions that should be called to replace deprecated functions but doesn't in the documentation for this function.I have my build settings set to build for OS X 10.6. Yes, this is probably too old. Would setting the build version to an newer OS fix this?