0

我正在尝试将文件上传到 Dropbox。上传不工作。上传方法如下。

//  RootViewController.m

-(NSString *)getDocumentPath{

    NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);
    NSString *path = [[paths objectAtIndex:0]stringByAppendingPathComponent:FILENAME];
    return path;
}
-(IBAction)download:(id)sender{
    NSLog(@"download pressed");
    [self.activityIndicator startAnimating];
    [self.restClient loadFile:@"/dbTutorial.plist" intoPath:[self getDocumentPath]];

}
-(IBAction)upload:(id)sender{

    NSLog(@"upload pressed");
    [self.activityIndicator startAnimating];
    NSString *path = [self getDocumentPath];
    [self.itemArray writeToFile:path atomically:YES];
    [self.itemArray uploadFile:FILENAME toPath:@"/" fromPath:path];// When I build this is the warning that I get:NSMutableArray may not respond to -uploadFiletoPath:fromPath


}

非常感谢你。任何帮助将不胜感激。

4

2 回答 2

1

它应该是 [self.restClient uploadFile:FILENAME toPath:@"/" fromPath:path];

于 2011-05-10T05:59:47.533 回答
1
- (void)uploadPhoto
{

    NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);
    NSString *path = [[paths objectAtIndex:0]stringByAppendingPathComponent:@"Kallol.jpg"];

    NSString *pathString = @"/Photos";

    [self.restClient uploadFile:@"Kallol12.jpg" toPath:pathString fromPath:path];

}

我尝试使用上面的代码并且工作得很好............

于 2011-08-20T11:28:02.830 回答