ios - Pass Date Picker date back to View Controller to show Date in label -
I've searched a lot of questions on how to do this, and I'm just coming.
I have ViewControllerA and ViewControllerB.
ViewControllerB
UIDatePicker
back for ViewControllerA
.
I'm fine until trying to put that code> NSDate Can you help? ! Thank you ViewControllerA TableViewCell it's related.
- (zero) addItemViewController: (EXEDurationPickerViewController *) Controller didFinishEnteringItem: (NSString *) Item {NSLog (@ "Back to ViewControllerB% @ ", item); }
Item
is the date selected from ViewControllerB How do I get to show it as a label in this table view?
Use representative
to send date or other Option Notification
View this to ViewControllerA
@interface Viewer: UIViewController {NSIndexPath * selectedIndexPath; } @end - (zero) viewDidLoad {[[NSNotificationCenter defaultCenter] addObserver: self selector: @selector (receiveNotification :) name: @ "dateSend" object: zero]; } - (zero) Receipt: (NSOtification *) Notification {NSSTING * item = notification.User Infos [@ "date"]; // show what cell you want to put selectedInexexPath as the example variable show yourCell * cell = (YourCell *) [self.tableView cellForRowAtIndexPath: selectedIndexPath]; Cell.label.text = Items; } - (Zero) TableView: (UITableView *) Tableview was SelectionRowAtIndexPath: (NSIndexPath *) indexPath {selectedIndexPath = indexPath; } // Post Notification Around ViewControllerB - (Zero) addItemViewController: (EXEDurationPickerViewController *) controller didFinishEnteringItem: (NSString *) Item {NSLog (@ "This ViewControllerB% @ Returned", item); [[NSNotificationCenter defaultCenter] postNotificationName: @ "Test Notification" Item: Null User Info: @ {@ "Date": Item}]; }
Comments
Post a Comment