Search Results

Search found 439 results on 18 pages for 'navigationcontroller'.

Page 7/18 | < Previous Page | 3 4 5 6 7 8 9 10 11 12 13 14  | Next Page >

  • Iphone App deve- Very basic table view but getting errors , trying for 2 days!! just for info using

    - by user342451
    Hi guys, trying to write this code since 2 days now, but i keep getting error, it would be nice if anyone could sort this out, thanks. Basically its the same thing i doing from the tutorial on youtube. awaiting a reply // // BooksTableViewController.m // Mybooks // // import "BooksTableViewController.h" import "BooksDetailViewController.h" import "MYbooksAppDelegate.h" @implementation BooksTableViewController @synthesize BooksArray; @synthesize BooksDetailViewController; /* - (id)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier { if ((self = [super initWithStyle:style reuseIdentifier:reuseIdentifier])) { // Initialization code } return self; } */ (void)viewDidLoad { [super viewDidLoad]; self.title = NSLocalizedString(@"XYZ",@"GOD is GREAT"); NSMutableArray *array = [[NSArray alloc] initWithObjects:@"H1",@"2",@"3",nil]; self.booksArray = array; [array release]; } /* // Override to allow orientations other than the default portrait orientation. - (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation { // Return YES for supported orientations return (interfaceOrientation == UIInterfaceOrientationPortrait); } */ (void)didReceiveMemoryWarning { [super didReceiveMemoryWarning]; // Releases the view if it doesn't have a superview // Release anything that's not essential, such as cached data } pragma mark Table view methods (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView { return 1; } // Customize the number of rows in the table view. - (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section { return [self.booksArray count]; } // Customize the appearance of table view cells. - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { static NSString *identity = @"Cell"; UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:identity]; if (cell == nil) { cell = [[[UITableViewCell alloc] initWithFrame:CGRectZero reuseIdentifier:identity] autorelease]; } // Set up the cell... cell.textLabel.text = [booksArray objectAtIndex:indexPath.row]; return cell; } /* - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath { booksDetailsViewControler *NC = [[booksDetailsViewControler alloc] initWithNibName:@"BooksDetailsView" bundle:nil]; [self.navigationController pushViewController:NC animated:YES]; //[booksDetailViewController changeProductText:[booksArray objectAtIndex:indexPath.row]]; } */ NSInteger row = [indexPath row]; if (self.booksDetailViewController == nil) { BooksiDetailViewController *aCellDetails = [[AartiDetailViewController alloc] initWithNibName:@" BooksDetailViewController" bundle:nil]; self.booksDetailViewController = aCellDetails; [aCellDetails release]; } booksDetailViewController.title = [NSString stringWithFormat:@"%@", [booksArray objectAtIndex:row]]; //DailyPoojaAppDelegate *delegate = [[UIApplication sharedApplication] delegate]; //[delegate.AartiNavController pushViewController:aartiDetailsViewControler animated:YES]; [self.navigationController pushViewController:aartiDetailViewController animated:YES]; } /* NSInteger row = [indexPath row]; if (self.booksDetailsViewControler == nil) { AartiDetailsViewControler *aBookDetail = [[BooksDetailsViewControler alloc] initWithNibName:@"booksDetaislView" bundle:nil]; self.booksDetailsViewControler = aBookDetail; [aBookDetail release]; } booksDetailsViewControler.title = [NSString stringWithFormat:@"%@", [booksArray objectAtIndex:row]]; [self.navigationController pushViewController:booksDetailsViewControler animated:YES]; */ (void)dealloc { [aartiDetailViewController release]; [super dealloc]; } @end

    Read the article

  • Very basic table view but getting errors

    - by user342451
    Hi guys, trying to write this code since 2 days now, but i keep getting error, it would be nice if anyone could sort this out, thanks. Basically its the same thing i doing from the tutorial on youtube. awaiting a reply // // BooksTableViewController.m // Mybooks // // #import "BooksTableViewController.h" #import "BooksDetailViewController.h" #import "MYbooksAppDelegate.h" @implementation BooksTableViewController @synthesize BooksArray; @synthesize BooksDetailViewController; /* - (id)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier { if ((self = [super initWithStyle:style reuseIdentifier:reuseIdentifier])) { // Initialization code } return self; } */ - (void)viewDidLoad { [super viewDidLoad]; self.title = NSLocalizedString(@"XYZ",@"GOD is GREAT"); NSMutableArray *array = [[NSArray alloc] initWithObjects:@"H1",@"2",@"3",nil]; self.booksArray = array; [array release]; } /* // Override to allow orientations other than the default portrait orientation. - (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation { // Return YES for supported orientations return (interfaceOrientation == UIInterfaceOrientationPortrait); } */ - (void)didReceiveMemoryWarning { [super didReceiveMemoryWarning]; // Releases the view if it doesn't have a superview // Release anything that's not essential, such as cached data } #pragma mark Table view methods - (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView { return 1; } // Customize the number of rows in the table view. - (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section { return [self.booksArray count]; } // Customize the appearance of table view cells. - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { static NSString *identity = @"Cell"; UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:identity]; if (cell == nil) { cell = [[[UITableViewCell alloc] initWithFrame:CGRectZero reuseIdentifier:identity] autorelease]; } // Set up the cell... cell.textLabel.text = [booksArray objectAtIndex:indexPath.row]; return cell; } /* - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath { booksDetailsViewControler *NC = [[booksDetailsViewControler alloc] initWithNibName:@"BooksDetailsView" bundle:nil]; [self.navigationController pushViewController:NC animated:YES]; //[booksDetailViewController changeProductText:[booksArray objectAtIndex:indexPath.row]]; } */ NSInteger row = [indexPath row]; if (self.booksDetailViewController == nil) { BooksiDetailViewController *aCellDetails = [[AartiDetailViewController alloc] initWithNibName:@" BooksDetailViewController" bundle:nil]; self.booksDetailViewController = aCellDetails; [aCellDetails release]; } booksDetailViewController.title = [NSString stringWithFormat:@"%@", [booksArray objectAtIndex:row]]; //DailyPoojaAppDelegate *delegate = [[UIApplication sharedApplication] delegate]; //[delegate.AartiNavController pushViewController:aartiDetailsViewControler animated:YES]; [self.navigationController pushViewController:aartiDetailViewController animated:YES]; } /* NSInteger row = [indexPath row]; if (self.booksDetailsViewControler == nil) { AartiDetailsViewControler *aBookDetail = [[BooksDetailsViewControler alloc] initWithNibName:@"booksDetaislView" bundle:nil]; self.booksDetailsViewControler = aBookDetail; [aBookDetail release]; } booksDetailsViewControler.title = [NSString stringWithFormat:@"%@", [booksArray objectAtIndex:row]]; [self.navigationController pushViewController:booksDetailsViewControler animated:YES]; */ - (void)dealloc { [aartiDetailViewController release]; [super dealloc]; } @end

    Read the article

  • Navigation Bar color doesn't change back? iOS7

    - by TKP
    I have several tableviews with navigation controller. The navigation bar is white for all the views except the last one, which is red. I have [[[self navigationController] navigationBar] setTintColor:[UIColor redColor]; in the viewDidLoad of the last tableview and [[[self navigationController] navigationBar] setTintColor:[UIColor whiteColor]; in the viewDidLoad of other table views. It works fine until I get to the last view and the color of the navigation bar changes to red. When I go back to the previous views, all the previous views' navigation bar has changed to red. Where should I put those codes so the color will remain unchanged? Thanks,

    Read the article

  • adding button to the navigation bar

    - by praseed
    hi friends, i have a problem while adding button to the navigation bar.. My application consist of two view controllers added to the viewControllers array of a tabBarController. Inturn this tabBarController is added to the viewControllers array of a navigationController. In one of the views i have a textfield for entering dates . On the tap of this textfield the datepicker will pop up. simultaneously i want to display a done button on the navigation bar. how can i do this... i tried using self.tabBarController.navigationController.navigationItem.rightBarButtonItem = self.doneButton; But this is not working... Pls help me out..

    Read the article

  • Iphone xCode - Navigation Controller on second xib view?

    - by Frames84
    Everything is fine, my navigation controller display's my 'Menu 1' item, but when i click it there appears to be a problem with the: [self.navigationController pushViewController:c animated:YES]; line it doesn't connect to the break point in the myClass file. so I think i've not joined something? but unsure what? my second view with the navigation controller doesn't have direct access to the AppDelegate so can't join it like i see in some tutorials. 1st view is just a button when clicked calls: [self presentModalViewController:mainViewController animated:YES]; my second View 'MainViewController' header looks like: @interface MainViewController :UITableViewController <UITableViewDelegate, UITableViewDataSource> { NSArray *controllers; UINavigationController *navController; } @property (nonatomic, retain) IBOutlet UINavigationController *navControllers; @property (nonatomic, retain) NSArray *controller; Then I have my MainViewController.m @synthesize controllers; @synthesize navController; - (void) viewDidLoad { NSMutableArray *array = [[NSMutaleArray alloc] init]; myClass *c = [[myClass alloc] initWithStyle:UITableViewStylePlain]; c.Title = @"Menu 1"; [array addObject:c]; self.Controllers = array; [array release]; } implemented numberOfRowsInSection and cellForRowAtIndexPath - (void) tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath { NSUInteger row = [indexPath row]; myClass *c = [self.controllers objectAtIndex:row]; [self.navigationController pushViewController:c animated:YES]; // doesn't load myClass c // [self.navController pushViewController:c animated:YES]; } Also in interface designer I dragged a Navigation Controller onto my new XIB and changed the Root View Controller class to MainViewController and also connected the File Owner connector to the Navigation Controller to connect the navController Outlet. Thanks for you time.

    Read the article

  • How to hide UIStatusBar and show UINavigationBar at the top when UIView changes to LandscapeOrientat

    - by KayKay
    I am using two views (portraitView and landscapeView) loaded from xib in a viewcontroller for different InterfaceOrientation each for Portrait and Landscape mode. The view in portrait mode has statusbar and navigationbar and other one has just the navigationbar. The problem is that even i made statusbar hidden programatically the view in Landscape mode has blank space left at the position of statusbar and below is navigationbar which is for sure looking embarrassing. Is it possible to put the navigationbar at the top - replacing the statusbar position. I tried many options like. if (interfaceOrientation == UIInterfaceOrientationLandscapeLeft || interfaceOrientation == UIInterfaceOrientationLandscapeRight) { [[UIApplication sharedApplication] setStatusBarHidden:YES animated:NO]; self.navigationController.navigationBarHidden = NO; [[self view] setFrame:CGRectMake(0, 0, 480, 320)]; self.navigationController.wantsFullScreenLayout = YES; self.view = self.landscapeView; } But despite all this efforts it only lefts the same 20x480 pixels blank space and below it navigationbar. But here there is no end to trouble when I switch back to portraitView, the navigation bar hides behind the statusbar mere showing remaining 320x(44-20)px on top. Please help and thanks in advance.

    Read the article

  • Tab bar controller inside a navigation controller, or sharing a navigation root view

    - by Daniel Dickison
    I'm trying to implement a UI structured like in the Tweetie app, which behaves as so: the top-level view controller seems to be a navigation controller, whose root view is an "Accounts" table view. If you click on any account, it goes to the second level, which has a tab bar across the bottom. Each tab item shows a different list and lets you drill down further (the subsequent levels don't show the tab bar). So, this seems like the implementation hierarchy is: UINavigationController Accounts: UITableViewController UITabBarController Tweets: UITableViewController Detail view of a tweet/user/etc Replies: UITableViewController ... This seems to work[^1], but appears to be unsupported according to the SDK documentation for -pushViewController:animated: (emphasis added): viewController: The view controller that is pushed onto the stack. It cannot be an instance of tab bar controller. I would like to avoid private APIs and the like, but I'm not sure why this usage is explicitly prohibited even when it seems to work fine. Anyone know the reason? I've thought about putting the tab bar controller as the main controller, with each of the tabs containing separate navigation controllers. The problem with this is that each nav controller needs to share a single root view controller (namely the "Accounts" table in Tweetie) -- this doesn't seem to work: pushing the table controller to a second nav controller seems to remove it from the first. Not to mention all the book-keeping when selecting a different account would probably be a pain. How should I implement this the Right Way? [^1]: The tab bar controller needs to be subclassed so that the tab bar controller's navigation item at that level stays in sync with the selected tab's navigation item, and the individual tab's table controller's need to push their respective detail views to self.tabBarController.navigationController instead of self.navigationController.

    Read the article

  • UINavigationBar is getting buttons from another view

    - by Rafael Oliveira
    I have three Views, Splash, Login and List. From Splash I just wait and then Push Login View, with the Navigation Bar hidden. In Login I Show the NavigationBar, hide the BackButton1 and add a new RightButton1, then I check if Settings.bundle "login" and "pass" are set. If so, I push List View. Otherwise I stay in the Login view waiting for the user to fill the form and press a button. In List View I add a new RightButton2 and a new BackButton2. The problem is that if Settings.bundle data is not null, and in Login View I quickly push List View the RightButton1 appears in List View, or no buttons appear at all, or only BackButton2 doesn't appear... The most strange thing of all is that everything was OK and all of sudden it started to get messy. Login View: // Making the Navigation Bar Visible [self.navigationController setNavigationBarHidden:NO animated:NO]; // Hiding the Back Button in THIS view (Login) [self.navigationItem setHidesBackButton:YES]; // Inserting the Logout Button for the Next View (List) UIBarButtonItem *backButton = [[UIBarButtonItem alloc] initWithTitle:@"Logout" style:UIBarButtonItemStylePlain target:nil action:nil]; self.navigationItem.backBarButtonItem = backButton; [backButton release]; UIBarButtonItem* newAccountButton = [[UIBarButtonItem alloc] initWithTitle:@"New Account" style:UIBarButtonItemStylePlain target:self action:@selector(newAccountButtonPressed)]; self.navigationItem.rightBarButtonItem = newAccountButton; [newAccountButton release]; List View // Making the Navigation Bar Visible [self.navigationController setNavigationBarHidden:NO animated:NO]; UIBarButtonItem* aboutButton = [[UIBarButtonItem alloc] initWithTitle:@"About" style:UIBarButtonItemStylePlain target:self action:@selector(aboutButtonPressed)]; self.navigationItem.rightBarButtonItem = aboutButton; [aboutButton release]; Any ideas ?

    Read the article

  • How to perform kCATransitionPush animation without any transparency / fade effects

    - by Anthony
    I'm trying to duplicate the "slide up from the bottom" animation that [UIViewController presentModalViewController:animated:] performs but without calling it because I don't want a modal view. The below core animation code comes very close but appears to be changing transparency values of the views during it. At the start of the animation you can partially see through the view sliding up. By the middle/end of the animation the view we are sliding over is fully transparent so we can see behind it. I'd like both to remain fully opaque during this animation. Any ideas on how to stop transparency changes in this code or to otherwise get the "slide up animation" I am looking for without requiring a modal view? UIViewController *nextViewController = [[UIViewController alloc] autorelease]; nextViewController.view.backgroundColor = [UIColor redColor]; CATransition *animation = [CATransition animation]; animation.duration = 3.5; animation.timingFunction = [CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionEaseInEaseOut]; animation.type = kCATransitionPush; animation.subtype = kCATransitionFromTop; [self.navigationController pushViewController:nextViewController animated:NO]; [self.navigationController.view.layer addAnimation:animation forKey:nil];

    Read the article

  • Help with iphone button pressed

    - by StealthRT
    I am trying to see which button was clicked on so I can preform the correct logic. This is the code for the buttons: UIButton *button = [[UIButton alloc] initWithFrame:CGRectMake(270, 423, 60, 60)]; [button addTarget:self action:@selector(buttonPressedAction:) forControlEvents:UIControlEventTouchUpInside]; [button setBackgroundImage:[[UIImage imageNamed:@"refreshicon.png"] stretchableImageWithLeftCapWidth:10.0 topCapHeight:0.0] forState:UIControlStateNormal]; UIButton *button2 = [[UIButton alloc] initWithFrame:CGRectMake(0, 423, 60, 60)]; [button2 addTarget:self action:@selector(buttonPressedAction:) forControlEvents:UIControlEventTouchUpInside]; [button2 setBackgroundImage:[[UIImage imageNamed:@"login.png"] stretchableImageWithLeftCapWidth:10.0 topCapHeight:0.0] forState:UIControlStateNormal]; [self.navigationController.view addSubview:button]; [self.navigationController.view addSubview:button2]; And this is how I call the buttonPressedAction: - (void)buttonPressedAction:(id)sender { NSLog(@"%@", [sender value]); isRefreshing = TRUE; [self loadTheXML]; [self.tableView reloadData]; } But when I use NSLog to see what the sender value is, it crashes. Any advice for what's happening and how to correct it?

    Read the article

  • PoptorootViewController fails then removes all Viewcontrollers

    - by Spyker
    Trying to fix a very strange error, i have 3 view controllers that start from the app delegate and push each other accordingly. The 3rd view controller then has a toolbar button that calls the code here: -(void)showEventBrowser; { accelManeger.delegate = nil; NSLog(@"%u",[self.navigationController.viewControllers count]); [self.navigationController popToRootViewControllerAnimated:NO]; } This works the first time round but when i come back to this view controller and try again. Firstly it reports that there are 3 view controllers on the stack. It then deallocs the 2nd view controller in the stack and doesnt crash but will not go any further. If i hit the button again it says there are no view controllers on the stack and fails to respond. I have logs for all the viewdid, viewwill, e.t.c in each view controller and there appears to be no odd behaviour. Also no memory warnings from any view controllers. Why would this work once through but not the second time ?

    Read the article

  • UIActivityIndicator on UITableViewCell not displaying while calling a webService

    - by Yoyi Cheika
    Hi coders, I guess my problem is very simple to solve but I haven been able to do so. Here is my problem: I have a custom table view cell that contains a UIActivityIndicator. When a cell is selected I push another view but this second view makes a call to a web service to bring data. Here is my code // Override to support row selection in the table view. - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath { // Navigation logic may go here -- for example, create and push another view controller. // AnotherViewController *anotherViewController = [[AnotherViewController alloc] initWithNibName:@"AnotherView" bundle:nil]; // [self.navigationController pushViewController:anotherViewController animated:YES]; // [anotherViewController release]; Models *models = [[Models alloc] initWithNibName:@"Models" bundle:nil]; models.make = ((MakeCell *)[tableView cellForRowAtIndexPath:indexPath]).make.text; models.year = (int)[self.yearLabel.text doubleValue]; models.logo = [makeLogosName objectAtIndex:indexPath.row]; [((MakeCell *)[tableView cellForRowAtIndexPath:indexPath]).activityIndicator startAnimating]; [self.navigationController pushViewController:models animated:YES]; [((MakeCell *)[tableView cellForRowAtIndexPath:indexPath]).activityIndicator stopAnimating]; [models release]; } Where MakeCell is my custom cell. If I comment this line [((MakeCell *)[tableView cellForRowAtIndexPath:indexPath]).activityIndicator stopAnimating]; then the indicator appears as expected when going back to the previous view. I feel like the indicator is not being visually updated until the didSelectRowAtIndexPath returns. Does is works ascyncronically. What can be my problem here. Thank you very much Cheika

    Read the article

  • Pushing to a UITable inside a UIView from a UITableview

    - by Michael Robinson
    I can firgure out how to push a UIView from a Tableview and have the "child" details appear. Here is the view I'm trying to load: Here is the code that checks for children and either pushes a itemDetail.xib or an additional UITable, I want to use the above .xib but load the correct contents "tableDataSource" into the UItable: - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath { //Get the dictionary of the selected data source. NSDictionary *dictionary = [self.tableDataSource objectAtIndex:indexPath.row]; //Get the children of the present item. NSArray *Children = [dictionary objectForKey:@"Children"]; if([Children count] == 0) { ItemDetailViewController *dvController = [[ItemDetailViewController alloc] initWithNibName:@"ItemDetailView" bundle:[NSBundle mainBundle]]; [self.navigationController pushViewController:dvController animated:YES]; [dvController release]; } else { //Prepare to tableview. FirstTab *rvController = [[FirstTab alloc] initWithNibName:@"FirstView" bundle:[NSBundle mainBundle]]; //Increment the Current View rvController.CurrentLevel += 1; //Set the title; rvController.CurrentTitle = [dictionary objectForKey:@"Title"]; //Push the new table view on the stack [self.navigationController pushViewController:rvController animated:YES]; rvController.tableDataSource = Children; [rvController release]; } } Thanks for the help. I see lots of stuff on this but can't find the correct push instructions.

    Read the article

  • The dealloc method is not called in the present modal view contrller.

    - by Madan Mohan
    It is in My view controller -(void)doctorsListAction { if(isFirst == YES) { [self getDoctorsListController]; [[self navigationController] presentModalViewController:doctorListViewNavigationController animated:YES]; [doctorListViewController release]; } } -(void)getDoctorsListController { //DoctorListViewController *doctorListViewController=[[[DoctorListViewController alloc]initWithNibName:nil bundle:nil]autorelease]; doctorListViewController=[[DoctorListViewController alloc]init]; doctorListViewNavigationController=[[UINavigationController alloc]initWithRootViewController:doctorListViewController]; doctorListViewController.doctorList=doctorList; doctorListViewNavigationController.navigationBar.barStyle= UIBarStyleBlackOpaque; [doctorListViewController release]; } It is in DoctorListViewContrller -(void)closeAction { printf("\n hai i am in close action*******************************"); //[doctorList release]; //[myTableView release]; //myTableView=nil; printf("\n myTableView retainCount :%d",[myTableView retainCount]); [[self navigationController] dismissModalViewControllerAnimated:YES]; } //this method is not called I don't know why if it not called i will get memory issues - (void)dealloc { printf("\n hai i am in dealloc of Doctor list view contrller"); [doctorList release]; [myTableView release]; myTableView=nil; [super dealloc]; }

    Read the article

  • UIWebview does not show up into UINavigationController

    - by Pato
    Hi I have a tabBar application. In the first tab, I have a navigation bar. In this navigation bar I have a table view. When the user clicks a cell of the table, it goes to another table view, and when the user clicks a cell in that table, it goes to a webview to open a web page. Basically, it goes fine until opening the webview. In the webview, viewDidLoad is called and seems to work properly. However, webViewDidStartLoad is never called and the web page never shows up. I am not using IB. I build the UITabBarController in the AppDelegate, where I also assign an instance of my UINavigationController for each tab. I call the webview from the second UITableViewController as follows: rssWebViewController = [[webViews objectAtIndex: indexPath.row] objectForKey:@"controller"]; [[self navigationController] pushViewController:rssWebViewController animated:YES]; I have checked that the navigationController is there and it seems just fine. The viewDidload of my webview is as follows: - (void)viewDidLoad { [super viewDidLoad]; NSString *urlAddress = self.storyUrl; NSURL *url = [NSURL URLWithString:urlAddress]; NSURLRequest *requestObj = [NSURLRequest requestWithURL:url]; [[self rssWebView] setDelegate: self]; [[self view] addSubview:[self rssWebView]]; [rssWebView loadRequest:requestObj]; self.rssWebView.scalesPageToFit = YES; self.rssWebView.autoresizingMask = (UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight); } The web view controller interface is defined as follows: @interface RSSWebViewController : UIViewController <UIWebViewDelegate>{ IBOutlet UIWebView *rssWebView; IBOutlet NSString *storyUrl; IBOutlet NSString *feedName; } @property (nonatomic, retain) IBOutlet UIWebView *rssWebView; @property (nonatomic, retain) IBOutlet NSString *storyUrl; @property (nonatomic, retain) IBOutlet NSString *feedName; @end Any help is greatly appreciated.

    Read the article

  • Removing NSLog breaks compiler

    - by DVG
    Okay, so this is weird I have this code - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath { switch (indexPath.row) { case 1: NSLog(@"Platform Cell Selected"); AddGamePlatformSelectionViewController *platformVC = [[AddGamePlatformSelectionViewController alloc] initWithNibName:@"AddGamePlatformSelectionViewController" bundle:nil]; platformVC.context = context; platformVC.game = newGame; [self.navigationController pushViewController:platformVC animated:YES]; [platformVC release]; break; default: break; } } Which works fine. When I remove the NSLog Statement, like so: - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath { switch (indexPath.row) { case 1: //NSLog(@"Platform Cell Selected"); AddGamePlatformSelectionViewController *platformVC = [[AddGamePlatformSelectionViewController alloc] initWithNibName:@"AddGamePlatformSelectionViewController" bundle:nil]; platformVC.context = context; platformVC.game = newGame; [self.navigationController pushViewController:platformVC animated:YES]; [platformVC release]; break; default: break; } } I get the following compiler errors /Users/DVG/Development/iPhone/Backlog/Classes/AddGameTableViewController.m:102:0 /Users/DVG/Development/iPhone/Backlog/Classes/AddGameTableViewController.m:102: error: expected expression before 'AddGamePlatformSelectionViewController' /Users/DVG/Development/iPhone/Backlog/Classes/AddGameTableViewController.m:103:0 /Users/DVG/Development/iPhone/Backlog/Classes/AddGameTableViewController.m:103: error: 'platformVC' undeclared (first use in this function) If I just edit out the two // for commenting out that line, everything works swimingly.

    Read the article

  • Wizard style navigation, dismissing a view and showing another one

    - by Robin Jamieson
    I'm making a set of screens similar to a wizard and I'd like to know how to make a view dismiss itself and its parent view and immediately show a 'DoneScreen' without worrying about resource leaks. My views look like the following: Base -> Level1 -> DoneScreen -> Level2 -> DoneScreen The Level1 controller is a navigation controller created with a view.xib and shown with [self presentModalViewController ...] by the Base controller. The Level1 controller is also responsible for creating the 'DoneScreen' which may be shown instead of the Level2 Screen based on a certain criteria. When the user taps a button on the screen, the Level1 controller instantiates the the Level2 controller and it displays it via [self.navigationController pushViewController ..] and Level2 controller's view has a 'Next' button. When the use hits the 'Next' button in the Level2 screen, I need to dismiss the current Level2's view as well as the Level1's view and display the 'DoneScreen', which would have been created and passed in to the Level2 controller from Level1. (partly to reduce code duplication, and partly to separate responsibilities among the controllers) In the Level2 controller, if I show the 'DoneScreen' first and dismiss itself with [self.navigationController popViewControllerAnimated:YES]; then the Level1 controller's modal view is still present above the 'Base' but under the Done screen. What's a good way to clear out all of these views except the Base and then show the 'DoneScreen'? Any good suggestions on how to get this done in a simple but elegant manner?

    Read the article

  • UINaviagtionBar not displaying?

    - by Rajendra Bhole
    Hi, I developing an application in which initially choose UINavigationController based application. In rooViewController xib i added two more UIView, the code is written as follows. @implementation RootViewController @synthesize introductionView, WheelView; (void)viewDidLoad { [super viewDidLoad]; [self.navigationController setNavigationBarHidden:YES]; } pragma mark pragma mark strart up screen: -(void)startIntroductionScreen{ if(window == nil) { window = [[UIWindow alloc] initWithFrame:CGRectMake(0, 0, 320, 480)]; } [window addSubview: introductionView]; [window makeKeyAndVisible]; } -(void)WheelScreen{ [window addSubview:carnivalWheelView]; [window makeKeyAndVisible]; self.navigationController.navigationBar.hidden = NO; [self.navigationItem setLeftBarButtonItem:[[UIBarButtonItem alloc] initWithTitle:@"Setting" style:UIBarButtonItemStylePlain target:nil action:nil] animated:YES]; } pragma mark pragma mark IBAction: -(IBAction)breakGlass:(id)sender{ [self startIntroductionScreen]; } -(IBAction)anotherView:(id)sender{ [self WheelScreen]; } In above code, when the -(void)WheelScreen method on the IBAction anotherView of invoke the UINaviagtionBar is not displaying. Thank's in advance.

    Read the article

  • Passing data back from detailViewController to Uitableview

    - by jsetting32
    I am currently at the issue where I have a UITableviewCell that needs to be updated. When the user presses on the uitableviewcell - THERES ONLY 1!!, the user is pushed to a UITABLEVIEWCONTROLLER where the user is allowed to select 1 of multiple cells with their own titles. I need to get the clicked tableviewcells title and pass the value back to the parentviewcontroller and update the 1 tableviewcell's name to the one the user clicked in the pushed uitableivewcontroller. Here is a picture of the parent viewcontroller... And heres the picture of the pushed viewcontroller.... I was told earlier yesterday that delegation would be needed but I am unsure what to do at this point :/. Heres some code I use in the parent viewcontroller... - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath { [tableView deselectRowAtIndexPath:indexPath animated:YES]; ProblemTypes *view = [[ProblemTypes alloc] init]; [self.navigationController pushViewController:view animated:YES]; } I am also NOT USING storyboards, just a few xibs. Also heres the code for the pushedviewcontroller to pop to the parent viewcontroller when a cell is selected... #pragma mark - Table view delegate - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath { UITableViewCell *cell = [tableView cellForRowAtIndexPath:indexPath]; NSLog(@"Cell's text: %@",cell.textLabel.text); [self.navigationController popViewControllerAnimated:YES]; } Thank you guys!

    Read the article

  • How can you push a new view with a grouped table?

    - by Tanner
    Hi All, Ive been trying to push a new view when a cell is tapped but absolutely nothing happens. I figured grouped style pushed the same as plain. Here is my code: -(void)viewDidLoad { [super viewDidLoad]; contactArray = [[NSArray alloc] initWithObjects:@"iPhone",@"iPod",@"MacBook",@"MacBook Pro",nil]; shareArray = [[NSArray alloc] initWithObjects:@"Flex",@"AIR",@"PhotoShop",@"Flash",nil]; } -(NSInteger)numberOfSectionsInTableView:(UITableView *)tableView { return 2; } // Customize the number of rows in the table view. -(NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section { if(section == 0) return [contactArray count]; else return [shareArray count]; } -(NSString *)tableView:(UITableView *)tableView titleForHeaderInSection:(NSInteger)section{ if(section == 0){ return @"Contact"; }else{ return @"Share"; } } -(NSString *)tableView:(UITableView *)tableView titleForFooterInSection:(NSInteger)section{ if(section == 0){ return @"Footer for Apple Products"; }else{ return @"Footer for Adobe Softwares"; } } // Customize the appearance of table view cells. -(UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { static NSString *CellIdentifier = @"Cell"; UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier]; if (cell == nil) { cell = [[[UITableViewCell alloc] initWithFrame:CGRectZero reuseIdentifier:CellIdentifier] autorelease]; } // Set up the cell... if(indexPath.section == 0){ cell.text = [contactArray objectAtIndex:indexPath.row]; }else{ cell.text = [shareArray objectAtIndex:indexPath.row]; } return cell; } -(void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath { //NextViewController *nextController = [[NextViewController alloc] initWithNibName:@"NextView" bundle:nil]; //[self.navigationController pushViewController:nextController animated:YES]; if([contactArray objectAtIndex:indexPath.row] == @"iPhone"){ LandscapeHydrogen *abo = [[LandscapeHydrogen alloc] initWithNibName:@"LandscapeHydrogen" bundle:nil]; [self.navigationController pushViewController:abo animated:NO]; [abo release]; } } Any help is appreciated.

    Read the article

  • how can I know current viewcontroller name in iphone

    - by Shikhar
    I have BaseView which implement UIViewController. Every view in project must implement this BaseView. In BaseView, I have method: -(void) checkLoginStatus { defaults = [[NSUserDefaults alloc] init]; if(![[defaults objectForKey:@"USERID"] length] > 0 ) { Login *login=[[Login alloc] initWithNibName:@"Login" bundle:nil]; [self.navigationController pushViewController:login animated:TRUE]; [login release]; } [defaults release]; } The problem is my Login view also implement BaseView, checks for login, and again open LoginView i.e. stuck in to recursive calling. Can I check in checkLoginStatus method if request is from LoginView then take no action else check login. Ex: (void) checkLoginStatus { if(SubView is NOT Login){ defaults = [[NSUserDefaults alloc] init]; if(![[defaults objectForKey:@"USERID"] length] 0 ) { Login *login=[[Login alloc] initWithNibName:@"Login" bundle:nil]; [self.navigationController pushViewController:login animated:TRUE]; [login release]; } [defaults release]; } } Please help..

    Read the article

  • I tried everyhing, I just can't put my uiview behind my status bar ....

    - by gotye
    Hey guys, I have been trying every tips you already gave to other mates that where having the same issue but I just can't manage to do it ... My app isn't even special, it is a basic app with a tab bar and nav bar ... I currently got something like this in the controller I push (that i want to be fullscreen) : - (void)viewDidLoad { [super viewDidLoad]; self.view.autoresizingMask = 0; self.view.superview.autoresizingMask = 0; [[UIApplication sharedApplication] setStatusBarStyle: UIStatusBarStyleBlackTranslucent]; //[[UIApplication sharedApplication] setStatusBarHidden:YES animated:YES]; [self.navigationController.navigationBar setBarStyle:UIBarStyleBlackTranslucent]; CGRect test = CGRectMake(0.0,0.0,320,44); //[self.navigationController.navigationBar setFrame:test]; //[self setWantsFullScreenLayout:YES]; [self.view.superview setBounds:CGRectMake(0,-20.0,320,480)]; //[self.view setBounds:[[UIScreen mainScreen] bounds]]; [self.view setBounds:CGRectMake(0,-20.0,320,480)]; //CGRect rect4 = CGRectMake(0.0,0.0,320.0,500.0); //[self.view setFrame:rect4]; [self.view setBackgroundColor:[UIColor redColor]]; } As you can see I tried a lot of stuff :D but my red background isn't going under my status bar ... I am using the iphone simulator (in case it has to do with it ..) Thank you for any help ;) Gotye.

    Read the article

  • Xcode: Display Login View in applicationDidBecomeActive

    - by Patrick
    In my app I would like to show a login screen - which will be displayed when the app starts and when the app becomes active. For reference, I am using storyboards, ARC and it is a tabbed bar application. First off, I have this method which returns the topViewController. - (UIViewController *)topViewController:(UIViewController *)rootViewController { if (rootViewController.presentedViewController == nil) { return rootViewController; } if ([rootViewController.presentedViewController isMemberOfClass:[UINavigationController class]]) { UINavigationController *navigationController = (UINavigationController *)rootViewController.presentedViewController; UIViewController *lastViewController = [[navigationController viewControllers] lastObject]; return [self topViewController:lastViewController]; } UIViewController *presentedViewController = (UIViewController *)rootViewController.presentedViewController; return [self topViewController:presentedViewController]; } And I call this method here: - (void)applicationDidBecomeActive:(UIApplication *)application { if ( ... ) { // if the user needs to login PasswordViewController *passwordView = [[PasswordViewController alloc] init]; UIViewController *myView = [self topViewController:self.window.rootViewController]; [myView presentModalViewController:passwordView animated:NO]; } } To an extent this does work - I can call a method in viewDidAppear which shows an alert view to allow the user to log in. However, this is undesirable and I would like to have a login text box and other ui elements. If I do not call my login method, nothing happens and the screen stays black, even though I have put a label and other elements on the view. Does anyone know a way to resolve this? My passcode view is embedded in a Navigation Controller, but is detached from the main storyboard.

    Read the article

  • iPhone:How to make navigation top bar style to same like "Black Navigation Bar" programmatically?

    - by Getsy
    I have a Navigation project which has only a TableView. By default, i could see the navigation bar there when running the application. I want to change the navigation bar style to same like if we see in I.B there is one called "Top Bar" which has "Black Navigation Bar" style (Which shows Black navigation top bar but some kind of Gray shade will be there). I want the same in my navigation bar now, not any other color or style. How do i fix it? Note: 1. I used "self.navigationController.navigationBar.barStyle = UIBarStyleBlack;" , but it shows the navigation bar in utter black color. I don't want that, i want some kind of Gray shade in black, similar to "Top Bar" which has "Black Navigation Bar". I tried some tint color addition to the above, like "self.navigationController.navigationBar.tintColor = [UIColor grayColor];" but i observe the same utter black shows in navigation bar. I tried "navigationBar.barStyle = UIBarStyleBlackTranslucent;" but it doesn't fit and show with status bar properly. Instead it overlaps(hidden) half black with status bar and half black shows outside. Could someone teach me? Thank you.

    Read the article

  • UINavigationController not working under ARC in iPhone

    - by user1811427
    I have creared a new project "Empty Application" template in Xcode 4.3, it is having only two classes AppDelegate.h & .m I cheaked with ARC to use automatic reference count while creating the app. I added two new files "RootViewController" & "NewProjectViewControllers". I implemented code to set navigation controller as follows in AppDelegate - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]]; // Override point for customization after application launch. rootViewController = [[MainViewController alloc] init]; UINavigationController *navigation = [[UINavigationController alloc] initWithRootViewController:rootViewController]; [self.window addSubview:navigation.view]; self.window.backgroundColor = [UIColor whiteColor]; [self.window makeKeyAndVisible]; return YES; } and in hte home view (Root view controller) implemented as follows - (void)viewDidLoad { [super viewDidLoad]; self.title = @"Projects"; UINavigationBar *navigationBar = [self.navigationController navigationBar]; [navigationBar setTintColor: [UIColor colorWithRed:10/255.0f green:21/255.0f blue:51/255.0f alpha:1.0f]]; //To set the customised bar item UIButton *rightBarBtn = [UIButton buttonWithType:UIButtonTypeCustom]; [rightBarBtn setBackgroundImage:[UIImage imageNamed:@"plus_new.png"] forState:UIControlStateNormal]; rightBarBtn.frame=CGRectMake(0.0, 100.0, 30.0, 30.0); [rightBarBtn addTarget:self action:@selector(addProject) forControlEvents:UIControlEventTouchUpInside]; UIBarButtonItem* rightBarItem = [[UIBarButtonItem alloc] initWithCustomView:rightBarBtn]; self.navigationItem.rightBarButtonItem = rightBarItem; // Do any additional setup after loading the view from its nib. } - (void) addProject { NewProjViewController *editProject = [[NewProjViewController alloc] init]; [self.navigationController pushViewController:editProject animated:YES]; NSLog(@"xxxxxxxxxxxxxxx"); } But since i used ARC the navigation may dealoc immediately and it doesn't work, All the actions in method works except push to the next view if i do same thing with out ARC it works fine How to resolve this issue..? Thanks in advance

    Read the article

< Previous Page | 3 4 5 6 7 8 9 10 11 12 13 14  | Next Page >