JewelsSharedController

JewelsSharedController

JewelsSharedController.m:

-(void)GetCountries:(id)sender detailDictionary:(id)details
{
}


我想在RootViewController的函数中调用此函数,例如
RootController.m:

-(void)soapresult
{
    //i want to call ""GetContries "" here..
}


我称这个"soapresult"

-(void)viewdidLoad
{
    [self soapresult];
}


但是当调用函数时会崩溃

最佳答案

JewelsSharedController.h:

//...
-(void)GetCountries:(id)sender detailDictionary:(id)details;
//...


RootController.m:

#import "JewelsSharedController.h"

//...

-(void)soapresult
{
    JewelsSharedController * jewelsSharedController = [[JewelsSharedController alloc] init];
    [jewelsSharedController GetCountries:yourSender detailDictionary:yourDetails];
    [jewelsSharedController release];
}

07-26 09:43