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];}
ただし、参照のリンクにエラーがあるようです。構文の問題を感じているだけです。ポインタはありますか?