Hello, Computer-Training segleler

I also tried using stringByAppendingPathExtension, but it returned even worse result. The stringByAppendingPathExtension removes one slash from "file://localhost/...../.../ ..." and makes "file:/localhost/..../..../....".
Please note that one slash is removed after the file:
I reported this to Apple as a bug.

So, probably in your case, your string is constructed somehow to work with this behaviour.

Thanks for your comment though.

On Mar 26, 2009, at 12:18 AM, Computer-Training Segeler wrote:

It's obvious, that your code should work, but .... it doesn't, only heaven knows why. AND ypu're trying to get the same result in different ways!!!

In such situations I change my code in anyway, doing the same thing in slightly anoter way - here stringByAppending... what I did long ago and it changed such a problem with a path construction - and voilá - it mostly helps, maybe XCode will change the way it builds the code.
If it doesn't help, I clean all builds
If that doesn't, I quit XCode
if that doesn't, I restart my Mac,
if that doesn't, I'll go out for a walk - that's no joke - and let a solution come to me, and believe me or not, there comes a solution, so I've always found a solution and could sometimes even use code, that before the change didn't work. Changing the code can make another error obvious, even though this must not be the case here.

success is 1% intuition and 99% sweat

Am 25.03.2009 um 19:12 schrieb JongAm Park:

Thanks for your commenting, but...

If it s not recognized as path, the D&D doesn't work.

Also, I checked like this :


For still images :

(gdb) po fileName
file://localhost/Volumes/NEXIO64/Stills/mccain13.tga
(gdb) po [fileName lastPathComponent]
mccain13.tga
(gdb) po [fileName pathExtension]
tga

For mov files :

(gdb) po fileName
file://localhost/Volumes/NEXIO64/MOV/0000By the Way3 C.mov
(gdb) po [fileName lastPathComponent]
0000By the Way3 C.mov
(gdb) po [fileName pathExtension]
mov

So, there should be no problem.

Thanks,
JongAm Park
.

On Mar 25, 2009, at 10:56 AM, Computer-Training Segeler wrote:

Hallo JongAm,

1. I don*t what the problem comes from, but it help you to check if the fileExtension is recognized as this. I've inserted some code I would use to find that out. 2. Should work, cause i think, your string for the mov-file is not recognized as path!!! By using lastPathComponent in the image fileName that fileName is recognized as path! I'm quite sure that I had that problem long time ago in my code.

Success

Reinhard Segeler
Am 25.03.2009 um 17:17 schrieb JongAm Park:

Hello, all

I wrote lines of codes for Drag&Drop from an NSTableView of my program to the FCP. What is strange is that file extension for dragged image file is shown on the FCP's project window, while that of dragged mov file is not. If the same image file is dragged and dropped from the Finder, it doesn't show the file extension.

In my code, I put the extensions for mov and image files.

The code is like :

isStillImage = [[mClipArray objectAtIndex:indexInClipsArray] alpha_id];
                if( isStillImage )
                {
                        NSString *fileNameInStillImageFolder;
                        NSString *currentFileName;
                        NSRange rangeForFileName;
                        
currentFileName = [[mClipArray objectAtIndex:indexInClipsArray] longName];
                        while( fileNameInStillImageFolder = [dirEnum 
nextObject] )
                        {
rangeForFileName = [fileNameInStillImageFolder rangeOfString:currentFileName];
                                if( rangeForFileName.location != NSNotFound )
                                {
                                        // Found it!!!!
fileName = [NSString stringWithFormat:@"%...@%@/Stills/%@", fileNamePrefix, configPath,
                                                                
[fileNameInStillImageFolder lastPathComponent]];
                                        break;
                                }
                        }
                }
                else
                {
fileName = [NSString stringWithFormat:@"%...@%@/MOV/%...@.mov", fileNamePrefix, configPath,
                                                [[mClipArray 
objectAtIndex:indexInClipsArray] longName]];
1. here to check
NSLog (@"fileName is %@", [ fileName lastPathComponent ] );
NSLog (@"fileExtension is %@", [ fileName pathExtension ] );

Use this to create your path 2:

fileName = [NSString stringWithFormat:@"%...@%@/MOV/%@", fileNamePrefix, configPath,
                                                [[mClipArray 
objectAtIndex:indexInClipsArray] longName]];
fileName =  [ fileName stringByAppendingPathExtension:@"mov" ] )

                }
                
                if( fileName )
                        [fileNamesArray addObject:fileName];


I also used DragPeeker X for debugging D&D. However, it doesn't reveal any differences. So, how to make the extension not displayed on the FCP's project window?

Thank you.
_______________________________________________


_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to