2014-01-10 41 views
0

我通過遵循Deezer文檔並使用servicePath「user/me」發出請求來閱讀用戶的信息。我得到的用戶ID,並設法使與路徑的請求:如何使用iOS SDK讀取和共享Deezer播放列表

NSString* playlistPath = [NSString stringWithFormat:@"playlist/%@", self.deezerID]; 
DeezerRequest* request = [_deezerConnect createRequestWithServicePath:playlistPath 
                   params:nil 
                   delegate:self]; 

[_deezerConnect launchAsyncRequest:request]; 

NSLog(@"Path: %@", playlistPath); 

的我從這個接收到的信息:

/* Delegate methods */ 
#pragma mark - DeezerRequestDelegate 
- (void)request:(DeezerRequest *)request didReceiveResponse:(NSData *)data { 


NSError *error; 
id myJSON = [NSJSONSerialization JSONObjectWithData:data options:NSJSONReadingMutableContainers error:&error]; 

NSDictionary *jsonDic = (NSDictionary *)myJSON; 

if (error != nil) { 
    NSLog(@"Error parsing JSON."); 
} 
else { 
    NSLog(@"Dictionary: %@", jsonDic); 
} 

self.deezerID = jsonDic[@"id"]; 

} 

的問題是,我收到以下錯誤:

Dictionary: { 
error =   { 
    code = 800; 
    message = "no data"; 
    type = DataException; 
    }; 
} 

這是什麼意思?我是否提出正確的要求以檢索用戶的播放列表及其曲目?

我想要做的是獲取用戶播放列表並允許他將其分享給另一個用戶的WebService。這甚至有可能嗎?

+0

該「'playlistPath'」行不是您正在使用的整個URL。在發佈POST或請求獲取播放列表之前,URL是什麼樣的? –

+0

對不起,我只是編輯了問題以包含完整的URL。我希望這有助於獲得答案。 – naSh

回答

相關問題