App doesn't run outside Xcode

I appreciate that this could be one of those questions I have to burn a Tech Support ticket on as it could be too general to answer on a forum, but I'd like to ask here first in case there's an obvious fix.


I've written an app that I've tried compiling multiple variants of: I've compiled against 10.10 and 10.11 - even 10.9 - using both Xcode 7.0 (running Xcode under OSX 10.10 and then 10.11) and 7.2 (running on just a 10.11 machine).


All scenarios work fine unless I use the machine with OSX 10.11: then the app functions as expected when I run it within Xcode and it's de-bugger (there are no errors thrown during compilation or logging during execution) but the minute I open it under OSX 10.11's Finder - as it where - there are very strange results. Just to confirm, the same project compiled and run on the machine using OSX 10.10 works in all conditions. I'm also always using 'Clean' and 'Clean build folder' options before each build.


I'd have to publish my entire project and documentation to show you exactly what is happening, but suffice to say it appears that the c++ classes are not operating correctly and each time the same piece of code is executed that malloc's, realloc's and reads arrays of objects of these classes the result is different. There could be other problems as well but since these c++ classes are central to operations I can't get any further.


Looking at Console during operation of the software there's no logging during software operation except I get the following when an 'Open File' button is pressed (I use all standard OSX calls for the NSOpenPanel):


14/01/2016 13:08:39.338 Brewer[527]: BUG in libdispatch client: kevent[EVFILT_MEMORYSTATUS] add: "Operation not supported" - 0x2d

14/01/2016 13:08:39.999 Brewer[527]: assertion failed: 15C50: libxpc.dylib + 63930 [61AB4610-9304-354C-9E9B-D57198AE9866]: 0x89


This may be a red-herring.


Xcode is generating a lot of these messages, however:


14/01/2016 13:34:07.028 Xcode[501]: [MT] DVTAssertions: Warning in /Library/Caches/com.apple.xbs/Sources/IDEFrameworks/IDEFrameworks-9548/IDEKit/Workspace/IDEWorkspaceDocument.m:2395

Details: Error writing UI state:Error Domain=NSCocoaErrorDomain Code=513 "You don’t have permission to save the file “UserInterfaceState.xcuserstate” in the folder “newosx.xcuserdatad”." UserInfo={NSFilePath=/Users/newosx/Desktop/mBrewer xml beta/Brewer.xcodeproj/project.xcworkspace/xcuserdata/newosx.xcuserdatad/UserInterfaceState.xcuserstate, NSUnderlyingError=0x7f92c3f56970 {Error Domain=NSPOSIXErrorDomain Code=13 "Permission denied"}}

Object: <IDEWorkspaceDocument: 0x7f92c38206b0>

Method: -writeStateData

Thread: <NSThread: 0x7f92c1517660>{number = 1, name = main}

Please file a bug at http://bugreport.apple.com with this warning message and any useful information you can provide.


Sorry for the vague question but I don't know where to begin with this one. Assuming the nub of the problem is with the c++ code, perhaps there's some framework I need to add to the project or a compiler option...?

App doesn't run outside Xcode
 
 
Q