Ios 如何将解析查询发送到另一个ViewController
我试图将查询salesArray=[[NSMutableArray alloc]initWithArray:objects]发送到EditData,我一辈子都搞不清楚。我正在尝试填充选择器视图..我使用[parseConnection parseProduct]执行查询,但无法将数组转移到EditData.mIos 如何将解析查询发送到另一个ViewController,ios,parse-platform,Ios,Parse Platform,我试图将查询salesArray=[[NSMutableArray alloc]initWithArray:objects]发送到EditData,我一辈子都搞不清楚。我正在尝试填充选择器视图..我使用[parseConnection parseProduct]执行查询,但无法将数组转移到EditData.m #import "EditData.h" @interface EditData () { NSMutableArray *salesArray, *callbackArray,
#import "EditData.h"
@interface EditData ()
{
NSMutableArray *salesArray, *callbackArray, *contractorArray, *rateArray;
}
@property (nonatomic, weak) UIStepper *defaultStepper;
@end
@implementation EditData
@synthesize custNo, leadNo, active, date, first, last, company, address, city, state, zip, phone, aptDate, email, amount, spouse, callback, saleNo, jobNo, adNo, photo, comment, rate, start, complete;
- (void)viewDidLoad {
[super viewDidLoad];
self.edgesForExtendedLayout = UIRectEdgeNone; //fix
self.listTableView.dataSource = self;
self.listTableView.delegate = self;
self.listTableView.rowHeight = UITableViewAutomaticDimension;
self.listTableView.estimatedRowHeight = ROW_HEIGHT;
self.listTableView.contentInset = UIEdgeInsetsMake(10, 0, 0, 0);
// self.listTableView.tableHeaderView = view; //makes header move with tablecell
ParseConnection *parseConnection = [[ParseConnection alloc]init];
[parseConnection parseProduct];
NSLog(@"adStr is %@",self.adName.text);
}
解析连接.h
#import <Foundation/Foundation.h>
#import <Parse/Parse.h>
#import "Constants.h"
//#import "EditData.h"
@protocol ParseConnectionDelegate <NSObject>
@end
@interface ParseConnection : NSObject //<PFSubclassing>
{
NSMutableArray *salesArray, *callbackArray, *contractorArray, *rateArray, *zipArray, *jobArray;
}
- (void)parseSalesman;
@property (strong, nonatomic) id<ParseConnectionDelegate> delegate; //added
@property (strong, nonatomic) UITextField *salesName;
EditData.m
#import "EditData.h"
@interface EditData ()
{
NSMutableArray *salesArray, *callbackArray, *contractorArray, *rateArray;
}
@property (nonatomic, weak) UIStepper *defaultStepper;
@end
@implementation EditData
@synthesize custNo, leadNo, active, date, first, last, company, address, city, state, zip, phone, aptDate, email, amount, spouse, callback, saleNo, jobNo, adNo, photo, comment, rate, start, complete;
- (void)viewDidLoad {
[super viewDidLoad];
self.edgesForExtendedLayout = UIRectEdgeNone; //fix
self.listTableView.dataSource = self;
self.listTableView.delegate = self;
self.listTableView.rowHeight = UITableViewAutomaticDimension;
self.listTableView.estimatedRowHeight = ROW_HEIGHT;
self.listTableView.contentInset = UIEdgeInsetsMake(10, 0, 0, 0);
// self.listTableView.tableHeaderView = view; //makes header move with tablecell
ParseConnection *parseConnection = [[ParseConnection alloc]init];
[parseConnection parseProduct];
NSLog(@"adStr is %@",self.adName.text);
}
不要在
ParseConnection
内部创建salesaray
,而是在EditData
内部传递一个。然后,在完成块中,向其添加对象,而不是初始化它
在将其作为参数传递给
parse…
方法之前,不要忘记在EditData
中初始化salesaray
。您能给出一个新的例子吗