Back button not removing from the stack?

Hi,
I have the following code:
[[self navigationController]pushViewController:_newsDetailController animated:YES];
However, It doesn't seem to be removing from the stack when the user hits the back button on the UINavigationBar.
The reason I believe this, is because when you then select another item in my UITableView, it loads exactly the same details as the first time.
I have tried [_newsDetailController release]; but it still doesn't make any difference. It just crashes after the third selection.
This is what I'm doing in my didSelectRowAtIndexPath:
- (void)tableViewUITableView *)tableView didSelectRowAtIndexPathNSIndexPath *)indexPath {
[[self appDelegate] setCurrentlySelectedBlogItem:[[[self rssParser]rssItems]objectAtIndex:indexPath.row]];
[self.appDelegate loadNewsDetails];
Any help would be greatly appreciated. I've spent ages on this!
It worked fine until I added a UINavigationController.
Thanks,
Nick

Hi Nick, and welcome to the Dev Forum,
nrawlins wrote:
... It doesn't seem to be removing from the stack when the user hits the back button on the UINavigationBar.
I understand how your observations could make it seem like your _newsDetailController is somehow staying on the stack, but that's not what's going on here. If you want to see the stack, just add some logging before and after pushing or popping:
NSLog(@"stack: %@", self.navigationController.viewControllers);
I think we'll need to see more of your code to isolate the problem, but what we're looking for is a logic mistake which causes the detail controller to always display the info for the same item, regardless of which item is selected next. Here's a list of questions to guide your search, and/or show you which code we need to look at:
1) What's in the array returned by [[self rssParser]rssItems] ? It might help to add some logging in tableView:didSelectRowAtIndexPath like this:
- (void)tableView(UITableView *)tableView didSelectRowAtIndexPath(NSIndexPath *)indexPath {
NSArray *item = [[[self rssParser]rssItems]objectAtIndex:indexPath.row]];
NSLog(@"%s: item=%@", _func_, item);
[[self appDelegate] setCurrentlySelectedBlogItem:item];
[[self appDelegate] loadNewsDetails];
2) What does loadNewsDetails do? It looks like it finds the details for the item stored in currentlySelectedBlogItem. Is that right? Some logging in loadNewsDetails might help to make sure the correct details are loaded there. From your description it sounds like you already had this part of the code working right, but it wouldn't hurt to be sure it's still doing what you expect;
3) How does the data obtained in loadNewsDetails find its way to the details controller? This is the missing link not shown in the code you've posted so far. I think we need to look at:
3.1) Where and when the details controller is created;
3.2) Whether the same controller object is intended to persist from item to item, or whether a new instance of the controller is created each time an item is selected. The latter scheme is usually preferred for best memory management;
3.3) Is the current item and detail data stored in the detailsController or the app delegate? When is it stored, and when is it used?
For example, suppose the details controller is only created once and persists for the life of the table view. Then suppose loadNewDetails saves the new details in an ivar of the app delegate, and the code to fetch the new details is in viewDidLoad of the controller.
In the above scenario, viewDidLoad would run after the details controller was created, and if the details of the first selection were loaded by then, the details for the currently selected item would
be presented as expected. But viewDidLoad will normally only run once, so when the selection was changed, the new details would never be fetched, and the previous details will be displayed again.
The best way to avoid this and other related scenarios, is to create a new details controller each time a new selection is made from the table view:
// MyTableViewController.m
#import "myAppDelegate.h"
#import "NewsDetailController.h"
// called by loadNewsDetails as soon as details have been loaded
- (void)presentDetailController {
NewsDetailController *viewController = [[NewsDetailController alloc] // vc retainCount is 1
initWithNibName:@"NewsDetailController" bundle:nil];
// store new details in the detail controller; e.g.:
viewController.navigationItem.title = [self appDelegate].currentlySelectedBlogItem;
viewController.textView = [self appDelegate].currentDetails;
[self.navigationController pushViewController:viewController // vc retainCount is 2
animated:YES];
[release viewController]; // vc retainCount is 1
By releasing the new controller in the last line, we reduce its retain count to 1. Now the new controller is only retained by the stack, so when the stack is popped, the new controller will be dealloced.
If none of the above is helpful, please answer all the questions as best you can and post the indicated code, ok?
- Ray

Similar Messages

  • PO Approval Items Workitems are not removed from the Universal Worklist UWL

    Hi,
    Certain of our purchase orders require approval, they are sent to the relevant approver via workflow to their SAP inbox (SBWP) and universal worklist.
    When the user executes the workitem (Approve or Reject) The workitem should be removed from the universal worklist and SBWP when refreshed.
    The problem we experiencing is that the Workitems are not removed from the UWL after they have been executed. The SBWP is behaving correctly and the items are removed.
    It is not all the workitems that have this problem, only certain ones - but there is no pattern.
    Thanks for the help.

    Hi,
    The user B approved the PR accessing the transaction SBWP or via PR transaction directly?
    If via PR transaction directly, then your workflow needs a Wait Event step.
    Regards,
    Kleber

  • Why was the "new tab" button option removed from the "customize toolbar" set?

    Back in 3.x and older I was able to place a "open new window" button, and an "open new tab" button on the bookmarks toolbar. This worked well for me. Now with 4, the "open new tab" is unavailable, and you can only open a new tab using the default button right next to your already open tabs.
    Any chance of that open new tab button coming back? I'd rather use that (what I am used to) than the new one.
    They're called options, stop removing them.

    You can find the New Tab button showing as a '+' on the Tab bar.<br />
    You can open the Customize window and drag the New Tab button from the Tab bar on another toolbar and it will become a regular toolbar button like the New Tab button that you have in Firefox 3 versions.<br />
    If you want the New Tab button at the far right end of the Tab bar then place a flexible to the left of it.<br />
    Open the Customize window via "View > Toolbars > Customize" or via "Firefox > Options > Toolbar Layout"

  • Payment blcok not removed from the Accounting Document

    Hi All,
    We have an MM invoice which was posted with a price block. Later the PO was  updated and hence the price block was removed. But the payment block from the corresponding accounting document has not been removed. Should it not been done automatically? Or is it because the invoice was already posted before removal of price block? I have a technical background and do not understand much of the functional aspects. Can you please explain this scenario? Full points will be rewarded.
    Thanks in advance

    Hi,
    The Process is like this,
    1. You have created a PO
    2. Done a GR
    3. INvoice verification done
    3.a During your Invoice verfification, the system will go for a three way match ie PO, GR and vendor supplied invoice, if the system observes any discrepanices then the invoice will be blocked for payment automically.
    3.b Also in the background an accounting document gets generated for processing the payment to vendor ( FI Process ), since the invoice is blocked in the MM side, the same will get reflected in the FI side also.
    4. When the invoice is blocked we need to understand the need for block, as in your case it is blocked due to price change.
    5. Then the necessary steps have to be taken, ie the invoice can be posted wihout doing any changes through MRBR transaction ( Manually ) or the necessary changes can be done and the exeution of the transaction MRBR in automatic mode will remove the block from all those invoices where discrepancies have been sorted out.
    6. In your process upto step 5 had been completed, thats why the document is not visible in the transaction MRBR.
    7. Whereas the payment block generated subsequently as the result of the invoice verification document needs to be removed manually by a FI guy to pay the payment to the vendor.
    Now if you can tell your actual requirement we will be able to help you in a beter way.
    Regards,
    DilL

  • I have an ipod touch 4th gen and I have songs on it which I cannot remove, even when I sync it and untick the songs they will not remove from the ipod, doesnt work manually either, help

    I previously had an ipod nano but now have an ipod touch, when I synced it for the first time I got songs on to the ipod which I dont want, I have tried unticking them in itunes library and this doesnt work.  I have also tried going to summary to remove manually but it doesnt show any songs in this box to be removed.  Can anone help please.

    Is your device recognized by your computer? If yes, copy the pictures and videos as shown in this article:
    Copying personal photos and videos from iPhone, iPad, or iPod touch to your computer
    If it is not recognized, try this first: iOS: Device not recognized in iTunes for Windows
    Disable autosync in iTunes, right click on it in the device list and choose "transfer purchases" to copy apps and other media bought in iTunes to your new library.
    Do the same again and choose "backup", to create a manual backup without syncing.
    Since your device will be erased due to the new iTunes library during the first sync, you can use this backup afterwards to restore your settings and data.
    Set up at least one contact and event on your computer before you start, to be able to merge calendars and contacts.

  • I just went from OS 10.6 to 10.8. The arrow button is gone from the scrollbar. I do not see the option in "Systems Preference" any more. Am I missing something. If it is gone, is Apple going to bring it back?

    I just went from OS 10.6 to 10.8. The arrow button is gone from the scrollbar. I do not see the option in "Systems Preference" any more. Am I missing something. If it is gone, is Apple going to bring it back?

    John R M wrote:
    Thank you. I believe Apple shoud give you the option as to whether or not you may want to use the arrows.
    Apple give users what they want?
    Good luck there, the head of iOS Scott Forstall was canned, I suspect this was his favorite picture.
    However I bring salvation and sanity, the option to go back to the wonderous Snow Kitty.
    How to revert your Mac to Snow Leopard
    How to erase and install Snow Leopard 10.6
    Be sure to vent to Apple for the stupid changes here
    https://www.apple.com/feedback/macosx.html

  • [svn] 1931: the ja_JP swc' s should not have been removed from the locales package, I' m adding them back in

    Revision: 1931
    Author: [email protected]
    Date: 2008-06-03 13:30:46 -0700 (Tue, 03 Jun 2008)
    Log Message:
    the ja_JP swc's should not have been removed from the locales package, I'm adding them back in
    Modified Paths:
    flex/sdk/trunk/build.xml

    Hi Manny1/mreider,
    First, I’m sorry to hear that you two may be having issues utilizing a recently purchased Gamers Club Unlocked (GCU) Gifting Card.
    In all reality, our stores don’t even need to exchange the Gifting Card for the standard GCU card, although that option should be available to you if absolutely needed. The GCU Gifting Card can be applied to your My Best Buy membership by simply following the directions on the back of the card.
    Thanks for sharing your feedback and I hope for a much better experience when you return to your local Best Buy to get this taken care of! If needed, please don't hesitate to ask for a manager or supervisor.
    Brian|Senior Social Media Specialist | Best Buy® Corporate
     Private Message

  • IPad not backed up icon will not remove from screen

    iPad not backed up icon will not remove from screen

    Reboot the iPad by holding down on the sleep and home buttons at the same time for about 10-15 seconds until the Apple Logo appears - ignore the red slider if it appears on the screen - let go of the buttons. Let the iPad start up.

  • Why was the link button removed from the piano roll?

    Why was the LINK (chain) button removed from the piano roll? This makes Logic X useless to me as I can no longer compose or perform new lines based on previous midi performances. PLEASE BRING IT BACK!

    I miss that button too and just filled out the LX Feedback form (Menubar -> Logix Pro X-> Feedback) with the following text. Maybe if you guys did the same, we had a chance revive this essetial feature!!!
    thanks!
    Sebi
    Hi there,
    it seems as if the Link Button (Yellow chain symbol) has been removed from the piano roll for no reason. In Score View it is still there.
    I (and probably more users) absolutely NEED that Button to decouple the content of the piano roll from the selected track/region AND to use multiple piano roll windows with independent content.
    - For transscripting (Mute/Solo Audio regions while editing a Midi-Region)
    - For arranging. Edit 2 different midi regions both in separate Piano Roll windows
    - For recording. "Reading" Drum-Patterns while recording the Bass e.g.
    Please bring that button back or explain why it was removed
    Best regards,

  • I have MBP 13 late 2011:Will it be able to support a 3tb hardisk?Secondly, if i delete a song from itunes,is that song removed from the mac and is the space freed up?If not then what should I do to free up space when i delete songs from itunes?

    I have MBP 13 late 2011:
    Will it be able to support a 3tb hardisk?
    Secondly, if i delete a song from itunes,is that song removed from the mac and is the space freed up?If not then what should I do to free up space when i delete songs from itunes?

    Your MBP will support a 3T HDD provided it is formatted correctly and has sufficient power.  Most large HDDs require an outboard power source.
    When you delete songs from iTunes you will get a message if you want to send it to trash.  If you send it to trash, space will be freed up only when you empty trash.  An individual song does not consume much space so if your HDD is becoming full, more drastic action s should be considered, such as moving an entire file to an external HDD.
    Ciao.

  • Features that are not supported by Excel in the browser and interactive reports will be removed from the saved copy

    I Created a power view in Excel 2013 and uploaded to my Power BI for o365 site.
    But when i click on my excel file it opens in browser,After that i click on File tab its showing me two option 
    1. Save a Copy
    2.Download a copy
    When i click on save a copy its showing me an warning below
    Features that are not supported by Excel in the browser and interactive reports will be removed from the saved copy.
    Continue with Save?
    If i continue saving it only saves an excel files with data only not the power view which i want to save with applied filters.
    Please help me for this

    Just to clarify, when you hit the option of Save As Copy, the whole experience goes into a "read-write" mode in Excel services, which currently doesn't support authoring, just consumption of PowerView sheets.
    Two mitigations that come to mind:
    1. Download the copy (as Brad suggests), rename the file and upload.
    2. Use the send to option of SharePoint online, give the file the right target document library (can be the same as source) and rename the file:
    GALROY

  • The Elements 12 Mac disk works fin - I also have a Dell, and the Windows disk will not run at all, sounds like it's grinding, and is almost impossible to remove from the hard drive.  I cannot find any place to tell me who to CALL to ask for a replacement!

    The Elements 12 Mac disk works fine - I also have a Dell, and the Windows disk will not run at all, sounds like it's grinding, and is almost impossible to remove from the hard drive.  I cannot find any place to tell me who to CALL to ask for a replacement!

    Hi Samcat,
    You can use a download instead of the disk as an alternative: Adobe - Download free trial version Adobe Photoshop Elements 12 | Adobe you can license with your serial
    Please test the disk in another windows machine to check if it's caused by the drive or the disk. If you tested with 2 drives please start a support case, i assume Adobe will only provide downloads at this point. They are the same as the trials. If you still need a disk you can burn the trial to a disk as a backup disk. Good luck!

  • How InDesign comes to know about any changes on document, but not saved. As it shows * on the name of document when it is opened and any changes. And after saving * symbol is get removed from the name of document. How and where indesign@ handles this?

    How InDesign comes to know about any changes on document, but not saved. As it shows * on the name of document when it is opened and any changes.
    And after saving * symbol is get removed from the name of document. How and where indesign@ handles this?

    Are you just asking because you want to know, or do you have a problem you need to solve? I don't know how to write a program, but I think what your are describing is not an unusual thing for a  program to do. The * tells you that changes have been made since the last save, and the program reserves a portion of memory for undo functions. I suppose a coder could tell you how it works, but I don't think it would help an average user to know, but that's just my opinion.

  • HT201272 The last 2 songs I purchased, Treasure and Take Back the Night, are not downloading from the cloud on either my iphone or ipad.  I have tried the previous suggestions.  Can you offer further advice.

    The last 2 songs I purchased, Treasure and Take Back the Night, are not downloading from the cloud on my iPhone 4 or my iPad2.  I have tried previous suggestions on the support page.  Can anyone suggest further solutions?

    Hello BwarsIG88
    Check your purchase history by going to the iTunes Store and then click on purchases. From there you can see all your purchase history and download what you are missing.
    Downloading past purchases from the iTunes Store, App Store, and iBooks Store
    http://support.apple.com/kb/ht2519
    Regards,
    -Norm G.

  • Infopath form not removed from central admin after retracting the solution

    I have InfoPath form admin appvoed deployed through Stat machine workflow when I retracting some forms are not removing from Central admin
    when trying to deploying it says
    Error 3 Error occurred in deployment step 'Add Solution': An object of the type Microsoft.Office.InfoPath.Server.Administration.FormTemplate named "urn:schemas-microsoft-com:office:infopath:" already exists under the parent Microsoft.SharePoint.Administration.SPFarm
    named "SharePoint_Config".  Rename your object or delete the existing object.
    I have tried renaming the file as well
    MCTS,ITIL

    Hey shahid
    try to use force command to uninstall/remove solution,then only add solution.
    if this not work out then first uninstall feature using force and manually delete feature folder from file system inside layouts.
    Regards,
    Rajendra Singh
    If a post answers your question, please click Mark As Answer on that post and Vote as Helpful
    http://sharepointundefind.wordpress.com/

Maybe you are looking for

  • MacBook Pro Will Not Reboot

    My MacBook Pro is having trouble restarting. I originally opened the laptop to start working and noticed the comouter was acting strange (reconnecting to Wifi after turning it off, Chrome wasn't loading). I decided to reboot the computer to see if th

  • Interface-Determination: selecting an interface mapping not possible

    Hi all, I configured a scenario CRM (IDoc) -> XI -> Oracle database using BPM. Now I want to configure the same scenario without a business process. But in the interface determination it's neither possible to drag&drop the interface mapping, nor sele

  • I've got nothing(gray screen, question mark folder) Please Help!

    This problem is on my girlfriend’s computer, about the same as mine, PB G4 800mhz 768mb RAM, 10.4.x I am a competent user and this one has me worried… Problem Last night she goes to the computer sends an IM checks her e mail, watch some tv, goes back

  • List output for LSMW

    Hi all, I have a recuirment to create a LSMW  and i need to list output as the summary section with the following details. Report run by : Report date : totla number of records uploaded: total number of records successfully loaded total number of rec

  • Testing switch step conditions

    Hi Is there a way to test conditions in switch step? With real data when the process is executed... it seems that the condition does not work... but I can not see more details to investigate what is wrong. Has anybody ideas how to test switch conditi