How to Switching View Transition?

Discussion in 'iOS Development' started by momolgtm, Dec 10, 2009.

  1. momolgtm

    momolgtm New Member

    Joined:
    Nov 11, 2009
    Messages:
    11
    Likes Received:
    0
    Device:
    iPhone 3G (White)
    hello..
    I am novice in this regard.
    How to switching view transition the sample file below..
    PageCurl, flipvertical or horiz..
    Thanks in advance..
    ..
    momolgtm
    momolgtm@gmail.com

    Attached Files:

  2. Steaps

    Steaps New Member

    Joined:
    Oct 24, 2007
    Messages:
    5,074
    Likes Received:
    41
    Device:
    iPod touch
    Don't just add the new views to the subview. Create the UIViewController, then call
    [OBJC][self presentModalViewController];[/OBJC]

    You can then use:

    [OBJC]yourViewController.modalTransitionStyle = <yourstyle>;[/OBJC]
  3. ipodmail09

    ipodmail09 Member

    Joined:
    Mar 13, 2009
    Messages:
    269
    Likes Received:
    0
    Device:
    2G iPod touch
    I still dont get where to place the code ???


    [OBJC]- (IBAction)One

    Please Register or Log in to view images

    id)sender
    {
    One*Level = [[One alloc] initWithNibName:nil bundle:nil];
    [self presentModalViewController:Level animated:YES];
    }[/OBJC]
  4. momolgtm

    momolgtm New Member

    Joined:
    Nov 11, 2009
    Messages:
    11
    Likes Received:
    0
    Device:
    iPhone 3G (White)
    Hello Steaps..
    Thank you for your interesting
    Can you make the above example on the file ..
    momolgtm
  5. Steaps

    Steaps New Member

    Joined:
    Oct 24, 2007
    Messages:
    5,074
    Likes Received:
    41
    Device:
    iPod touch
    If you had any idea what you were doing, you'd understand.

    Just paste that one line i have above in there..
  6. ipodmail09

    ipodmail09 Member

    Joined:
    Mar 13, 2009
    Messages:
    269
    Likes Received:
    0
    Device:
    2G iPod touch
    ok i did that but i cant get the animation name like what it is called ???? [OBJC]- (IBAction)One

    Please Register or Log in to view images

    id)sender
    {
    One*Level = [[One alloc] initWithNibName:nil bundle:nil];
    [self presentModalViewController:Level animated:YES];
    One.modalTransitionStyle = "What Goes Here";
    }[/OBJC]
  7. Steaps

    Steaps New Member

    Joined:
    Oct 24, 2007
    Messages:
    5,074
    Likes Received:
    41
    Device:
    iPod touch
    Documentation.
  8. Axis

    Axis Super Moderator Staff Member

    Joined:
    Dec 2, 2007
    Messages:
    6,288
    Likes Received:
    133
    Device:
    iPhone 4S (White)
    You should really at least try to conform to Objective-C naming conventions. First a class name of "One" is very ambiguous, and does not foster readable, debuggable, portable (etc.) code. Second, instances of classes (objects) should not have names beginning with a capital letter. This is important for differentiating between classes and objects. Finally, "modalTransistionStyle" is a property not of the class UIViewController (which is the superclass of class "One" I assume) but of instances of it. In other words, you don't set the modalTransistionStyle of the class, as that method does not exist. You must call it upon an instance of the class, in this case the poorly-named "Level" object.

    Also, while there are some questions that the documentation cannot answer, yours is surely not one of them.
  9. Steaps

    Steaps New Member

    Joined:
    Oct 24, 2007
    Messages:
    5,074
    Likes Received:
    41
    Device:
    iPod touch
    Wow, i didn't even notice that he used the class name instead of the instance of the class. And since it's ipodmail, I think a FAIL is required.

    To those who dont' understand the reference:
    http://www.ifans.com/forums/showthread.php?p=1805178#post1805178
    http://www.ifans.com/forums/showthread.php?p=1784283#post1784283
  10. ipodmail09

    ipodmail09 Member

    Joined:
    Mar 13, 2009
    Messages:
    269
    Likes Received:
    0
    Device:
    2G iPod touch
    i see you could be that bothered to keep track of me, that makes me feel special

Share This Page