Question

The .h file:

@interface WibraryViewController : UIViewController <UIAlertViewDelegate> {    
    IBOutlet UIActivityIndicatorView *activityIndicatorView;
}
+ (void) notifyServerOfFileOpening:(NSString *) docName;

The .m method:

+ (void) notifyServerOfFileOpening:(NSString *) docName
{
    NSLog(@"doc opened name = %@", docName);
}

The line in another class that generates the 'No known class method for selector' error:

[WibraryViewController notifyServerOfFileOpening];

I'm guessing this might have something to do with the fact that UIAlertViewDelegate delegate is being used but I haven't really grasped how delegates work yet. Of course, it could also be something entirely different.

I was hoping someone could point out the problem? Thanks.

Was it helpful?

Solution

You forgot to pass the "docName" parameter. You are calling

[WibraryViewController notifyServerOfFileOpening];

instead of

[WibraryViewController notifyServerOfFileOpening:@"YourDocName"];

Hope that helps ;)

OTHER TIPS

you should add a parameter docName:

[WibraryViewController notifyServerOfFileOpening:yourDocName];

the selector you use currently is notifyServerOfFileOpening, but the selector you have to use is like notifyServerOfFileOpening:.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top