0

ここに私が現在使用しているコードがありますが、まだあらゆる種類のエラーが発生しています:

No visible @interface for 'HomeViewController' declares the selector 'getCount' 

/Volumes/Lex/HomeViewController.h:12:12: Required for direct or indirect protocol 'UIPickerViewDataSource'
/Volumes/Lexar/HomeViewController.m:15:17: Incomplete implementation

私のコード (.m ファイル)

- (void)viewDidLoad
{
    [super viewDidLoad];

    PFUser *currentUser = [PFUser currentUser];
    if (currentUser) {
        NSLog(@"Current user: %@" , currentUser.username);
    }
    else {
        [self performSegueWithIdentifier:@"showLogin" sender:self];

        self.pickerView.dataSource = self;
        self.pickerView.delegate = self;
    }
}

- (NSInteger)pickerView:(UIPickerView *)pickerView numberOfRowsInComponent:  (NSInteger)component
{
    if ([self getCount] == 0)
        return 1;
    return [self getCount];
}

- (UIView *)pickerView:(UIPickerView *)pickerView viewForRow:(NSInteger)row forComponent:     (NSInteger)component reusingView:(UIView *)view {
    if ([self getCount] == 0)
        return nil;
}

- (IBAction)logout:(id)sender {
    [PFUser logOut];
    [self performSegueWithIdentifier:@"showLogin" sender:self];
}
@end

そして、ヘッダー

/// .h controller

#import <UIKit/UIKit.h>
#import <Parse/Parse.h>

@interface HomeViewController : UIViewController <UIPickerViewDataSource,    UIPickerViewDelegate>

@property (strong, nonatomic) IBOutlet UIPickerView *pickerView;

- (IBAction)logout:(id)sender;

@end
4

1 に答える 1