Re: App give s -35 error when run out of the debugger
Re: App give s -35 error when run out of the debugger
- Subject: Re: App give s -35 error when run out of the debugger
- From: Fritz Anderson <email@hidden>
- Date: Tue, 13 Nov 2012 09:38:55 -0600
On 12 Nov 2012, at 7:29 PM, "Jason T. Slack-Moehrle" <email@hidden> wrote:
> As an update:
>
> OS X 10.6.8, XCode 3.2.6 targeting 10.5 SDK, Carbon
>
> My app works in the debugger. all the resources, etc load. (there are a lot, hundreds, from .png's to special text files, etc)
>
> When I double click it outside the debugger it returns a -35 error.
>
> According to MacErrors.h: http://opensource.apple.com/source/CarbonHeaders/CarbonHeaders-18.1/MacErrors.h
>
> a -35: nsvErr = -35, /*no such volume*/
>
> According to Console.app: 11/12/12 10:59:23 AM [0x0-0x25d25d]Mystical[18406] what(): {-35}
>
> So it seem the paths are like:
>
> .\Flg.h
> .\Dreamsuite\DS1Preferences.iqu
> .\DreamSuite\DS1SecurePreferences.iqu
> .\Dreamsuite\SplashScreen.iqu
> .\\Dreamsuite\\dsSplash.jpg
> .\Dreamsuite\DS1Skin.iqk
> .\Dreamsuite\DS1Skin.iqk
> .\Dreamsuite\ButtonSkin1.iqk
> .\Dreamsuite\MainStringTable.iqs
> .\Dreamsuite\ControlStringIndex.iqc
> .\Dreamsuite\Effects\Correction Layer
> .\Dreamsuite\Effects\Antique Photo
> .\Dreamsuite\Effects\Black and White
> .\Dreamsuite\Effects\Blue Sky
> .\Dreamsuite\Effects\Color Bleach
> .\Dreamsuite\Effects\Color Contrast
> .\Dreamsuite\Effects\Color Mixer
> .\Dreamsuite\Effects\Color Tone
> .\Dreamsuite\Effects\Cool Colors
>
> So if the app is in a folder with a hierarchy of:
>
> app.app
> Flg.h
> Dreamsuite\DS1Preferences.iqu
> ...
> Dreamsuite\Effects\Correction Layer
> ...
>
> isn't the .\ at the beginning messing this up?
>
> shouldn't it be just returning:
>
> Flg.h
> Dreamsuite\DS1Preferences.iqu
> DreamSuite\DS1SecurePreferences.iqu
> Dreamsuite\SplashScreen.iqu
> Dreamsuite\\dsSplash.jpg
> Dreamsuite\DS1Skin.iqk
> Dreamsuite\DS1Skin.iqk
> Dreamsuite\ButtonSkin1.iqk
> Dreamsuite\MainStringTable.iqs
> Dreamsuite\ControlStringIndex.iqc
> Dreamsuite\Effects\Correction Layer
> Dreamsuite\Effects\Antique Photo
> Dreamsuite\Effects\Black and White
> Dreamsuite\Effects\Blue Sky
> Dreamsuite\Effects\Color Bleach
> Dreamsuite\Effects\Color Contrast
> Dreamsuite\Effects\Color Mixer
> Dreamsuite\Effects\Color Tone
> Dreamsuite\Effects\Cool Colors
Go no further until you have read a basic tutorial on UNIX/POSIX file-system functions and the concepts of current working directory and relative file path.
Backslash is simply not a path separator in UNIX. This is fundamental. Most operating systems are not Windows. If it somehow works, the system is being merciful; don't rely on that mercy's being granted in all cases.
For debugging, Xcode sets the current working directory for an application to the directory into which the application was built. When you run the application on its own, the cwd is the root of the file system (/) for Cocoa applications, and whatever the "pwd" command would print for command-line applications. Relative file paths will therefore resolve to different absolute paths in the debugger and in real life.
In the Run section of the Scheme editor, Options tab, you can set a working directory for Xcode to use for debugging.
The paths you show are relative paths; in effect the path to the current working directory is prepended to them before the app tries to open/create files at those paths. "./" is a synonym for the cwd. Again, that will be different depending on whether you launch from Xcode or from the Finder/command line.
For Cocoa applications, because the working directory and absolute paths can't be relied on, you must use NSBundle to find files in the .app package.
Find a tutorial and do nothing else until you understand it.
— F
--
Fritz Anderson -- Xcode 4 Unleashed: 4.5 supplement in the works -- <http://x4u.manoverboard.org/>
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden