0

Bool でエラーが発生し、モーダル ビューを追加する前に、bool が未定義であると表示されます。モーダルビューに別のペン先を使用している場合を除き、それがなぜなのかわかりません。

今すぐ電話するか、恩恵を変更する必要がありますか? お知らせ下さい。

    //
//  UrbanAgentViewController.m
//  UrbanAgent
//
//  Created by Dwayne Stephens on 4/2/12.
//  Copyright 2012 __MyCompanyName__. All rights reserved.
//

#import "UrbanAgentViewController.h"
#import "NewContactController.h"

@implementation UrbanAgentViewController

// our own buttonTapped method
-(IBAction) buttonTapped: (id) sender {
    NewContactController *ivc = [[NewContactController alloc] init];
    ivc.delegate = self;

    UINavigationController *nc = [[UINavigationController alloc]
                                  initWithRootViewController:ivc];

    [self presentModalViewController:nc animated:YES];

    [ivc release];
    [nc release];

}

-(void) doneButtonPressed: (NSArray *) values
{
    [self dismissModalViewControllerAnimated:YES];

    NSString *message =
    [[NSString alloc]
     initWithFormat:@"The values were %@, %@, %@, %@, %@, and %@",
     [values objectAtIndex:0], [values objectAtIndex:1], [values objectAtIndex:2],
     [values objectAtIndex:3], [values objectAtIndex:4], [values objectAtIndex:5]];

    UIAlertView *alert =
    [[UIAlertView alloc] initWithTitle:@"Values Passed" 
                               message:message delegate:nil
                     cancelButtonTitle:@"Excellent!" otherButtonTitles:nil ];

    [alert show];
    [alert release];
    [message release];


/*
// The designated initializer. Override to perform setup that is required before the view is loaded.
- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil {
    self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];
    if (self) {
        // Custom initialization
    }
    return self;
}
*/

/*
// Implement loadView to create a view hierarchy programmatically, without using a nib.
- (void)loadView {
}
*/


/*
// Implement viewDidLoad to do additional setup after loading the view, typically from a nib.
- (void)viewDidLoad {
    [super viewDidLoad];
}
*/


// Override to allow orientations other than the default portrait orientation.
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation {
    return YES;
}

- (void)didReceiveMemoryWarning {
    // Releases the view if it doesn't have a superview.
    [super didReceiveMemoryWarning];

    // Release any cached data, images, etc that aren't in use.
}

- (void)viewDidUnload {
    // Release any retained subviews of the main view.
    // e.g. self.myOutlet = nil;
}


- (void)dealloc {
    [super dealloc];
}

@end
4

1 に答える 1

3

に閉じ中括弧が必要ですdoneButtonPressed:

于 2012-04-09T22:22:19.980 に答える