What I want to do is pretty simple but I don't understand what I am doing wrong. I have button that upon clicked, will go to another page. The method that loads a different page is in different class and upon initializing it where I want to use it, I can't see none of the methods belonging to the class.
Here is what I have
//HomeViewController.h
#import <UIKit/UIKit.h>
#import "PhotoView.h"
#import <CoreLocation/CoreLocation.h>
#import "Reachability.h"
#import "BottomTableViewController.h"
@protocol HomeViewControllerDelegate <NSObject>
@optional
- (void)moveToShowBottomTableView;
- (void)moveToHideBottomTableView;
- (void)sendDescriptionToBottomTableView;
@end
@interface HomeViewController : UIViewController<UIScrollViewDelegate, BottomTableViewControllerDelegate>{
IBOutlet UIScrollView *gridView;
CLLocationManager *locationManager;
CLLocationCoordinate2D userCoordinate;
CLLocation *initialCoordinate;
Reachability *internetReachable;
Reachability *hostReachable;
}
@property (assign, nonatomic) int fromMapView;
@property (retain, nonatomic) NSArray *clusteredPhotoIDs;
@property (strong, nonatomic) IBOutlet UILabel *schoolTitle;
@property (strong, nonatomic) IBOutlet UIButton *showDetailsButton;
@property (assign, nonatomic) id<HomeViewControllerDelegate> delegate;
@property (strong, nonatomic) IBOutlet UILabel *bottomTableViewTitle;
- (IBAction)refreshButton:(id)sender;
- (IBAction)next:(id)sender;
- (IBAction)prev:(id)sender;
@property (retain, nonatomic) NSString *subviewDescription;
@property (retain, nonatomic) NSString *subviewCopyright;
@property (retain, nonatomic) NSString *subviewAddress;
@property (retain, nonatomic) NSString *photoIDNumber;
@end
BottomPanelViewController.m
#import "HomeViewController.h"
-(IBAction)nextPage:(id)sender{
HomeViewController *homeScreen = [[HomeViewController alloc] init];
// [homeScreen loadPage];//THIS DOESN'T WORK
}
HomeViewController.m
- (void)loadPage:(NSInteger)page {
// Do stuff
}
I get this error in the part marked as "Doesn't work": no visible @interface for HomeViewController declares the selector loadPage
Thanks for any help you can offer.
loadPageactually called but doesn't do what you want? Please update your question with relevant details.homeScreen)? If not, that is most likely your problem.