Note that there are some explanatory texts on larger screens.

plurals
  1. POCan't get the description from model to override and show
    primarykey
    data
    text
    <p>I have this working in another app just fine, exact same code and everything is linked in storyboard? I have no Idea what is going on. It seems as the assignmentInfo.className string is kept to nul. and the description method is also nul. Take a look:</p> <p>AddEditViewController.h - </p> <pre><code>{ IBOutlet UIDatePicker *dateTimePicker; } @property (nonatomic, strong) IBOutlet UITextField *className; @property (nonatomic, strong) IBOutlet UITextField *assignmentTitle; @property (nonatomic, strong) IBOutlet UITextField *assignmentDescription; @property (nonatomic, strong) IBOutlet UISwitch *procrastinationNotificationSwitch; @property (nonatomic,strong)AssignmentInfo *assignmentInfo; - (IBAction)addTheInfo:(id)sender; </code></pre> <p>AddEditViewController.m - </p> <pre><code>{ if (!_assignmentInfo) { _assignmentInfo = [[AssignmentInfo alloc]init]; } return _assignmentInfo; } - (IBAction)addTheInfo:(id)sender { NSDateFormatter *dateFormatter = [[NSDateFormatter alloc]init]; dateFormatter.timeZone = [NSTimeZone defaultTimeZone]; dateFormatter.timeStyle = NSDateFormatterShortStyle; dateFormatter.dateStyle = NSDateFormatterShortStyle; NSString *dateTimeString = [dateFormatter stringFromDate: dateTimePicker.date]; self.assignmentInfo.className = self.className.text; self.assignmentInfo.assignmentTitle = self.assignmentTitle.text; self.assignmentInfo.assignmentDescription = self.assignmentDescription.text; self.assignmentInfo.dateTimeString = dateTimeString; NSLog(@"%@",self.assignmentInfo.className); NSLog(@"%@",self.assignmentInfo.description); [self presentMessage:self.assignmentInfo.description]; } </code></pre> <p>AssignmentInfo.h - </p> <pre><code>@property (nonatomic,strong)NSString *className; @property (nonatomic,strong)NSString *assignmentDescription; @property (nonatomic,strong)NSString *assignmentTitle; @property (nonatomic,strong)NSString *dateTimeString; @property (nonatomic)bool notifcationStatus; </code></pre> <p>AssignmentInfo.m - </p> <pre><code>-(NSString *)description { return [NSString stringWithFormat:@"Class: %@\r Assignment Title: %@ \rAssignment Description: %@ \rDue: %@ \r%s", self.className, self.assignmentTitle, self.assignmentDescription, self.dateTimeString,self.notifcationStatus ? "Notification On" : "Notification Off"]; } </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload