ios - How can I use NSNotificationCenter to call a method in a second class? -


i'm trying use nsnotificationcenter call method in second class i'm getting error:

second class method(request.m) :

-(void)gettherequest:(nsstring *)wheretocall; 

and i'm trying call nsnotificationcenter this:

request *newrequest=[[request alloc]init]; [self performselector:@selector(newrequest.gettherequest:) withobject:@"mysite"]; 

but i'm getting error in part "newrequest.gettherequest" says "expected expression". of know how can fix or how can use nsnotificationcenter call methods in different classes?

try this:

[newrequest performselector:@selector(gettherequest:) withobject:@"mysite"]; 

please note class names should start capital letter , getters should not use prefix apple's coding standards introduction coding guidelines cocoa


Comments

Popular posts from this blog

monitor web browser programmatically in Android? -

Shrink a YouTube video to responsive width -

wpf - PdfWriter.GetInstance throws System.NullReferenceException -