Sono uno sviluppatore Android esperto che cerca di ottenere un prototipo di app iOS in esecuzione utilizzando il servizio Parse e sdk (https://www.parse.com/).Impossibile recuperare valori aggiornatiAt o creatiAt dagli oggetti Parse
È fantastico, e posso ottenere senza problemi tutti i miei oggetti e i loro valori, tutto funziona perfettamente.
Tuttavia, non riesco a ottenere il valore UpdateAt creato automaticamente da Parse per ciascun oggetto.
È un must per me e non voglio dover salvare un timestamp adizionale come una stringa quando i dati sono seduti proprio lì.
Questo è l'essenza di ciò che stavo facendo.
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath object:(PFObject *)object {
static NSString *CellIdentifier = @"Cell";
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier];
if (cell == nil) {
cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleSubtitle reuseIdentifier:CellIdentifier];
}
// this works fine
cell.textLabel.text = [object objectForKey:@"name"];
//substring however does not
NSDate *updated = [object objectForKey:@"updatedAt"];
NSDateFormatter *dateFormat = [[NSDateFormatter alloc] init];
[dateFormat setDateFormat:@"EEE, MMM d, h:mm a"];
cell.detailTextLabel.text = [NSString stringWithFormat:@"Lasted Updated: %@", [dateFormat stringFromDate:update]];
//i also tried like this at first
cell.detailTextLabel.text = [NSString stringWithFormat:@"Lasted Updated: %@", [object objectForKey:@"updatedAt"]];
return cell;
}
Cosa si vede nella finestra del debugger se si esegue NSLog (@ "data% @", aggiornata); dopo NSDate * updated = [oggetto objectForKey: @ "updatedAt"]; – Yan
hai provato [object stringForKey: @ "updateAt"]? –