2011-06-01 81 views
0

這是我的問題!我正在使用MGTwitter引擎,並將所有放置在表格視圖中的所有內容從推文轉換爲screen_names重新推文計數和頭像。我不明白的是,如果我添加任何類型的已知的「計數」,它會崩潰在19細胞MGTwitterEngine「默認」推文計數?

它總是19細胞崩潰的......之後滾動????

這是我如何得到我的數

- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section 
{ 





int count = [tweets count]; 


// if there's no data yet, return enough rows to fill the screen 
    if (count == 0) 
    count = kCustomRowCount; 


// count = 50; -----this does not work ! it will crash when scrolling!? 

return count ; 
return [avatarsURL count]; 
//return [retweetCount count]; 
//return [avatars count]; 


} 

所以,如果我只是返回計數由上述可見「返回計數;」一切工作正常,但它得到的鳴叫隨機數的每次從10 - 20鳴叫絕不會那麼20 .....什麼是具有嘰嘰喳喳發動機的SENCE,如果你CAINT得到更多然後20​​個鳴叫???所以我去,並添加你看到

行「數= 50;」它在滾動到第19個單元格時崩潰!不管是什麼我這個號碼確實這個....例如:

count = 21; 

它仍然會崩潰..... ???困惑了嗎?我是......也許我正在返回計數全部錯誤,並且有人可以更好地指導我返回計數....並且是的,我已經在我的課程頂部定義了kCustomRowCount ....

所以我的第一個最初的反應是我做錯了什麼事,但我看了看,看了又看,似乎不能看什麼....然後我做了一些測試,發現它似乎崩潰的19單元和我們都知道iOS整數從零開始。這意味着可能有一個默認的推特計數。

所以當然我打開MGTwitter引擎,並開始瀏覽沒有運氣,我GOOGLE了它,發現有一次默認鳴叫計數20鳴叫MGTwitterEngine.h但不是在我的版本!所以我只是添加了#define並且不起作用!因此,如果任何人對如何解決這個問題有任何建議,或者如果有或沒有默認的推特計數,所以我可以取消等式!

謝謝你,我希望能儘快找到解決的辦法!

回答

0

在SA_OAuthTwitterEngine.m取消註釋

if (params) { 
     fullPath = [self _queryStringWithBase:fullPath parameters:params 
     prefixed:YES]; 
    } 

,如下圖所示!您的歡迎.....

#define SET_AUTHORIZATION_IN_HEADER 1 

- (NSString *)_sendRequestWithMethod:(NSString *)method 
          path:(NSString *)path 
       queryParameters:(NSDictionary *)params 
          body:(NSString *)body 
        requestType:(MGTwitterRequestType)requestType 
        responseType:(MGTwitterResponseType)responseType 
{ 
NSString *fullPath = path; 

// -------------------------------------------------------------------------------- 
// modificaiton from the base clase 
// the base class appends parameters here 
// -------------------------------------------------------------------------------- 
// if (params) { 
//  fullPath = [self _queryStringWithBase:fullPath parameters:params 
    // prefixed:YES]; 
    } 
// -------------------------------------------------------------------------------- 

    NSString *urlString = [NSString stringWithFormat:@"%@://%@/%@", 
         (_secureConnection) ? @"https" : @"http", 
         _APIDomain, fullPath]; 
    NSURL *finalURL = [NSURL URLWithString:urlString]; 
    if (!finalURL) { 
    return nil; 
    }