Hi,
I in my AppDelegate, I use:
ActivitiesViewController *acController = [[ActivitiesViewController alloc] initWithNibName:@"ActivitiesView" bundle:[NSBundle mainBundle]];
UINavigationController *acNavController = [[UINavigationController alloc] initWithRootViewController:acController];
[self.tabBarController setSelectedIndex:0...
I'm getting this error message when I Build&Go:
*** Terminating app due to uncaught exception
'NSInvalidArgumentException', reason:
'-[UIViewController
_loadViewFromNibNamed:bundle:] was unable to load a nib named
"TestappViewController"'
I created a blank new project and then started to create a RootViewController which ho...
How could I make sure that iPhone doesn't disable the screen or go to sleep for about 20 to 30 minutes?
...
They say:
// Release any retained subviews of
the main view. // e.g. self.myOutlet =
nil;
I've never seen that previously. so I wonder if they talk about nib outlets here?
...
I have tried this:
CGRectMake(0.0f, kFooBarHeight, 100.0f, 10.0f);
I get an error "unexpected ';' before ')'", and "too few arguments for CGRectMake". When I exchange this with:
CGFloat foo = kFooBarHeight;
CGRectMake(0.0f, foo, 100.0f, 10.0f);
then all is fine. Are constants not suitable to pass along as parameters?
...
I think a value of 1.0 represents one second, but I'm not very sure with that. Is that a hexadecimal system? What would you provide to give exactly one minute for duration?
...
I am rotating a view with this:
CGAffineTransform rotatedTransform = CGAffineTransformRotate(CGAffineTransformIdentity, rotationValue);
I have an object which I want to spin around for about 320 degrees. Now Core Animation is clever and just rotates it as much as needed, doing that by rotating it with -40 degrees. So the object rotate...
I have some nested views like this:
First, there is an big UIView. Inside this, there is another UIView. And inside this, there is an MyNiceButtons class that inherits from UIView. So I have:
UIView > UIView > MyNiceButtons (= an UIView).
In detail, the UIView creates an UIImageView and adds it as a child view to itself, which repres...
Is there a way to determine where in the cell was tapped?
I am currently using tableView:didSelectRowAtIndexPath but this only tells me that the cell was selected.
...
I have a Core Animation running and want to pause it when a button is pressed. So there is a method -pauseAnimation. When the animation is paused, I want the animated view to stay in the state as it currently was while animating. i.e. if a view moves from top left to bottom right, and somewhere in the middle the animation is paused, the ...
i.e. %@ for strings, %f for doubles... I don't know the word for these placeholders but it would be great to have list for how to print booleans and other values.
...
I have an class, and in the header I define this:
@interface MyViewController : UIViewController {
BOOL blackBackground;
}
@property(nonatomic, assign) BOOL blackBackground;
In the implementation I have the @synthesize for blackBackground.
Then, I instantiate this object and do:
[myViewController setBlackBackground:YES];
now t...
This is for learning:
I have an UIView which is transparent and covers almost the whole screen. I left 50 pixels at the top. It is a child of the View Controller's view.
Underneeth the UIView there's MyView that inherits from UIView, which matches the screen size. And inside this MyView class, I ask for a touch on it very simple with...
I've been reading that M3G is something based on OpenGL ES...so can I work with this on iPhone OS? Did anyone do that already?
...
Imagine an iPhone app, which starts with an standard UIView showing some buttons and stuff. Then there is a stats button, you tap it, and the UIView slides away. Instead an OpenGL ES view comes in, and shows a nice statistics curve.
I know you can mix OpenGL ES with UIView somehow but people say it's a bad idea. Does this also apply if...
For some reason Xcode tells me that it doesn't find symbols as soon as I use something like kCAFillModeForwards. There must be a library or class that I have to include...but which one? The normal Core Animation stuff works fine like [myView beginAnimations...]. What's the trick to get the more sophisticated animation stuff to work?
I'v...
Example:
1) fade an uiview from alpha 0.0 to 0.2
2) fade back to 0.15
3) fade to 0.25
4) fade to 0.2
5) fade to 0.35
6) fade to 0.3
7) fade to 0.45
8) fade to 0.4
... and so on. each with a duration of 0.05 sec. The effect is a flashy appearing view. Just for fun.
Previously I did this with simple UIView animation blocks, where every n...
I've seen this in a snippet:
animation.repeatCount = 1e100f;
my math classes are long time ago. So 1e100f would be a number with 100 zeros? So in this case the programer wanted to have infinite repeatCount?
...
I have a simple iphone application that paints blocks using a subclass of CALayer and am trying to find the best way to save state or persist the currently created layers.
I tried using Brad Larson's answer from this previous question on storing custom objects in the NSUserDefaults, which worked for persisting my subclass of CALayer, bu...
I've found this code snippet:
[self setValue:direction forKey:@"currentDirection"];
CAKeyframeAnimation * animation = [CAKeyframeAnimation animationWithKeyPath:@"position"];
animation.path = path;
animation.duration = grids * gridWidth / [self speed];
animation.fillMode = kCAFillModeForwards;
animation.removedOnCompletion = NO;
animati...