2013-11-20 23 views
0

從桌面控制器,我顯示模式視圖捕捉視頻剪輯... 取消(無剪輯鏡頭)圖像選擇器被解僱,並且tableview被重新顯示,但黑屏......似乎不再被填充......我錯過了什麼?表視圖數據不會顯示後解除模態視圖和沒有數據更改

// MySwingsViewController.h 
#import <UIKit/UIKit.h> 
#import "Swing.h" 
#import "SwingCell.h" 

#import <MediaPlayer/MediaPlayer.h> 
#import <MobileCoreServices/MobileCoreServices.h> 

@interface MySwingsViewController : UITableViewController <UITableViewDelegate, UITableViewDataSource, UIImagePickerControllerDelegate, UINavigationControllerDelegate > 

@property (nonatomic, strong) NSMutableArray *swings; 

@property (copy, nonatomic) NSURL *movieURL; 
@property (strong, nonatomic) MPMoviePlayerController *movieController; 

@property (strong, nonatomic) IBOutlet UIBarButtonItem *captureSwingbutton; 
- (IBAction)captureSwing:(id)sender; 

@end 

和MySwingsViewController.m

// MySwingsViewController.m 
#import "MySwingsViewController.h" 

@interface MySwingsViewController() 
@end 

@implementation MySwingsViewController 

{ 
    NSArray *tableData; //just for test purposes 
} 

- (void)viewDidLoad 
{ 
    NSLog(@"view did load"); 
    [super viewDidLoad]; 

    // Initialize table data 
    tableData = [NSArray arrayWithObjects:@"Egg Benedict", @"Mushroom Risotto", @"Full Breakfast", @"Hamburger", @"Ham and Egg Sandwich", @"Creme Brelee", @"White Chocolate Donut", @"Starbucks Coffee", @"Vegetable Curry", @"Instant Noodle with Egg", @"Noodle with BBQ Pork", @"Japanese Noodle with Pork", @"Green Tea", @"Thai Shrimp Cake", @"Angry Birds Cake", @"Ham and Cheese Panini", nil]; 
} 

- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView 
{ 
    return 1; 
} 
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section 
{ 
    return [tableData count]; 
} 

- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath 
{ 
static NSString *CellIdentifier = @"SwingCell"; 
SwingCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier forIndexPath:indexPath]; 
if (cell == nil) { 
     cell = [[SwingCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellIdentifier]; 
    } 
cell.titleLabel.text = [tableData objectAtIndex:indexPath.row]; 
return cell; 
} 

- (IBAction)captureSwing:(id)sender { 
UIImagePickerController *picker = [[UIImagePickerController alloc] init]; 
picker.delegate = self; 
picker.allowsEditing = NO; 
picker.sourceType = UIImagePickerControllerSourceTypeCamera; 
    ... // capture new clip 
    } 
... 
- (void)imagePickerControllerDidCancel:(UIImagePickerController *)picker { 
    NSLog(@"picker did cancel"); 
    [picker dismissViewControllerAnimated:YES completion:NULL]; 
    [self.navigationController popViewControllerAnimated:YES]; 
} 

取消登錄,選擇器被駁回,回tableview中,但數據不被重新顯示...

回答

0

不要叫[自我。 navigationController popViewControllerAnimated:YES];這段代碼實際上忽略了當前的MySwingsViewController,我相信你的表視圖在MySwingsViewController上?

+0

是的,它是,刪除它,但沒有解決問題,表視圖顯示任何數據 – erwin