uikit

How can I draw an CGImageRef context on the screen?

I have a beautiful CGImageRef context, which I created the whole day to get alpha values ;) It's defined like that: CGContextRef context = CGBitmapContextCreate (bitmapData, pixWidth, pixHeiht 8, pixWidth, NULL, kCGImageAlphaOnly); So for my understanding, that context represents somehow my image. But "virtually", non-visible somewhe...

Is it possible to have more then one animation delegates at the same time?

I'm concerned that this is impossible, because +setAnimationDelegate: of UIView is a class method. But maybe I am wrong with that? Background: The problem is, that I have many objects of the same class, and I want to implement a method which does some nice animations specially for that object. Those animations are a little complex and c...

What kind of value can I set in the context parameter for UIView +beginAnimations:context:?

I don't understand this: + (void)beginAnimations:(NSString *)animationID context:(void *)context (void *) ----> what kind of data can I provide here? ...

How can I reset a layer transformation to the original state after I did some animations and transformations?

I have a image that rotates around a few times by random and then disappears. After it appears again, I want it to be in the original state. Not rotated. I would keep track of how many rotations I applied randomly and then calculate how many radians I have to re-do that. But I slightly remember from the big docs that there was some ident...

How can I recognize a tap on a UIImageView-subclass inside a UIScrollView?

I tried it with this code in my UIScrollView-subclass: - (void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event { NSLog(@"he/she touched me"); } I also made sure that in the initialization of my view, this gets called: self.userInteractionEnabled = YES; But when the scroll view doesn't move and i tap on my subview a few...

At which point can I securely access the frame in a UIImageView subclass?

I've subclassed an UIImageView. After self = [super initWithImage:image] I try to access the self.frame.origin.y value. But it is always 0.0. One moment later, in a method that gets called from the outside, the property is fully there with a nice 100.0. I also tried to override -(id)initWithFrame:(CGRect)aRect, but the result is the...

Why does the transform of the presentationLayer represent the state of the finished animation, while the animation is running?

The documentation says: The presentation tree contains the values that are currently being presented to the user as an animation takes place. For example, setting a new value for the backgroundColor of a layer immediately changes the value in the layer tree. However, the backgroundColor value in the corresponding laye...

How to resize image to fit UITableView cell?

How to fit UIImage into the cell of UITableView, UITableViewCell (?). Do you addSubview to cell or is there a way to resize cell.image or the UIImage before it is assigned to cell.image ? I want to keep the cell size default (whatever it is when you init with zero rectangle) and would like to add icon like pictures to each entry. Image...

iPhone's UITextView - how do you know when a text you append is out of view

I have a UITextView that I am appending texts to from time to time, but I am unable to find an API that tells me whether the text I am appending is out of view or not so I can send a scrollToRange message to UITextView. Is there a way to do this? ...

What can I do with an CALayer delegate?

There seems to be an delegate that can be set like myView.layer.delegate = anObject The documentation just says: delegate Specifies the receiver’s delegate object. @property(assign) id delegate I wonder what kind of methods that delegate would implement, and when they would be called. Could solve some big problems ...

Why is finished always zero/NO when an animation ended and the delegate-method from the didEndSelector is called?

My delegate for ended animations looks like this: (void)animationDidEnd:(NSString *)animationID finished:(BOOL)finished context:(void *)context for some reason, the finished is always NO in my animation chain. But I need to know if an animation in my chain has finished completely. Example: Something says: "move to (20,100)". And as ...

Where is the difference between an "transform" and an "affine transform"?

There is a function like: CATransform3DGetAffineTransform Returns the affine transform represented by 't'. If 't' can not be exactly represented as an affine transform the returned value is undefined. I'm not so math-orientated, so a easy to understand description would be very nice. Wikipedia was no big help here. ...

how to get input from UIAlertView?

I want take player name as input by using UIAlertView. Is it possible to add textField on the UIAlertView? ...

Changing the background color of a UIAlertView?

I want to change the background color of my UIAlertView, but this doesn't appear to have a color attribute. ...

Auto-rotate the default application image according to current landscape mode

Hello! Is it possible to auto-rotate the default application image according to current landscape mode? I can rotate my views just fine according to information from the UIDevice class, but I would like the whole application to be in the correct landscape mode from the start. ...

pushViewController debugging

I am trying (from my 3rd child in the heirachy) to load the root view with the following. This does not work and I get the following error when the below code is run. -[DetailViewController clickButton:]: unrecognized selector sent to instance 0x1161e00' Code: MapViewController *dvController = [[MapViewController alloc] initWithNib...

UIImageView subclass duplicate the image

Hi I am working on a subclass of UIImageView and one of the things I require is when the object is initalised with the initWithImage: message a 'copy' is created. I must be confusing something because I can't see what is not working here.. - (id)initWithImage:(UIImage *)image { [image retain]; if (self = [super initWithImage:image]) {...

How to set UIcolor to deep blue

Hello, How can I set UIcolor to have a deepblue values (like 330099, shown in interface builder) programmatically? Thanks. ...

What's better: Writing functions, or writing methods? What costs more performance?

Currently I am making some decisions for my first objective-c API. Nothing big, just a little help for myself to get things done faster in the future. After reading a few hours about different patterns like making categories, singletons, and so on, I came accross something that I like because it seems easy to maintain for me. I'm making...

How can I get a precise time, for example in milliseconds in objective-c?

Is there an easy way to get a time very precisely? I need to calculate some delays between method calls. More particular, I want to calculate the speed of scrolling in an UIScrollView. ...