2014-12-02 37 views
1

這是我的自定義單元代碼:更新發展觀在另一個的viewController

#import <UIKit/UIKit.h> 

@interface ShareCell : UITableViewCell 
@property (strong, nonatomic) IBOutlet UILabel *lblTitle; 
@property (strong, nonatomic) IBOutlet UIProgressView *progressView; 
@property (strong, nonatomic) IBOutlet UIButton *btnCancel; 

@end 

如何先進

+1

您應該使用協議委託進行單元格進度條更新。 – 2014-12-02 07:08:05

+0

我不能從自定義單元中的UIProgressview創建事件來委託 – apple8 2014-12-02 07:12:32

+0

視圖控制器從您想要更改進度view.call委託您的自定義單元格。 – 2014-12-02 07:14:29

回答

0
I made a Timer for updating progressView in Cell. you call your method when wants to Update.In viewDidLoad from you want to update progressView. 

NSTimer* myTimer = [NSTimer scheduledTimerWithTimeInterval: 10.0 target: self 
                selector: @selector(callAfterTenSecond:) userInfo: nil repeats: YES]; 
[myTimer fire]; 

That method Gets call.calling method of TableCell.with posting notification. 
-(void) callAfterTenSecond:(NSTimer*) t 
{ 
    [[NSNotificationCenter defaultCenter] postNotificationName:@"notificationName" object:_cell]; 
} 
while Creating Cell add observer. 
TableCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier forIndexPath:indexPath]; 
[cell addObserver]; 

In tableViewCell. 

-(void)addObserver 
{ 
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(somethingHappens:) name:@"notificationName" object:nil]; 

} 
That method gets call when you post notification. 
-(void) somethingHappens:(NSNotification*) notification 
{ 
    _progress.progress+=0.1; 
} 
2
調用update發展觀活動中自定義單元格在我看來controller.Thank

我想你需要下面的鏈接,並在cellforrowatindexpath方法中創建一個UIProgressView。 https://github.com/lightdesign/LDProgressView

+0

請提供一些代碼示例的更多信息。網址可能會中斷或被刪除。 – 2014-12-02 10:29:39

相關問題