我是一位经验丰富的Android开发人员,试图使用Parse服务和sdk(https://www.parse.com/)运行原型iOS应用程序.
这很棒,我可以毫无困难地获得所有物品和价值,一切正常.
但是,我无法获得Parse为每个对象自动创建的updatedAt值.
对我来说这是必须的,当数据就在那里时,我不想将一个附加的时间戳保存为String.
这是我正在做的事情的要点.
- (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 …
Run Code Online (Sandbox Code Playgroud) 我之前使用过Parse SDK,但对于本机移动开发人员 - 包括Objective-C和Java.但是,我绝不是一个JavaScript开发人员.我正在尝试使用Node并使用Parse来存储一些用于API制作的东西.这可能是一个JavaScript无能,因为它是一个Parse问题.
应用背景
我每天都会做一个特定的twitter刮 - 一个TweetDay - 它基本上只是一个Parse行,带有一个Array值,这是一个TweetPairs数组.
TweetPair只是推文文本及其相关ID的配对.
{"id":"NCnjSDnjScn",
"text":"酷酷的约兰达,真酷!" }
//Look for a Day in the database against the day we supply
query.equalTo("createdAt", req.params.date );
query.find({
success: function(results) {
console.log("Successfully retrieved " + results.length + " item");
// assume there is only ever one result
var object = results[0];
console.log(object.id);
var tweetsPointer = object.get("Pairs");
//## IT'LL BLOW UP HERE ##
// tweetsPointer isn't a Parse object, so it doesn't know about .fetch
tweetsPointer.fetch({
success: …
Run Code Online (Sandbox Code Playgroud)