views:

37

answers:

2

here is my .h code

@interface ROSettingViewController : UITableViewController
{
    UISwitch                *switchCtl;
    UISwitch                *switchCtl1;
    NSArray                 *dataSourceArray;
}

@property (nonatomic, retain, readonly) UISwitch *switchCtl;
@property (nonatomic, retain, readonly) UISwitch *switchCtl1;
@property (nonatomic, retain) NSArray *dataSourceArray;

- (void)dialogOKCancelAction;
- (void)actionSheet:(UIActionSheet *)actionSheet clickedButtonAtIndex:(NSInteger)buttonIndex;

@end

/Users/ragopor/Desktop/Power Spot beta 2/code/Classes/ROSettingViewController.m:321: warning: class 'ROSettingViewController' does not implement the 'UIActionSheetDelegate' protocol
A: 

Have you tried declaring your controller's adherence to the UIActionSheetDelegate protocol?

@interface ROSettingViewController : UITableViewController<UIActionSheetDelegate>

warrenm
thanks warrenm it resolve , can you explan me about this warnning please?
RAGOpoR
The delegate protocol that you're using is a formal protocol, so you have to declare in your interface definition that you're implementing it. Apple's reference has a fair amount of detail on this subject: http://developer.apple.com/mac/library/documentation/cocoa/conceptual/ObjectiveC/Articles/ocProtocols.html#//apple_ref/doc/uid/TP30001163-CH15-SW1
warrenm
A: 

The chances are you're saying, on ROSettingViewController.m:321,

myActionSheet.delegate = self;

without having specified that your VC implements the UIActionSheetDelegate protocol

chrisbtoo
here is my code UIActionSheet *actionSheet = [[UIActionSheet alloc] initWithTitle:@"Do you want to set time interval?" delegate:self cancelButtonTitle:@"Cancel" destructiveButtonTitle:@"OK" otherButtonTitles:nil];
RAGOpoR
There you go.... delegate:selfYou're telling the actionsheet to use your VC as a delegate, but the definition of your VC doesn't say it implements the required delegate protocol (until Warren told you how to).
chrisbtoo

related questions