Roberto Silvestri
Roberto Silvestri

Reputation: 1

Ftp Url With space in Objective-c

I cant access to the this ftp url with the apple ftpsample:

ftp://192.168.1.20/Lavori/Andrea Baccin/

the space in the name of the folder make a "Invalid URL" error

if i can encode the url with:

url = [url stringByAddingPercentEscapesUsingEncoding:NSASCIIStringEncoding];

that make me this error:

[CALayer appendBytes:length:]: unrecognized selector sent to instance 0x184890

some help?

Thankyou guys!

sorry for my english.

Upvotes: 0

Views: 1125

Answers (2)

tt.Kilew
tt.Kilew

Reputation: 6084

It seems that your error is not related to

url = [url stringByAddingPercentEscapesUsingEncoding:NSASCIIStringEncoding];

I think you have some items the overreleased. Recheck your code on memory management issues, or post more source code here.

Upvotes: 0

vdaubry
vdaubry

Reputation: 11439

Seems like your url object is not an NSString at runtime. Have you tried debugging this line ?

here is a working sample code :

NSString *url = @"ftp://192.168.1.20/Lavori/Andrea Baccin/";
url = [url stringByAddingPercentEscapesUsingEncoding:NSASCIIStringEncoding];
NSLog(@"%@",url);

The console shows :

[Session started at 2011-02-02 14:23:48 +0100.] 2011-02-02 14:23:51.515 UISpec[669:207] ftp://192.168.1.20/Lavori/Andrea%20Baccin/

Hope this helps, Vincent

Upvotes: 3

Related Questions