Search Results

Search found 284 results on 12 pages for 'pushviewcontroller'.

Page 4/12 | < Previous Page | 1 2 3 4 5 6 7 8 9 10 11 12  | Next Page >

  • 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

  • How do I pass an NSString through 3 ViewControllers?

    - by dBloc
    hey, I'm currently using the iPhone SDK and I'm having trouble passing an NSString through 3 views I am able to pass an NSString between 2 view controllers but I am unable to pass it through another one. My code is as follows... `- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)index`Path { NSString *string1 = nil; NSDictionary *dictionary = [listOfItems objectAtIndex:indexPath.section]; NSArray *array = [dictionary objectForKey:@"items"]; string1 = [array objectAtIndex:indexPath.row]; //Initialize the detail view controller and display it. ViewController2 *vc2 = [[ViewController2 alloc] initWithNibName:@"ViewController2" bundle:[NSBundle mainBundle]]; vc2.string1 = string1; [self.navigationController pushViewController:vc2 animated:YES]; [vc2 release]; vc2 = nil; } in the "ViewController 2" implementations I am able use "string1" in the title bar by doing the following.... - (void)viewDidLoad { [super viewDidLoad]; self.navigationItem.title = string1; UIBarButtonItem *addButton = [[[UIBarButtonItem alloc] initWithImage:[UIImage imageNamed:@"icon_time.png"] style:UIBarButtonItemStylePlain //style:UIBarButtonItemStyleBordered target:self action:@selector(goToThirdView)] autorelease]; self.navigationItem.rightBarButtonItem = addButton; } but I also have a NavBar Button on the right side that I would like to push a new view - (void)goToThirdView { ViewController3 *vc3 = [[ViewController3 alloc] initWithNibName:@"ViewController3" bundle:[NSBundle mainBundle]]; [self.navigationController pushViewController:NESW animated:YES]; vc3.string1 = string1 ; [vc3 release]; vc3 = nil; } How do I pass on that same string to the third view? (or fourth)

    Read the article

  • Loading 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

  • expected ":" before "]" token + confused by earlier errors, bailing out

    - by Colby Bookout
    Ok so im at my wit's end here. I have tried every imaginable thing to get rid of these errors heres my code: - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath { // Navigation logic may go here. Create and push another view controller. /* //<#DetailViewController#> *detailViewController = [[<#DetailViewController#> alloc] initWithNibName:@"<#Nib name#>" bundle:nil]; // ... // Pass the selected object to the new view controller. [self.navigationController pushViewController:detailViewController animated:YES]; [detailViewController release]; */ NSInteger row = [indexPath.row]; if (self.nameExcerptPage == nil) { NameOTWexcerpt *nameExcerptPageDetail = [[nameExcerptPage alloc] initWithNibName:@"NameOTWexcerpt" bundle:nil]; self.nameExcerptPage = nameExcerptPageDetail; [nameExcerptPageDetail release]; nameExcerptPage.title = [NSString stringWithFormat:@"%&", [TheBookNavTabs objectAtIndex:row]]; Rothfuss_ReaderAppDelegate *delegate = [[UIApplication sharedApplication] delegate]; [delegate.SecondTableViewController pushViewController:TheBookNavTabs animated:YES]; } } and the error appears where it says "NSInteger row = [indexPath.row]; please help! thanks!

    Read the article

  • UIImageView not displaying image when property is set too early

    - by Undeadlegion
    I have an image I want to display inside a UIView. In Interface Builder, the UIView is the root and a UIImageView is its child. The view is connected to view controller's view outlet, and the image view is connected to the image view outlet: @property (nonatomic, retain) IBOutlet UIImageView *imageView; If I try to set the image property of UIImageView before it's visible, the image doesn't show up. TestView *testView = [[TestView alloc] initWithNibName:@"TestView" bundle:nil]; testview.imageView.image = [logos objectAtIndex:indexPath.row]; [self.navigationController pushViewController:testView animated:YES]; If, however, I pass the image to the controller and set the image property in view did load, the image becomes visible. TestView *testView = [[TestView alloc] initWithNibName:@"TestView" bundle:nil]; testview.image = [logos objectAtIndex:indexPath.row]; [self.navigationController pushViewController:testView animated:YES]; - (void)viewDidLoad { [super viewDidLoad]; imageView.image = image; } What is causing the image to not show up in the first scenario?

    Read the article

  • Terminating app due to uncaught exception 'NSGenericException', reason: '*** Collection <CALayerArray: 0x66522e0> was mutated while being enumerated

    - by fahu
    some times my app crashed by showing * Collection was mutated while being enumerated . This is occurring in same line of code all the time.please help me on this issue. i stuck on this. the app is crashing at pushing view controller line of my code.but it is not frequent one. my error console Terminating app due to uncaught exception 'NSGenericException', reason: '* Collection CALayerArray: 0x1030c730 was mutated while being enumerated. "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "" )' my code: - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath { ServiceDetails *service=[[ServiceDetails alloc] initWithNibName:@"ServiceDetails" bundle:nil]; CompanyListingForm *list=[[CompanyListingForm alloc]initWithNibName:@"CompanyListingForm" bundle:nil]; [category_company_text resignFirstResponder]; if(viewHoldingTable) { [viewHoldingTable removeFromSuperview]; } if (category_clicked_flag==0) { if (location_or_cat_com==0) { NSMutableArray *get=[district_array objectAtIndex:indexPath.row]; locationid=[[get objectAtIndex:0]intValue]; [location_textfield resignFirstResponder]; location_textfield.text=[get objectAtIndex:1]; } else { if (draggingView) { [draggingView removeFromSuperview]; } if (viewHoldingTable) { [viewHoldingTable removeFromSuperview]; } NSMutableArray *get=[company_array objectAtIndex:indexPath.row]; category_company_text.text=[get objectAtIndex:1]; service.ida=[NSString stringWithFormat:@"%d",[[get objectAtIndex:0] intValue]]; service.idloc=[NSString stringWithFormat:@"%d",locationid]; [self.navigationController pushViewController:service animated:YES];//getting error at this point. //[emer release]; } } else { if (location_or_cat_com==0) { NSMutableArray *get=[district_array objectAtIndex:indexPath.row]; locationid=[[get objectAtIndex:0]intValue]; [location_textfield resignFirstResponder]; location_textfield.text=[get objectAtIndex:1]; } else { NSMutableArray *get=[category_array objectAtIndex:indexPath.row]; category_company_text.text=[get objectAtIndex:1]; int catid=[[get objectAtIndex:0]intValue]; list.IDForLoc=[NSString stringWithFormat:@"%d",locationid]; list.IDForCat=[NSString stringWithFormat:@"%d",catid]; list.companydetails=[get objectAtIndex:1]; [self.navigationController pushViewController:list animated:YES];//getting error at this point. } } [service release]; [list release]; }

    Read the article

  • Pinch gesture in QLPreviewController?

    - by Arne
    I am using the QLPreviewController in my project, but cannot use pinch gestures to zoom in. What do I need to set up first? This is how I create the view controller: - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath { QLPreviewController *previewer = [[QLPreviewController alloc] init]; [previewer setDataSource:self]; [previewer setCurrentPreviewItemIndex:indexPath.row]; [[self navigationController] pushViewController:previewer animated:YES]; }

    Read the article

  • UIViewController not loading a UIView

    - by Cosizzle
    Hey, I'm playing around with a script my teacher provided for a table based application. However I can't seem to get my own view to load. Files: SubViewOneController (which is a sub view, also has a nib) TapViewController (Custom UIView I created and want to add to a cell) RootViewController (Main controller which loads in the views) SimpleNavAppDelegate How it works: Within the RootViewController, there's an NSArray that holds NSDictionary objects which is declared in the -(void)awakeFromNib {} method - (void)awakeFromNib { // we'll keep track of our views controllers in this array views = [[NSMutableArray alloc] init]; // when using alloc you are responsible for it, and you will have to release it. // ==================================================================================================== // ==================================================================================================== // LOADING IN CUSTOM VIEW HERE: // allocate a set of views and add to our view array as a dictionary item TapViewController *tapBoardView = [[TapViewController alloc] init]; //push onto array [views addObject:[NSDictionary dictionaryWithObjectsAndKeys: @"Tab Gestures", @"title", tapBoardView, @"controller", nil]]; [tapBoardView release]; //release the memory // ==================================================================================================== // ==================================================================================================== SubViewOneController *subViewOneController = [[SubViewOneController alloc] init]; // This will set the 2nd level title subViewOneController.title = @"Swipe Gestures"; //set it's title //push it onto the array [views addObject:[NSDictionary dictionaryWithObjectsAndKeys: @"Swipe Gestures", @"title", subViewOneController, @"controller", nil]]; [subViewOneController release]; //release the memory } Later on I set the table view: - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath { // OUTPUT -- see console NSLog(@"indexPath %i", indexPath.row); // OUTPUT: tapController: <TapViewController: 0x3b2b360> NSLog(@"view object: %@", [views objectAtIndex:indexPath.row]); // OUTPUT: view object: controller = <TapViewController: 0x3b0e290>; title = "Tab Gestures"; // ----- Hardcoding the controller and nib file in does work, so it's not a linkage issue ------ // UNCOMMENT TO SEE WORKING -- comment below section. //TapViewController *tapContoller = [[TapViewController alloc] initWithNibName:@"TapBoardView" bundle:nil]; //NSLog(@"tapController: %@", tapContoller); //[self.navigationController pushViewController:tapContoller animated:YES]; // ----- Random Tests ----- //UIViewController *targetViewController = [[views objectAtIndex: 0] objectForKey:@"controller"]; // DOES NOT WORK // LOADS THE SECOND CELL (SubViewOneController) however will not load (TapViewController) UIViewController *targetViewController = [[views objectAtIndex: indexPath.row] objectForKey:@"controller"]; NSLog(@"target: %@", targetViewController); // OUTPUT: target: <TapViewController: 0x3b0e290> [self.navigationController pushViewController:targetViewController animated:YES]; } Reading the comments you should be able to see that hardcoding the view in, works - however trying to load it from the View NSArray does not work. It does however contain the object in memory, seeing that NSLog proves that. Everything is linked up and working within the TapViewController nib file. So ya, im kinda stuck on this one, any help would be great! Thanks guys

    Read the article

  • iphone tableview within detailview

    - by pete
    Hi, im pushing a "detailview" to a navigationcontroller (RootViewController.m) [self.navigationController pushViewController:MyDetailView animated:YES]; "detailview" contains a tableview (DetailViewController.m) - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath { //push seconddetailview into navigationcontroller - how can i do that? } how do i load the seconddetailView into the main navigationcontroller? thanks pete

    Read the article

  • How to correctly use ABPersonViewController with ABPeoplePickerNavigationController to view Contact

    - by Maha
    I'm attempting to add a feature to my app that allows the user to select a contact from an ABPeoplePickerNavigationController, which then displays an ABPersonViewController corresponding to the contact they picked. At that point, I want the user to be able to click on a contact's phone number and have my app respond with custom behavior. I've got the ABPeoplePickerNavigationController working fine, but I'm running into a problem displaying the ABPersonViewController. I can get the ABPersonViewController to animate onto the screen just fine, but it only displays the contact's photo, name, and company name. None of the contact's other fields are displayed. I'm using the 'displayedProperties' element in the ABPersonViewController to tell the program to display phone numbers. This creates some strange behavior; when I select a contact that has no phone numbers assigned, the contact shows up with "No Phone Numbers" written in the background (as you'd expect), but when selecting a contact that does have a phone number, all I get is a blank contact page (without the "No Phone Numbers" text). Here's the method in my ABPeoplePickerNavigationController delegate class that I'm using to create my PersonViewController class, which implements the ABPersonViewController interface: - (BOOL) peoplePickerNavigationController:(ABPeoplePickerNavigationController *)peoplePicker shouldContinueAfterSelectingPerson:(ABRecordRef)person { BOOL returnState = NO; PersonViewController *personView = [[PersonViewController alloc] init]; [personView displayContactInfo:person]; [peoplePicker pushViewController:personView animated:YES]; [personView release]; return returnState; } Here's my PersonViewController.h header file: #import <UIKit/UIKit.h> #import <Foundation/Foundation.h> #import <AddressBookUI/AddressBookUI.h> @interface PersonViewController : UIViewController <ABPersonViewControllerDelegate> { } - (void) displayContactInfo: (ABRecordRef)person; @end Finally, here's my PersonViewController.m that's creating the ABPersonViewController to view the selected contact: #import "PersonViewController.h" @implementation PersonViewController - (void) displayContactInfo: (ABRecordRef)person { ABPersonViewController *personController = [[ABPersonViewController alloc] init]; personController.personViewDelegate = self; personController.allowsEditing = NO; personController.displayedPerson = person; personController.addressBook = ABAddressBookCreate(); personController.displayedProperties = [NSArray arrayWithObjects: [NSNumber numberWithInt:kABPersonPhoneProperty], nil]; [self setView:personController.view]; [[self navigationController] pushViewController:personController animated:YES]; [personController release]; } - (BOOL) personViewController:(ABPersonViewController*)personView shouldPerformDefaultActionForPerson:(ABRecordRef)person property:(ABPropertyID)property identifier:(ABMultiValueIdentifier)identifierForValue { return YES; } @end Does anyone have any idea as to why I'm seeing this blank Contact screen instead of one with clickable phone number fields?

    Read the article

  • TableView frame not resizing properly when pushing a new view controller and the keyboard is hiding

    - by Pete
    Hi, I must be missing something fundamental here. I have a UITableView inside of a NavigationViewController. When a table row is selected in the UITableView (using tableView:didSelectRowAtIndexPath:) I call pushViewController to display a different view controller. The new view controller appears correctly, but when I pop that view controller and return the UITableView is resized as if the keyboard was being displayed. I need to find a way to have the keyboard hide before I push the view controller so that the frame is restored correctly. If I comment out the code to push the view controller then the keyboard hides correctly and the frame resizes correctly. The code I use to show the keyboard is as follows: - (void) keyboardDidShowNotification:(NSNotification *)inNotification { NSLog(@"Keyboard Show"); if (keyboardVisible) return; // We now resize the view accordingly to accomodate the keyboard being visible keyboardVisible = YES; CGRect bounds = [[[inNotification userInfo] objectForKey:UIKeyboardFrameBeginUserInfoKey] CGRectValue]; bounds = [self.view convertRect:bounds fromView:nil]; CGRect tableFrame = tableViewNewEntry.frame; tableFrame.size.height -= bounds.size.height; // subtract the keyboard height if (self.tabBarController != nil) { tableFrame.size.height += 48; // add the tab bar height } [UIView beginAnimations:nil context:NULL]; [UIView setAnimationDelegate:self]; [UIView setAnimationDidStopSelector:@selector(shrinkDidEnd:finished:contextInfo:)]; tableViewNewEntry.frame = tableFrame; [UIView commitAnimations]; } The keyboard is hidden using: - (void) keyboardWillHideNotification:(NSNotification *)inNotification { if (!keyboardVisible) return; NSLog(@"Keyboard Hide"); keyboardVisible = FALSE; CGRect bounds = [[[inNotification userInfo] objectForKey:UIKeyboardFrameBeginUserInfoKey] CGRectValue]; bounds = [self.view convertRect:bounds fromView:nil]; CGRect tableFrame = tableViewNewEntry.frame; tableFrame.size.height += bounds.size.height; // add the keyboard height if (self.tabBarController != nil) { tableFrame.size.height -= 48; // subtract the tab bar height } tableViewNewEntry.frame = tableFrame; [UIView beginAnimations:nil context:NULL]; [UIView setAnimationDelegate:self]; [UIView setAnimationDidStopSelector:@selector(_shrinkDidEnd:finished:contextInfo:)]; tableViewNewEntry.frame = tableFrame; [UIView commitAnimations]; [tableViewNewEntry scrollToNearestSelectedRowAtScrollPosition:UITableViewScrollPositionMiddle animated:YES]; NSLog(@"Keyboard Hide Finished"); } I trigger the keyboard being hidden by resigning first responser for any control that is the first responder in ViewWillDisappear. I have added NSLog statements and see things happening in the log file as follows: Show Keyboard ViewWillDisappear: Hiding Keyboard Hide Keyboard Keyboard Hide Finished PushViewController (an NSLog entry at the point I push the new view controller) From this trace, I can see things happening in the right order, but It seems like when the view controller is pushed that the keyboard hide code does not execute properly. Any ideas would be really appreciated. I have been banging my head against the keyboard for a while trying to find out what I am doing wrong.

    Read the article

  • Flipping PDF pages in QuartzDemo application

    - by BittenApple
    I am working on modifying the quartzdemo application so that it can show another page from a multipage pdf on tap screen event. So far I have stripped it down to the point where it displays the PDF on any page as initial page, but I can't seem to get it figured out how to make the quartzview display anything else then the initial page. I'm guessing that the pushViewController has something to do with this. Anyway, here's my method that draws the initial page and in sits in QuartzImages.m file: -(void)drawNewPage:(CGContextRef)myContext { CGContextTranslateCTM(myContext, 0.0, self.bounds.size.height); CGContextScaleCTM(myContext, 1.0, -1.0); CGContextSetRGBFillColor(myContext, 255, 255, 255, 1); CGContextFillRect(myContext, CGRectMake(0, 0, 320, 412)); CGPDFPageRef page = CGPDFDocumentGetPage(pdfFajl, pageNumber); CGContextSaveGState(myContext); CGAffineTransform pdfTransform = CGPDFPageGetDrawingTransform(page, kCGPDFCropBox, self.bounds, 0, true); CGContextConcatCTM(myContext, pdfTransform); CGContextDrawPDFPage(myContext, page); CGContextRestoreGState(myContext); } This gets fired up in MainViewController.m so: - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath { // ### DISPLAY DESIRED PAGE QuartzViewController *targetViewController = [self controllerAtIndexPath:indexPath]; if ([targetViewController.quartzView isKindOfClass:[QuartzPDFView1 class]]) { ((QuartzPDFView1 *)targetViewController.quartzView).pageNumber = 1; CFURLRef pdfURL = CFBundleCopyResourceURL(CFBundleGetMainBundle(), CFSTR("mypdftest.pdf"), NULL, NULL); ((QuartzPDFView1 *)targetViewController.quartzView).pdfFajl = CGPDFDocumentCreateWithURL((CFURLRef)pdfURL); CFRelease(pdfURL); } [[self navigationController] pushViewController:targetViewController animated:YES]; } Since I'm fairly new to the iPhone development (I'm currently only on page 123 in "beginning iphone 3 development" book) these controllers confuse me as hell. I have setup an event which gets fired up fine on screen tap. The event sits in QuartzView.m and I get a simple alert on screen tap showing that the tap was registered. I would like to use this method to draw a new page instead of showing the alert, page number doesn't matter, I'll work on incrementing (page flipping) later, I need an example of how to call these methods (if its even possible). These are defined in QuartzView.h and I planned on using them in the tap event method: CGPDFDocumentRef pdfFajl; int pageNumber; Thankful for any useful input from "the internets" :)

    Read the article

  • Invocation of ViewDidLoad after initWithNibName

    - by live2dream95
    It appears that ViewDidLoad() is sent to a ViewController only after its View is physically displayed (i.e. via NavigationController pushViewController), and not immediately after initWithNibName(). Is this a behavior I can rely on? I would like to get the chance to set the member variables of my view so that all the members are valid by the time ViewDidLoad() is invoked.

    Read the article

  • How to change pop view controller animation on back button ?

    - by Aryabhatt
    Hi all , I am pushing my view controller with the following statement : [[self navigationController] pushViewController:self.customViewController animatedWithTransition:UIViewAnimationTransitionFlipFromLeft]; Now when I am pressing the back button I want to animate it with the uiviewanimationtransitionflipfromright . like [self.navigationController popViewControllerAnimatedWithTransition:UIViewAnimationTransitionFlipFromLeft]; How Can I do so ? Thanks

    Read the article

  • Why is my Interface Builder wiring so bonkers and what can I do to straighten it out?

    - by editor
    I've been working on an iPhone application in XCode and Interface Builder of the Tab Bar project type. After getting a table view of topics (business sectors) working fine I realized that I would need to add a Navigation Control to allow the user to drill into a subtopics (subsectors) table. As a green Objective-C developer, that was confusing, but I managed to get it working by reading various documentation trying out a few different IB options. My current setup is a Tab Bar Controller with Tab 1 as a Navigation Controller and Tab 2 a plain view with a Table View placed into it. The wiring works: I can log when table rows are selected and I'm ready to push a new View Controller onto the stack so that I can display the subtopics Table View. My problem: For some reason the first tab's Table View is a delegate and dataSource of the second ta. It doesn't make sense to me and I can't figure out why that's the only setup that works. Here is the wiring: Navigation Controller (Sectors) is a delegate of Tab Bar Navigation Bar is a delegate of Navigation Controller (Sectors) View Contoller (Sectors) has a view of Table View Table View (in Navigation Controller (Sectors)) is a delegate of First View Controller (Companies) Table View (in Navigation Controller (Sectors)) is a dataSource outlet of First View Controller (Companies) First View Controller (Companies) First View Contoller (Sectors) has a view of Table View Table View (in First View Controller (Companies)) is not hooked up to a dataSource outlet and is not a delegate When I click the tab buttons and look at the Inspector I see that the first tab is correctly hooked up to my MainWindow.xib and the second tab has selected a nib called SecondView.xib. It's in the File's Owner of MainWindow.xib where I inherit UITableViewDataSource and UITableViewDelegate (and also UITabBarControllerDelegate) in the .h, and in the .m where I implement the delegate methods. Why does this setup only work when the Table View in my first tab (View Controller (Sectors)) is a delegate and dataSource of the second tab? I'm confused: why wouldn't it need to be hooked up to the Navigation Controller-enabled tab in which the Table View is seen (Navigation Controller (Sectors))? The Table View seen on the second tab has neither dataSource and is not a delegate. I'm having trouble getting a pushViewController to fire (self.navigationController is not nil but the new View Controller still doesn't load) and I suspect that I need to work out this IB wiring issue before I can troubleshoot why the Nav Controller won't push a new View Controller onto the stack. if(nil == self.navigationController) { NSLog(@"self.navigationController is nil."); } else { NSLog(@"self.navigationController is not nil."); SectorList *subsectorViewController = [[SectorList alloc] initWithNibName:@"SectorList" bundle:nil]; subsectorViewController.title = @"Subsectors"; [[self navigationController] pushViewController:subsectorViewController animated:YES]; [subsectorViewController release]; }

    Read the article

  • How can I present a modal view controller after selecting a contact?

    - by barfoon
    Hey everyone, I'm trying to present a modal view controller after selecting a contact and it doesnt seem to be working. In my - (BOOL)peoplePickerNavigationController:(ABPeoplePickerNavigationController *)peoplePicker shouldContinueAfterSelectingPerson:(ABRecordRef)person method, I dismiss peoplePicker, create an instance of my new view controller, then present it with [self.navigationController presentModalViewController:newController animated:YES]; and it doesnt work. However if i PUSH the view controller it works with this code: [self.navigationController pushViewController:newController animated:YES]; How can I accomplish this? Thank you,

    Read the article

  • I want to get the value from one class (SearchTableViewController.m) to another class (HistoryTableV

    - by ahmet732
    #import <UIKit/UIKit.h> @class SearchDetailViewController; @interface SearchTableViewController : UITableViewController <UISearchBarDelegate, UITableViewDelegate, UITableViewDataSource>{ IBOutlet UITableView *myTableView; NSMutableArray *tableData;//will be storing data that will be displayed in table. //Search array den buna aktarma yapcaz ilerde görceksin. NSMutableArray *searchedData;//will be storing data matching with the search string UISearchBar *sBar;//search bar NSMutableArray *searchArray; // It holds the medicines that are shown in tableview SearchDetailViewController * searchDetailViewController; NSMutableArray *deneme; } @property(nonatomic,retain)UISearchBar *sBar; @property(nonatomic,retain)IBOutlet UITableView *myTableView; @property(nonatomic,retain)NSMutableArray *tableData; @property(nonatomic,retain)NSMutableArray *searchedData; @property (nonatomic, retain) NSMutableArray *searchArray; @property (nonatomic, retain) SearchDetailViewController *searchDetailViewController; @property (nonatomic, copy) NSMutableArray *deneme; @end SearchTableViewController.m - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath { // Navigation logic may go here. Create and push another view controller. // AnotherViewController *anotherViewController = [[AnotherViewController alloc] initWithNibName:@"AnotherView" bundle:nil]; // [self.navigationController pushViewController:anotherViewController]; // [anotherViewController release]; **deneme= [[NSMutableArray alloc]init]; deneme=[tableData objectAtIndex:indexPath.row];** ****NSLog(@"my row = %@", deneme);**// I holded one of the selected cells here** HistoryTableViewController.m - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath { // Navigation logic may go here. Create and push another view controller. // AnotherViewController *anotherViewController = [[AnotherViewController alloc] initWithNibName:@"AnotherView" bundle:nil]; // [self.navigationController pushViewController:anotherViewController]; // [anotherViewController release]; **SearchTableViewController *obj= [[SearchTableViewController alloc]init];** **NSLog(@"my 2nd row= %@", [obj deneme]); //it prints nil** } My project is TabBar. There are two buttons on it- Search and History. I want to display selected items in a table in History tab. But i can not bring the selected item from SearchTableViewController.m to the class (HistoryTableViewController.m) The problem is : I can hold one of the selected items in an array (named deneme)from table in SearchTableViewController.m but i can not take it to HistoryTableViewController.m. It prints nil in console screen.... If I can make it visible in History class, I display those selected items on table. Please help me !!!

    Read the article

  • question related to backbutton of UIToolbar

    - by user217572
    sir I'm getting 2 different values in back button click My question is, *If I want to back to view as per my value coming in int variable. how is it possible? *My second question is that my project is based on UINavigationController So,how should i do that? bcoz i'm using PushviewController to puch the new view from olderview Thanks in advance

    Read the article

  • Tab Bar and Nav Controller: Where did I go wrong in my Interface Builder wiring?

    - by editor
    Even if you don't know how I've shot myself in the foot, a story which I've tried to lay out below, if you think I've done a good job showing the parameters of my problem I'd appreciate an upvote so that I might be able to grab some attention for my question. I've been working on an iPhone application in XCode and Interface Builder of the Tab Bar project type. After getting a table view of topics (business sectors) working fine I realized that I would need to add a Navigation Control to allow the user to drill into a subtopics (subsectors) table. As a green Objective-C developer, that was confusing, but I managed to get it working by reading various documentation trying out a few different IB options. My current setup is a Tab Bar Controller with Tab 1 as a Navigation Controller and Tab 2 a plain view with a Table View placed into it. The wiring works: I can log when table rows are selected and I'm ready to push a new View Controller onto the stack so that I can display the subtopics Table View. My problem: For some reason the first tab's Table View is a delegate and dataSource of the second ta. It doesn't make sense to me and I can't figure out why that's the only setup that works. Here is the wiring: Navigation Controller (Sectors) is a delegate of Tab Bar Navigation Bar is a delegate of Navigation Controller (Sectors) View Contoller (Sectors) has a view of Table View Table View (in Navigation Controller (Sectors)) is a delegate of First View Controller (Companies) Table View (in Navigation Controller (Sectors)) is a dataSource outlet of First View Controller (Companies) First View Controller (Companies) First View Contoller (Sectors) has a view of Table View Table View (in First View Controller (Companies)) is not hooked up to a dataSource outlet and is not a delegate When I click the tab buttons and look at the Inspector I see that the first tab is correctly hooked up to my MainWindow.xib and the second tab has selected a nib called SecondView.xib. It's in the File's Owner of MainWindow.xib where I inherit UITableViewDataSource and UITableViewDelegate (and also UITabBarControllerDelegate) in the .h, and in the .m where I implement the delegate methods. Why does this setup only work when the Table View in my first tab (View Controller (Sectors)) is a delegate and dataSource of the second tab? I'm confused: why wouldn't it need to be hooked up to the Navigation Controller-enabled tab in which the Table View is seen (Navigation Controller (Sectors))? The Table View seen on the second tab has neither dataSource and is not a delegate. I'm having trouble getting a pushViewController to fire (self.navigationController is not nil but the new View Controller still doesn't load) and I suspect that I need to work out this IB wiring issue before I can troubleshoot why the Nav Controller won't push a new View Controller onto the stack. if(nil == self.navigationController) { NSLog(@"self.navigationController is nil."); } else { NSLog(@"self.navigationController is not nil."); SectorList *subsectorViewController = [[SectorList alloc] initWithNibName:@"SectorList" bundle:nil]; subsectorViewController.title = @"Subsectors"; [[self navigationController] pushViewController:subsectorViewController animated:YES]; [subsectorViewController release]; }

    Read the article

  • A question is related to state maintainance

    - by user217572
    my question is like that My 5 th view is Acontroller and it has 1 UIButton.when i click on this UIButton my Bcontroller's view opens.this operation wrks perfectly. but i'm actually doing state maintainanace.when i reach to 5 th view of Acontroller.after that i press home button and then when i again click on application as per my state maintainance code 5 th view of Acontroller opens .but when i click on it's UIButton Bcontroller's view not open.why A code of UIButton is as below [self.navigationController pushViewController:bcontroller animated:YES]; bcontroller is nothing but object of Bcontroller

    Read the article

  • How to remove back button action while page is loading.

    - by user133611
    Hi All In my project i have a list when select on a item it will take to next controller using PushViewController. When i go there i will get data using libxml parser. But when i am clicking on the back button while loading it is showing exception. So i want to disable back button action till loading of data is completed how can i handle it. Thank You

    Read the article

  • Extra retain counts after initWithNibName

    - by optimisticmonkey
    I have extra retain counts after calling initWithNib. What could cause this? (There are no referencing outlets in the nib) StepViewController *stepViewController = [[StepViewController alloc] initWithNibName:@"StepViewController" bundle:nil]; [self.navigationController pushViewController:stepViewController animated:YES]; [stepViewController release]; NSLog(@"nextStep stepViewController retain count %i", [stepViewController retainCount]); the above results in a retain count of 3... Thanks for any advice on how to troubleshoot

    Read the article

  • What is the proper way to change the UINavigationController transition effect

    - by Felipe Sabino
    I have seen lots of people asking on how to push/pop UINavigationControllers using other animations besides the default one, like flip or curl. The problem is that either the question/answer was relative old, which means the have some things like [UIView beginAnimations:] (example here) or they use two very different approaches. The first is to use UIView's transitionFromView:toView:duration:options:completion: selector before pushing the controller (with the animation flag set to NO), like the following: UIViewController *ctrl = [[UIViewController alloc] init]; [UIView transitionFromView:self.view toView:ctrl.view duration:1 options:UIViewAnimationOptionTransitionFlipFromTop completion:nil]; [self.navigationController pushViewController:ctrl animated:NO]; Another one is to use CoreAnimation explicitly with a CATransaction like the following: // remember you will have to have the QuartzCore framework added to your project for this approach and also add <QuartzCore/QuartzCore.h> to the class this code is used CATransition* transition = [CATransition animation]; transition.timingFunction = [CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionEaseIn]; transition.duration = 1.0f; transition.type = @"flip"; transition.subtype = @"fromTop"; [self.navigationController.view.layer removeAllAnimations]; [self.navigationController.view.layer addAnimation:transition forKey:kCATransition]; UIViewController *ctrl = [[UIViewController alloc] init]; [self.navigationController pushViewController:ctrl animated:NO]; There are pros and cons for both approaches. The first approach gives me a much cleaner code but restricts me from using animations like "suckEffect", "cube" and others. The second approach feels wrong just by looking at it. It starts by using undocumented transitions types (i.e. not present in the Common transition types documentation from CATransition Class Reference) which might get your app rejected from App Store (I mean might as I could not found any reference of apps being rejected because it was using this transactions, which I would also appreciate any clarification on this matter), but it gives you much more flexibility on your animations, as I can use other animation types such as "cameraIris", "rippleEffect" and so on. Regarding all that, do I really need to appeal for QuartzCore and CoreAnimation whenever I need a fancier UINavigationController transition? Is there any other way to accomplish the same effect using only UIKit? If not, will the use of string values like "flip" and "cube" instead of the pre-defined constants (kCATransitionFade, kCATransitionMoveIn, etc...) be an issue regarding my app approval in the App Store? Also, are there other pros and cons regarding both approaches that could help me deciding whether to choose each one of them?

    Read the article

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