(ヌル)、このようなコードでは存在しません:asiformdatarequestアップロード画像はありませんが、ファイルは私が画像をアップロードするためのフレームワークをasiformdatarequest使う
私のログはNSArray *paths=NSSearchPathForDirectoriesInDomains(NSDocumentDirectory,NSUserDomainMask,YES);
NSString *path1=[paths objectAtIndex:0];
NSString *filename=[path1 stringByAppendingPathComponent:@"logo.png"];
NSLog(@"image path = %@",filename);
[request setFile:[NSURL URLWithString:filename] forKey:@"avatar"];
[request startSynchronous];
:
image path = /Users/tanlusheng/Library/Application Support/iPhone Simulator/5.1/Applications/5473E6FF-0D3A-48CD-8728-0219CF25BC80/Documents/logo.png
Error Domain=ASIHTTPRequestErrorDomain Code=6 "No file exists at (null)" UserInfo=0x6b4c610 {NSLocalizedDescription=No file exists at (null)}
私は1つの画像内に追加されました私のproject.butなぜファイルを見つけることができません?私はシミュレータで実行されます。
パスの試行 - NSString *ファイル名= [[NSBundle mainBundle] pathForResource:@ "logo" ofType:@ "png"] – rishi
あなたのコードを試しましたが、 "No file exists exists(null)" – Tan