我不知道这是否可能,但我认为这是可能的,我不知道该怎么做。我只是想从 parse.com 加载图像,就像从 parse.com 检索对象一样。我应该像从 parse.com 获取字符串一样吗?我刚刚找到了如何在解析时保存图像,但没有找到如何获取它们。如果有人可以向我展示执行此操作的链接或示例代码,我会很高兴。
我已经设置了一个从解析中检索到的字符串:
PFQuery *query = [PFQuery queryWithClassName:@"app"];
[query getObjectInBackgroundWithId:@"ID"
block:^(PFObject *textdu, NSError *error) {
if (!error) {
UIFont *welcomeLabelFont = [UIFont boldSystemFontOfSize:17];
welcomeLabel.text = [textdu objectForKey:@"ueberschriftnews"];
welcomeLabel.font = welcomeLabelFont;
welcomeLabel.textColor = [UIColor whiteColor];
welcomeLabel.textAlignment = NSTextAlignmentCenter;
welcomeLabel.backgroundColor = [UIColor clearColor];
welcomeLabel.shadowColor = [UIColor blackColor];
welcomeLabel.shadowOffset = CGSizeMake(0, 1);
[contentView addSubview:welcomeLabel];
// The get request succeeded. Log the score
NSString *text = [textdu objectForKey:@"newstext"];
UIFont *font = nil;
CGFloat points = 17;
CGFloat maxHeight = infoLabel.frame.size.height;
CGFloat textHeight;
do {
font = [UIFont systemFontOfSize:points];
CGSize size = CGSizeMake(infoLabelRect.size.width, 100000);
CGSize textSize = [text sizeWithFont:font constrainedToSize:size lineBreakMode: NSLineBreakByWordWrapping];
textHeight = textSize.height;
points -= 1;
} while (textHeight > maxHeight);
infoLabel.text = text;
infoLabel.numberOfLines = 9;
infoLabel.font = font;
infoLabel.textColor = [UIColor whiteColor];
infoLabel.textAlignment = NSTextAlignmentCenter;
infoLabel.backgroundColor = [UIColor clearColor];
infoLabel.shadowColor = [UIColor blackColor];
infoLabel.shadowOffset = CGSizeMake(0, 1);
[infoLabel sizeToFit];
[contentView addSubview:infoLabel];
} else {
infoLabel.text = @"something";
[infoLabel sizeToFit];
[contentView addSubview:infoLabel];
}
}];
我的解析设置:
谢谢。