0

ExercisesViewController.mにNSMutable配列関数があり、その配列をExercisesView.mに呼び出したい。

ExerciseViewController.m

- (NSMutableArray*)qBlock{

NSURL *url = [NSURL URLWithString:@"http://someaddress.php"];
NSError *error;
NSStringEncoding encoding;
NSString *response = [[NSString alloc] initWithContentsOfURL:url 
                                                usedEncoding:&encoding 
                                                       error:&error];
const char *convert = [response UTF8String];
NSString *responseString = [NSString stringWithUTF8String:convert];
NSMutableArray *sample = [responseString JSONValue];


return sample;}

ExercisesView.m:

 - (id) initWithParentViewController:(ExercisesViewController *)parent {
if ((self = [super init])) {
    // Update this to initialize the view with your own frame size
    [self setFrame:CGRectMake(0, 0, 320, 460)];
    refParentViewController = parent;
    NSMutableArray *qnBlock = [refParentViewController:qBlock];}

ただし、参照のリンクにエラーがあるようです。構文の問題を感じているだけです。ポインタはありますか?

4

1 に答える 1

2

単なる構文エラーです。これを試して:

NSMutableArray *qnBlock = [refParentViewController qBlock];
于 2012-04-26T15:01:40.897 に答える