【发布时间】:2014-07-29 15:26:48
【问题描述】:
我希望能够直接从 Parse 向特定用户发送不同的照片。解决此问题的最佳方法是什么?
我已经完全设置了用户登录和注册。我还有一个 UIViewController 归档为“Concepts”,一个 PFImageView 归档为“Progress”。
类名是“UserPhoto” 我有一个名为“imageFile”的文件列和一个名为“user”的指针<_user> 列。我将在“Image.jpg”下存储“imageFile”名称
我觉得我在任何类型的进步中都偏离了轨道,所以任何帮助都将不胜感激。截至目前,经过两周的研究来实现这一目标,我还没有找到适合我的解决方案。
ViewController.h
#import <UIKit/UIKit.h>
#import <Parse/Parse.h>
#import "Progress.h"
@interface Concepts : UIViewController
@property (weak, nonatomic) IBOutlet Progress *image1;
@end
ViewController.m
#import "Concepts.h"
#import <UIKit/UIKit.h>
#import <Parse/Parse.h>
#import "Progress.h"
@interface Concepts ()
@end
@implementation Concepts
@synthesize image1;
- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil
{
self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];
if (self) {
// Custom initialization
}
return self;
}
- (void)viewDidLoad
{
[super viewDidLoad];
// Do any additional setup after loading the view.
PFQuery *query = [PFQuery queryWithClassName:@"UserPhoto"];
[query getFirstObjectInBackgroundWithBlock:^(PFObject *object, NSError *error) {
NSLog(@"Retrieved data");
if (!error) {
PFFile *image1 = [object objectForKey:@"imageFile"];
}
}];
}
PFImageView.h
#import "Progress.h"
#import <UIKit/UIKit.h>
#import <Parse/Parse.h>
#import "Concepts.h"
@interface Progress : PFImageView
@end
PFImageView.m
#import "Progress.h"
#import <UIKit/UIKit.h>
#import <Parse/Parse.h>
#import "Concepts.h"
@implementation Progress
- (id)initWithFrame:(CGRect)frame
{
self = [super initWithFrame:frame];
if (self) {
// Initialization code
}
return self;
}
【问题讨论】:
标签: ios objective-c image file parse-platform