2012-04-26 17 views
0

私はExercisesViewController.mにNSMutable配列関数を持っていて、その配列をExercisesView.mに呼び出す必要があります。ビューからViewControllerの配列への参照でエラーが発生しました

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];} 

しかし、参照をリンクにおけるいくつかの誤りがあるように思われます。私は文法の問題を感じています。すべてのポインタ?

答えて

2

これは単なる構文エラーです。

NSMutableArray *qnBlock = [refParentViewController qBlock]; 
+0

私がしたが、エラーが返さ:インスタンスメソッド「-qBlock」(「ID」に戻り値の型のデフォルト)が見つかりませんまた、あなたの 'ExerciseViewController.hであなたのメソッドの宣言を持っている –

+0

チェックこれを試してみてください'ファイル。 – Alladinian

関連する問題