Replace one view with another with animation

Hello:
I'm clearly not following some basic principle here so I'd appreciate some guidance.
My intentions is to create a (quiz type) app with several screens (I'm assuming each of them will be a view that I will create in the Interface builder). The goal is to let user advance from screen 1 to screen 2 then to screen 3, etc. by answering multiple choice questions (presented as buttons). So when one button is clicked the current screen would slide to the left and the next screen would slide in. This animation is very much similar to the default Navigation-type app behavior, but in my case I do not need the navigation bar on top (since user should not be able to go back). By studying the latter example, I was able to find the following code that slides view controlers one over another:
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
SecondPage *secondViewController = [[SecondPage alloc] initWithNibName:@"SecondPage" bundle:nil];
[self.navigationController pushViewController:secondViewController animated:YES];
[secondViewController release];
but in my project, that doesn't seem to work, as, I'm assuming, I do not have the navigationController member.
What am I doing wrong here?

Hi Den -
Den B. wrote:
The issue I have now is how to change the initial UITableView to my own view (that I can design in the interface builder)?
Looks like you've made a lot of progress since your original question, so I'll skip the response I might have written earlier, unless you think it would be helpful to go back there. To your current question, I guess I should first ask "What initial UITableView?". My best guess is that you've found the Navigation-based Xcode template, which includes an instance of UITableViewController as the root view controller. Based on that guess, I take it you now want to replace the table view controller with a vanilla UIViewController so the root view needn't be a table view. Are these assumptions correct?
If so, here's how to make the replacement:
1) In RootViewController.h, change the super class from UITableViewController to UIViewController;
2) In RootViewController.m, remove all the lines from (and including) "#pragma mark Table view methods" upto -(void)dealloc;
3) Open RootViewController.xib, and select Window->Document from the top menu to make sure the "RootViewController.xib" window is open. This is the window that displays icons, not the editor window which displays the view. Delete the Table View icon (select it, then Edit->Delete). Then drag a UIView object into that window from the Library, then Ctrl-drag from File's Owner to the View icon to connect the 'view' outlet of File's Owner to the View object;
4) Double-click on the newly added View icon to open the IB editor window and populate that window with the subviews you want, returning to RootViewController.h and .m to add IBOutlet properties and IBAction methods as needed. Once RootViewController.h is saved you can make the required connections to File's Owner in IB.
Here's an example of how to hide the nav bar and transition to the next view from an action method:
// RootViewController.m
#import "RootViewController.h"
#import "SecondViewController.h"
@implementation RootViewController
- (void)viewDidLoad {
[super viewDidLoad];
self.navigationController.navigationBarHidden = YES;
- (IBAction)nextView {
SecondViewController *vc2 = [[SecondViewController alloc]
initWithNibName:@"SecondViewController" bundle:nil];
[self.navigationController pushViewController:vc2 animated:YES];
[vc2 release];
PS. It "suks" to go from being a pro on one platform to a complete noob on another
Many of us at this forum jumped from platforms such as Windows to iOS without any prior Cocoa experience, so you're among friends who understand the transition. In my case, after the first few weeks, I never wanted to see another dev environment again. So hang in there! It will be fun soon.
- Ray

Similar Messages

  • How to replace one variable with another in large number of queries

    Hello guys!
    I have this situation: our company needs to use one variable instead of another for certain amount of queries.
    Is there some way to automatically replace one variable with another for a certain characteristic in big number of queries ( like 150 - 200 ) ? Doing this manually would take lots of time)
    Apreciate your help!

    you could try (at your own risk) the following:
    1. search the technical id (ELTUID) of your variable in table RSZELTDIR
    2. see where this variable is used in table RSZELTXREF (by filling RSZELTDIR-ELTUIID in RSZELTXREF-TELTUID)
    3. add similar entries for your new variable
    4. delete the entries for the old variable (they're part of the key, so you can't simply "change" them)

  • Replace standard view with alternative view

    Hi Gurus,
    In CRM 5.0 we were able to replace a view with a different view (whether it was SAP standard or bespoke) by adding the appropriate substition controller details in the Runtime Framework Profile.
    We are now trying to do the same in CRM 2007 but we have not been successful.  I have gone into the SPRO entry "Maintain Runtime Framework Profile" and created "Z_RUNTIME" which is called in the Business Role.  It is set up with the following Work Area Definition:
    Application: BSPWD_BASICS
    View Set Name: WorkAreaHostViewSet
    View Area Name: WorkAreaView
    I have tried to replace the following controller as a test to change the standard view:
    BSP Application: ICCMP_BT_TIMERC
    Controller To Be Replaced: SrvTTimeRep
    BSP Application: IC_KNOWS_SEARCH
    Replacement Controller: MainWindow
    This hasnt worked, the view SrvTTimeRep still showed. 
    Just to reiterate, I'm not trying to enhance a view, I am trying to replace it with a totally different one.
    Any help offered is greatly appreciated, and will be reqarded with points!  Thanks in advance!
    Andrew G.

    Andrew,
    The difference is in CRM 2007 is that you don't modify the runtime framework profile globally.  Instead each application has concept of a component repository.xml that needs to be adjusted.  You actually need to enhance each component where you want to include the view into the viewset.  This will then create a Z-component repository of enhancements for the application, including a copy of the respository.xml file.  You then adjust the repository.xml using the tools provided to replace adjust the viewset defintion.  Now if your view lives in another component you will also have to define the proper component usages to use the view.
    I would recommend downloading or getting access to the CRM 2007 OKP materials or taking the CRM UI class which has an example of this method in further detail.
    Take care,
    Stephen

  • How to replace one char with two chars in email address policy?

    I very much like to replace the 'ß' char in the surname with 'sz'. However, applying filter '%rßsz%[email protected]' on 'Preußig' leaves me with '[email protected]'.
    So, how do I replace one char with two chars in email address policy?

    As far as I know, your only solution is to manually create such addresses instead of using e-mail address policy.
    Ed Crowley MVP "There are seldom good technological solutions to behavioral problems."

  • Switching from one View to another in the Portal

    Hi Experts,
    We have created many global views from one query.  We have created these in thr portal.
    Our problem is when we switch from one view to another, it will carry all the filter values from the previous view.  Ideally we only want to pass the values from the variable entry, not the filter values local to the view.
    Does anyone of you knows how to solve this problem?  I am trying to look at the Customer exit... and do something with the mapping.  But this one will affect all the drill-downs.  Any thoughts?
    Best Regards,
    Rose

    Hi,
    I have somehow solved it using the exit.  In this case the source and target query is really the same because we are just switching from one view to another using the the same query.  What I did in the exit was:
    -  If the source and target query are the same.
    -  remove all the mappings except the ones with object types "Variables".
    This ensures that:
    1) I only apply this logic if the source and destination query is the same.
    2) The restrictions that will be applied to the destination view when I switch
    from one view to another will always be only be the paramater values
    (default or entered by the user) when they first run the query.
    Best Regards,
    Rose

  • Passing Variables from one View to another

    First of all Hi this is my first post on the sap forums.
    Aplogies if I have come to the wrong place or if this question is very easy, but I am new to abap and web dynpro and have found myself struggling a little bit.  So I stumbled across this site and thought I would ask for help.
    My problem is this, I have 2 variables on my MAIN view, one called MONTH and the other called YEAR.  What I want to do is on a button click on the MAIN view pass the values of these variables to another view called SUMMARY_RPT and then use these variables in an SQL query I have on this view.
    Anybody out there that can help ?
    Many Thanks,
    George

    Hi George,
    Welcome to webdynpro abap community. To pass data from one view to another, you can should create two attributes (type string) in the attribute tab of of the component controller. Now these will act as global variable for you. Now you can access these attribute in your view in this way:
    wd_comp_controller->gv_val "gv_val is the name of the attribute
    Populate the value in it and use it anywhere you want.
    There is one more way to do the same.
    Create a node under context in component controller and create 2 attributes(type string) after that. Map this node to both the views. Now get the value of month , year and set these attribute with the same values with the help of code wizard in view 1. Now in the view2 simply read those attribute and you'll get the value of month and year which was entered in the first view. Read the attribute with the help of code wizard. Now you can use them accordingly.
    I would suggest you to use 1st method as it is better performance wise.
    I hope it helps.
    Regards
    Arjun

  • Transfer a parameter from one view to another

    Hi,
    Probably this question was asked many many times before, but then i probably use the wrong search criteria, because i can't find them.
    My question is simple: I am on a header view and depending on an action which i perform there, i want to fill a certain variable. I need the value of this variable in the next screen, which is on item level.
    What possibilities do I have to transfer this value? (I already tried with server->request->set_form_field and server->request->get_form_field/data, but this didn't work)
    Regards,
    Martijn.

    Hi,
       It is not clear in which context you are talking about. Could you please specify the view names.
    Server get form field etc are used in Core BSP applications generally.
    For BSP Workbench based views in the components, to share data between views there is a custom controller, and concept of component controller to share data between different components.
    All you have to do is:
    1. for your view, check out which context node has the field you want in different view
    2. create same context node in custom controller and same context node in second view
    3. right click in view 1 context node, bind it to custom controller context node
    4. right click in view 2 context node, bind it to custom controller context node
    This way, data will automatically flow from one view to another.
    Also, to get instance of custom controller anywhere in IMPL class, you can use method get_custom_controller.
    I hope it helps.
    Thanks,
    Rohit

  • How modify data one view from another view in Cluster view

    Hi,
    I have a cluster view which includes two independent maintenance views. These views have not a direct relationship.
    If I would append or change or delete records in the first view I want to add or change or delete some records in the second view.
    1.
    I have tried to use Extended Table Maintenance Events of the first view to modify the second but I cant access to the TOTAL and EXTRACT tables the second view from the fist view.
    Is there any way to get access from one view to another using Extended Table Maintenance Events?
    2.
    I have tried to use the Event 04/VC: Before Saving the Data in the Database of the cluster view. I can access and modify the second view internal table using routines
    READ TABLE vcl_struc_tab WITH KEY object = 'ZFIRST_VIEW' INTO structab_wa.
    if  not structab_wa-UPD_REQU is initial.
       perform VCL_SET_TABLE_ACCESS_FOR_OBJ using 'ZSECOND_VIEW' changing error_flag.
       it_tbl_second = <VCL_TOTAL>.
       loop at it_tbl_second into wa_second.
         wa_tbl_second-vim_action = 'U'.
         modify it_tbl_second from wa_second
       endloop.
    endif.
    But to save modified entries of the second view to database I have to twice press SAVE buttons.
    The first time I have pressed SAVE above routines are executed and modified entries appear only in the second view internal table. The second time I have pressed SAVE modified entries appear in the database.
    I would like user press SAVE button only once. How I can do it?
    Regards,
    Malnor
    Edited by: Malnor on Nov 30, 2010 9:11 PM

    If I would append or change or delete records in the first view I want to add or change or delete some records in the second view
    Without a dependant field how will you perform this operation ?
    You have to link the fields in the tables, generate maintenance view, add it to cluster view and do it.

  • How to refer one view from another view?

    Hi,
    I have 2 views in my Adobe Flash Builder mobile app. I need to refer the first view in my second view.
    How to refer one view from another view? Or how to create a reference to a view wherever needed?

    I don't need any data from my first view. In a certain flow, I need to make my first view to be invisible.
    for eg., My First view is in portrait mode. I change the device to Landscape. In the landscape mode, I want to show a completely different view (second view).
    In this case, what happens is, I see my first view in Landscape mode for a second. Then the second view appears. When I change to Landscape mode, only the second view should be seen. I need to make my first view to be completely invisible in the OnOrientationChanging event of
    StageOrientationEvent
    As stage object and StageOrientationEvent works at application level, I need to know how to refer my first view object in the application level.
    private function onOrientationChanging(soe:StageOrientationEvent):void
          MyFirstView.Visible = False; ====> don't know how to refer MyFirstView here
    Is my question clear now?

  • How to include one view into another view

    Hi SDN's,
                   Could any please tell me,How to include one view into another view.
    In my requirment.I want to create a 'Z' view for an interface .In that  view i have to take,
    1) Ship-to-email adrr by
                              LIKP-KUNNR -> KNA1-ADRNR
                              KNA1-ADRNR -> ADR6-ADDRESNUMBER.
    2) E-mail addr of person who created the document.i.e
        LIKP-ERNAM -> USR21-BNAME.
        USR21-ADDRESNUMBER ->  ADR6-ADDRESNUMBER 
        USR21-PERSNUMBER -> ADR6-PERSNUMBER.
       In both the case we have to pass ADDRESSNUMBER to ADR6 table.
    If we pass these condition it fails,B'Coz at a time it passes Two ADDRESSNUMBER and a PERSNUMBER.
    So i created two which fetches only the email addr of  person who created the document.and another view fetches Ship-to-email addr.
    Now i want to include the second view into first view . Is it possible?or please
    tell me someother way to get these email addresses in a single view.

    hi
    as per my knowledge, nested views are not possible. However, while creating a new view, selection method will not giv u option to select the already created view(S) except the tables..i think so.
    regards,
    shamim

  • HOW TO GET THE SELECTED VALUE IN A ROW FROM ONE VIEW TO ANOTHER VIEW?

    hi all,
    I  have a small issue.
    i have created two views.In the table of the first view i'm selecting a row and pressing the button it will move to next view.
    i am adding some fields manually in the table of the second view and pressing the save button.Here all the values should get updated corresponding to the field which i have selected in the first view.
    I want to know how to get the particular field in the selected row from one view to another view.
    Kindly help me.

    Hi,
            Any data sharing accross views can be achiveved by defining CONTEXT data in COMPONENT CONTROLLER and mapping it to the CONTEXT of all the views. Follow the below steps.
    1. Define a CONTEXT NODE in component controller
    2. Define same CONTEXT NODE in all the views where this has to be accessed & changed.
    3. Go to CONTEXT NODE of each view, right click on the node and choose DEFINE MAPPING.
    This is how you map CONTEXT NODE and same can be accessed/changed from any VIEW or even from COMPONENT CONTROLLER. Any change happens at one VIEW will be automatically available in others.
    Check the below link for more info regarding same.
    [http://help.sap.com/saphelp_nw04s/helpdata/EN/48/444941db42f423e10000000a155106/content.htm]
    Regards,
    Manne.

  • How to pass field symbol or table from one view to another view in abap web dynpro?

    I am creating an Inbound Outbound ALV report in ABAP Web Dynpro. However at selection-screen I have select options and fetching is done at view2. Problem is we can pass parameter using inbound outbound parameters but how to pass internal table or field-symbols from one view to another view? I made use of Assistance Class too but its not very clear to me. Please give me some example or code to sort this problem out.

    I am creating an Inbound Outbound ALV report in ABAP Web Dynpro. However at selection-screen I have select options and fetching is done at view2. Problem is we can pass parameter using inbound outbound parameters but how to pass internal table or field-symbols from one view to another view? I made use of Assistance Class too but its not very clear to me. Please give me some example or code to sort this problem out.

  • Passing Multiple table row from one view to another view

    Hi,
    How to Passing Multiple table row from one view to another view in Web Dynpro Abap. (Table UI Element)
    thanx....

    Hi Ganesh,
    Kindly do search before posting.. this discussed many times..
    First create your context in component controller, and do context mapping in two views so that you can get values from
    one veiw to any views.
    and for multiple selection, for table we have property selection mode.. set as multi and remember context node selection
    selection cardinality shoud be 0-n.
    so, select n no of rows and based on some action call sec view and display data.( i think you know navigation between veiw ).
    Pelase check this...for multi selection
    Re: How to copy data from one node to another or fromone table to another table
    for navigation.. check
    navigation between the views
    Cheers,
    Kris.

  • Replace Materialized View with Flashback?

    I'm building a Data Warehouse with the following:
    1. Tables populated throughout the day using CDC from the Application DB
    2. MVs on those tables to keep a daily snapshot of the tables for reporting.
    3. End users access the data through views with VPD applied, on the MVs
    My systems team would like the solution to use as little storage as possible and currently I effectively have a copy of the app DB in the DW tables and would need another copy in the Daily MVs. (It is an insurance DB, so it is complex with lots of data, > 1.5 TB)
    One way to reduce the storage could be to use flashback to keep a static daily version of the tables, so
    At midnight I'd recreate the views like:
    CREATE OR REPLACE VIEW client
    AS SELECT *
       FROM   client_tab
       AS OF TIMESTAMP (TO_TIMESTAMP(TRUNC(SYSDATE)));This would replace my refresh MV script. The end users would then refer to the client view in their reports
    We would obviously need enough undo to store a days worth of data to ensure the flashback views remain consistent, but this is much less than the space required for a full copy. On a busy day there would be about 1% data change.
    No DDL will occur on the tables during the day
    Is there anything else I should be aware of? Can you let me know if (and why) this would not be a good idea?
    This will run on Oracle 11.2.0.1
    Thanks,
    Ben

    I guess I'm having some trouble visualizing the basic data model...
    In most data warehouses that I've seen in the financial industry, reporting the position/ balance/ etc. at a given date involves scanning a single daily partition of each fact table involved and then hitting dimension tables that may or may not be partitioned (slowly changing dimensions would often have effective and expiration date columns to store the range of time a row was valid for, for example). Year-over-year reporting, then, just has to scan two fact table partitions-- the one for today and the one for a year ago. You may not store every intermediate change if there are potentially hundreds of transactions per account per day, but you'd generally put the end state for a given day in a single partition.
    In one of your updates, it sounded like the 1.5 TB of data was just for the data that constituted end-of-day yesterday plus the 1% of changes made today which would imply that there was at least 15 GB of UNDO generated every day that would need to be applied to make flashback query work. That quantity of UNDO would make me pretty concerned from a performance perspective.
    I would also tend to wager that VPD policies applied to views that are doing flashback query would be problematic. I haven't tried it and haven't really worked through all the testing scenarios in my mind, but I would be somewhat surprised if that didn't introduce some sort of hurdle that you'd have to work through/ work around.
    Justin

  • Swapping & Releasing Views with Animation

    I'm trying to create new dynamic custom views based on a date parameter, with animation to replace the current view (as a subview in a container) with the new one. I guess I'm missing some basic memory management here because as the app functions fine, memory gets gobbled up with each transition and is apparently not being released. And everything I've tried with copying, release, etc. either stops the transition from working or EXECBADACCESS errors.
    Here's the code (and there is a property, self.currentView, that holds the initial current custom view):
    - (void)showNextViewUsingDate:(NSDate *)date {
    MyCustomView *nextView = [[MyCustomView alloc] initWithFrame:myFrame andDate:date];
    nextView.delegate = self;
    [UIView beginAnimations:nil context:NULL];
    [UIView setAnimationDuration: 1.5];
    [UIView setAnimationTransition:UIViewAnimationTransitionFlipFromLeft forView:myViewContainer cache:NO];
    [self.currentView removeFromSuperview];
    [myViewContainer addSubview:nextView];
    [UIView commitAnimations];
    self.currentView = nextView;
    Again, this works visually, but it just seems like I'm not releasing memory (the instance variable nextView should be released automatically, right?). Thanks for any tips.

    I think that things will become clearer if you distinguish between objects and variables. Objects have retain counts, variables don't. There's no such thing as releasing a variable. Only objects can be retained or released. And a local variable such as nextView falling out of scope at the end of a function does not release anything.
    You haven't said how your currentView property is declared, so no-one is going to be able to help you. But let's assume that it was declared with @property(retain).
    In that case
    self.currentView = nextView
    is shorthand for
    [nextView retain];
    [currentView release];
    currentView=nextView;
    Once you've expanded it like this, you'll see that it's nonsense to do
    [currentView release];
    self.currentView=nextView;
    Your second example:
    self.currentView=nextView;
    [nextView release];
    cannot have failed for the reason you state ("both pointers point to the same object"). Remember that 'release' doesn't deallocate anything: it only decrements a count that says how many things are pointing to the same object. When that count is reduced to zero, the object is deallocated: not before.
    Let's say that you started off with a view called ALICE, and that your 'alloc' creates a view called BOB. Let's also say that somehow a pointer to ALICE has already been stored in 'self.currentView' and that ALICE has somehow already been made a subview of 'self'.
    - (void)showNextViewUsingDate:(NSDate *)date {
    // ALICE = 2, BOB = 0
    MyCustomView *nextView = [[MyCustomView alloc] initWithFrame:myFrame andDate:date];
    // ALICE = 2, BOB = 1
    nextView.delegate = self;
    [UIView beginAnimations:nil context:NULL];
    [UIView setAnimationDuration: 1.5];
    [UIView setAnimationTransition:UIViewAnimationTransitionFlipFromLeft forView:myViewContainer cache:NO];
    [self.currentView removeFromSuperview];
    // ALICE = 1, BOB = 1
    [myViewContainer addSubview:nextView];
    // ALICE = 1, BOB = 2
    [UIView commitAnimations];
    self.currentView = nextView;
    // ALICE = 0, BOB = 3
    [nextView release];
    // ALICE = 0, BOB = 2
    I can't help with the cause of the crash itself, but it is important not to give the wrong reason to it!
    The first thing you can check: does everything work if you don't do the animations? If it does work then I have a bit of a suspicion that you should retain a use count on ALICE until the animation has completed. It's not difficult to try that, at least, using setAnimationDidStopSelector.
    Properties are a Bad Thing, I find, because they cause so much confusion about what is retained/released automatically. They look too much like variables, that's the trouble, especially when the name of a property is the same as the name of a variable.

Maybe you are looking for

  • Error in account determination: table T030K key CNFX MWS

    Hi,      i have a issue when releasing the billing document .i have a issue like "Error in account determination: table T030K key CNFX      MWS".  Actually iam trying to map the scrap process. User requirement is , when upload the non valuated materi

  • Possible to DECOMPOSE a fcp sequence like in AVID?

    A quick question.... How simple is it to decompose the video of a sequence and then re-digitize the material? I'm an Avid editor making the switch and I'm still a little hazy about fcp media management. If I load my project at lo-rez (offline photo j

  • Integrating Multiple systems - best practice

    Hi, I need to integrate the following scenario let me know the best practice with steps. Scenario is end to end syncrhonous A system(supports open tech i.e webservice client) => SAP PI<=>Oracle(call stored procedure) => Update in ECC=> Reponse back t

  • HELP!!  White frame where Flash movies should be!!!

    Can't figure a single reason why this is doing what it's doing. Everything works fine before I create the projector.....but once I launch it and test, all my Flash movies are just white frames of the same size as the movies are supposed to be. No sou

  • Zen v plus 2GB free

    <font face="Courier New" size="4" color="#ff3399">My zen v plus 2GB frooze. I reset it and when I turn it back on it freezes agin with in a couple of seconds. wut can i do 2 fix it's