Skip to content

Commit

Permalink
Remove non needed ivars and properties in iPhone MasterVC
Browse files Browse the repository at this point in the history
ViewControllers are generated fresh each time, there is no need to keep them as ivar or property. RemoteController does not need to expose resetRemote anymore.
  • Loading branch information
wutschel committed Jan 13, 2025
1 parent 46ad4f5 commit 9e2723f
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 36 deletions.
18 changes: 0 additions & 18 deletions XBMC Remote/MasterViewController.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,33 +12,15 @@
#import "CustomNavigationController.h"
#import "MessagesView.h"

@class DetailViewController;
@class NowPlaying;
@class RemoteController;
@class HostManagementViewController;
@class AppInfoViewController;
@class HostManagementViewController;

@interface MasterViewController : UIViewController <UITableViewDataSource, UITableViewDelegate> {
IBOutlet UITableView *menuList;
UIButton *xbmcInfo;
UIButton *xbmcLogo;
UIButton *powerButton;
NSDictionary *checkServerParams;
NSIndexPath *storeServerSelection;
AppInfoViewController *appInfoView;
HostManagementViewController *hostManagementViewController;
BOOL itemIsActive;
CustomNavigationController *navController;
UIImageView *globalConnectionStatus;
MessagesView *messagesView;
}

@property (nonatomic, strong) NSMutableArray *mainMenu;
@property (strong, nonatomic) DetailViewController *detailViewController;
@property (strong, nonatomic) NowPlaying *nowPlaying;
@property (strong, nonatomic) RemoteController *remoteController;
@property (strong, nonatomic) HostManagementViewController *hostController;
@property (strong, nonatomic) tcpJSONRPC *tcpJSONRPCconnection;

@end
38 changes: 21 additions & 17 deletions XBMC Remote/MasterViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,6 @@ @interface MasterViewController () {

@implementation MasterViewController

@synthesize detailViewController = _detailViewController;
@synthesize nowPlaying = _nowPlaying;
@synthesize remoteController = _remoteController;
@synthesize hostController = _hostController;
@synthesize mainMenu;
@synthesize tcpJSONRPCconnection;

Expand Down Expand Up @@ -153,27 +149,36 @@ - (void)tableView:(UITableView*)tableView didSelectRowAtIndexPath:(NSIndexPath*)
BOOL hideBottonLine = NO;
switch (item.family) {
case FamilyNowPlaying:
self.nowPlaying = [[NowPlaying alloc] initWithNibName:@"NowPlaying" bundle:nil];
self.nowPlaying.detailItem = item;
object = self.nowPlaying;
{
NowPlaying *nowPlayingController = [[NowPlaying alloc] initWithNibName:@"NowPlaying" bundle:nil];
nowPlayingController.detailItem = item;
object = nowPlayingController;
break;
}
case FamilyRemote:
[self.remoteController resetRemote];
self.remoteController = [[RemoteController alloc] initWithNibName:@"RemoteController" withEmbedded:NO bundle:nil];
self.remoteController.detailItem = item;
object = self.remoteController;
{
RemoteController *remoteController = [[RemoteController alloc] initWithNibName:@"RemoteController" withEmbedded:NO bundle:nil];
remoteController.detailItem = item;
object = remoteController;
break;
}
case FamilyServer:
self.hostController = [[HostManagementViewController alloc] initWithNibName:@"HostManagementViewController" bundle:nil];
object = self.hostController;
{
HostManagementViewController *hostController = [[HostManagementViewController alloc] initWithNibName:@"HostManagementViewController" bundle:nil];
object = hostController;
hideBottonLine = YES;
break;
}
case FamilyDetailView:
self.detailViewController = [[DetailViewController alloc] initWithNibName:@"DetailViewController" bundle:nil];
self.detailViewController.detailItem = item;
object = self.detailViewController;
{
DetailViewController *detailViewController = [[DetailViewController alloc] initWithNibName:@"DetailViewController" bundle:nil];
detailViewController.detailItem = item;
object = detailViewController;
hideBottonLine = YES;
break;
}
default:
break;
}
navController = [[CustomNavigationController alloc] initWithRootViewController:object];
navController.navigationBar.barStyle = UIBarStyleBlack;
Expand Down Expand Up @@ -341,7 +346,6 @@ - (void)viewDidLoad {
XBMCVirtualKeyboard *virtualKeyboard = [[XBMCVirtualKeyboard alloc] initWithFrame:CGRectMake(0, 0, 1, 1)];
[self.view addSubview:virtualKeyboard];
AppDelegate.instance.obj = [GlobalData getInstance];
checkServerParams = @{@"properties": @[@"version", @"volume"]};
menuList.scrollsToTop = NO;

// Add connection status icon to root view
Expand Down
1 change: 0 additions & 1 deletion XBMC Remote/RemoteController.h
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,6 @@ typedef NS_ENUM(NSInteger, RemotePositionType) {

- (IBAction)startVibrate:(id)sender;
- (void)setEmbeddedView;
- (void)resetRemote;
- (id)initWithNibName:(NSString*)nibNameOrNil withEmbedded:(BOOL)withEmbedded bundle:(NSBundle*)nibBundleOrNil;
@property (strong, nonatomic) id detailItem;
@property (nonatomic, strong) NSTimer *holdKeyTimer;
Expand Down

0 comments on commit 9e2723f

Please sign in to comment.