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 NSDate UIDatePicker back for ViewControllerA .

I'm fine until trying to put that code> NSDate TableViewCell it's related.

Can you help? ! Thank you

ViewControllerA

  - (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

Popular posts from this blog

java - org.apache.http.ProtocolException: Target host is not specified -

java - Gradle dependencies: compile project by relative path -

ruby on rails - Object doesn't support #inspect when used with .include -