L'échec dans l'attribution de l'auto.délégué à produire non reconnu sélecteur envoyé

Je suis un nouveau dans iOS, et j'ai des difficultés dans la mise en œuvre @protocole donc désolé si vous pensez que c'est une chose facile..

j'ai été la recherche autour stackoverflow.com, les sites web, et aussi essayer oncle Google pour un certain temps et j'ai décidé de demander ici...

L'idée principale est d'appeler un MyViewController de TopViewController et ne flip animation
Je commence avec la création de protocoles..

    //This is my Delegate header
    //MyViewController.h

    @protocol MyViewControllerlDelegate

    - (void) myViewControllerDidFinish;

    @end

    @interface MyViewController : UIViewController 
    {
     id <MyViewControllerlDelegate> delegate;
    }

    @property (nonatomic, assign) id <MyViewControllerlDelegate> delegate;

    - (IBAction) done;

    @end

et ci-dessous sur la mise en œuvre :

    //MyViewController.m

    #import "MyViewController.h"

    @implementation MyViewController

    @synthesize delegate;

    //Another Code above

    - (IBAction)done 
    {
     [self.delegate myViewControllerDidFinish];
    }

    //Another Code Below

    @end

J'utilise au-dessus de l'objet à être appelé à partir d'un autre point de vue ci-dessous et ajouter flip transition :

//TopViewController.h

#import "MyViewController.h"

@class MapScrollView;

@interface TopViewController : UIViewController <UIScrollViewDelegate,MyViewControllerlDelegate> 
{
    UIScrollView *topScrollView;
    UIButton *infoButton;
}

@end

TopViewController.h la mise en Œuvre
//TopViewController.m

#import "TopViewController.h"
#import "CustomScrollView.h"
#import <QuartzCore/QuartzCore.h>

- (void)loadView 
{    
    //Step 1: make the outer paging scroll view
    CGRect topScrollViewRect = [[UIScreen mainScreen] bounds];
    topScrollView = [[UIScrollView alloc] initWithFrame:topScrollViewRect];
    topScrollView.pagingEnabled = YES;
    topScrollView.backgroundColor = [UIColor blackColor];
    topScrollView.showsVerticalScrollIndicator = NO;
    topScrollView.showsHorizontalScrollIndicator = NO;
    topScrollView.contentSize = CGSizeMake(topScrollViewRecte.size.width,
                                              topScrollViewRecte.size.height);
    topScrollView.delegate = self;
    self.view = pagingScrollView;

    CustomScrollView *sView = [[[MapScrollView alloc] init] autorelease];

    sView.frame = [[UIScreen mainScreen] bounds];

    [sView displayTiledMap];

    [pagingScrollView addSubview:sView];

    //add Info Button
    UIButton *button = [UIButton buttonWithType:UIButtonTypeInfoDark];
    [button addTarget:self action:@selector(infoIsTouch:)   forControlEvents:UIControlEventTouchDown];
    button.frame = CGRectMake(282.0, 440.0, 18.0, 19.0);
    [self.view addSubview:button];
}

-(void)infoIsTouch:(id)sender
{
 MyViewController *myView = 
 [[MyViewController alloc] initWithNibName:@"MyViewController" bundle:[NSBundle mainBundle]];
 myView.modalTransitionStyle = UIModalTransitionStyleFlipHorizontal;
        //
        //Here where the code is crash 
        //
 [myView setDelegate:self];
        //
        //Code from here to below is not run...
        //
 [self presentModalViewController:myView animated:YES];
 [myView release];
}

- (void) myViewControllerDidFinish
{
 [self dismissModalViewControllerAnimated:YES];
}

etc... 

@end

Ci-dessous le code de produire de l'erreur de compilation suivant..

2010-12-06 01:09:07.946 MyViewDelegatePractice[9473:207] -[TopViewController setDelegate:]: unrecognized selector sent to instance 0x5f30fb0
2010-12-06 01:09:07.949 MyViewDelegatePractice[9473:207] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[TopViewController setDelegate:]: unrecognized selector sent to instance 0x5f30fb0'
*** Call stack at first throw:
(
    //Cuts... 
)
terminate called after throwing an instance of 'NSException'

Celles erreur est générée lorsque j'appuie sur infoButton qui appelez -(void)infoIsTouch:(id)sender méthode, puis s'arrêter à [mavue setDelegate:auto] ligne.. quelqu'un pourrait-il me donner un indice où sont mes erreurs ?

REMARQUE : Si vous dégoût avec mon anglais.. n'hésitez pas à commenter buter aussi.. mais avant que ... je suis désolé j'ai essayer de mon mieux..

MyViewControllerlDelegate et FanglesMapSettingViewControllerDelegate, dont l'un est-il censé mettre en œuvre? Je suis confus.
merci sam, c'est ma faute de frappe.. j'ai oublié de changer les variables.. désolé combat..
j'ai changer FanglesMapSettingViewControllerDelegate à MyViewControllerlDelegate mais encore produire même erreur..

OriginalL'auteur FerryHtw | 2010-12-05