cocotutch
02-16-2009, 11:00 PM
Hiya,
Since SkylarEC so kindly told me that CATransitions are not impossible and are actually quite easy, I was wondering whether anyone could submit a Tutorial here on a project that;
Opened up a basic UIWindow.
Contained a Nav Bar and a Tool Bar.
Had one Button present which triggered the switch from the current view to the next view, via a "PushFromRight" CATransition.
And a button present on the other view which switched via a "PushFromLeft" back to where you started again.
I have this code:
[timeView2 removeFromSuperview];
[timeView2 release];
[self addSubview:view03];
CATransition *animation = [CATransition animation];
[animation setType:kCATransitionPush];
[animation setSubtype:kCATransitionFromRight];
[[UIApplication sharedApplication] setStatusBarHidden:NO animated:YES];
[animation setDuration:kAnimationDuration];
[[self layer] addAnimation:animation forKey:kAnimationKey];
Which is doing my head in. It works to get to the next view, but whenever I tap another button, i.e. in the other view, which I have class files for, it crashes due to an "Uncaught Exception".
My steps:
Made my view, Identified it as "View02" and created the Source Files.
Opened up the files and modified them as neccessary with a few UIViewAnimations and stuff to get it right, and then put the above code in to switch from a "Touch Activated" Image View to a "Confirm the close of this view" View.
The above works.
I then:
Went into IB, Identified the "Confirm the close of this view" View, and called it "View03".
Added an outlet and two actions (the Menu, the view that was switched from, and a Yes and No Button).
Wired them up after Merging the files.
Entered the "CATranstion" code to go from the current view back to the menu.
The above refuses to work. I wired the actions up, but putting [self removeFromSuperView]; doesn't seem to work?
This may sound really stupid, and n00bish, but could someone write a quick App/Tutorial on how to do this stuff properly?
cocotutch
NB: God damn, I hope Apple adds AppleScript to iPhone in the next revision or two, would make creating things a helluva lot easier, then keep Cocoa for the implementations.
Since SkylarEC so kindly told me that CATransitions are not impossible and are actually quite easy, I was wondering whether anyone could submit a Tutorial here on a project that;
Opened up a basic UIWindow.
Contained a Nav Bar and a Tool Bar.
Had one Button present which triggered the switch from the current view to the next view, via a "PushFromRight" CATransition.
And a button present on the other view which switched via a "PushFromLeft" back to where you started again.
I have this code:
[timeView2 removeFromSuperview];
[timeView2 release];
[self addSubview:view03];
CATransition *animation = [CATransition animation];
[animation setType:kCATransitionPush];
[animation setSubtype:kCATransitionFromRight];
[[UIApplication sharedApplication] setStatusBarHidden:NO animated:YES];
[animation setDuration:kAnimationDuration];
[[self layer] addAnimation:animation forKey:kAnimationKey];
Which is doing my head in. It works to get to the next view, but whenever I tap another button, i.e. in the other view, which I have class files for, it crashes due to an "Uncaught Exception".
My steps:
Made my view, Identified it as "View02" and created the Source Files.
Opened up the files and modified them as neccessary with a few UIViewAnimations and stuff to get it right, and then put the above code in to switch from a "Touch Activated" Image View to a "Confirm the close of this view" View.
The above works.
I then:
Went into IB, Identified the "Confirm the close of this view" View, and called it "View03".
Added an outlet and two actions (the Menu, the view that was switched from, and a Yes and No Button).
Wired them up after Merging the files.
Entered the "CATranstion" code to go from the current view back to the menu.
The above refuses to work. I wired the actions up, but putting [self removeFromSuperView]; doesn't seem to work?
This may sound really stupid, and n00bish, but could someone write a quick App/Tutorial on how to do this stuff properly?
cocotutch
NB: God damn, I hope Apple adds AppleScript to iPhone in the next revision or two, would make creating things a helluva lot easier, then keep Cocoa for the implementations.
