uikit

How to calculate the size of a UIFont when text in label is constrained down to fit width?

Imagine a UILabel, which is 200 pixels wide and 50 pixels high. The label has text inside, and the label makes the text smaller so that it fits into the label. But now, how would you get the size of that UIFont how it is visible in the label? Lets imagine the font size was given with huge 100, and the label squeezes it down to 15. And th...

How to safely encode µ or the micro-symbol into an NSString programmatically?

I need a representation of µ or "micro". That funny small u with the long tail on the left side. Maybe you can see it here: µ Some weeks ago I was reading in the docs, that it's a bad idea to type any special characters into the source code. So to prevent problems, could I encode that special character µ somehow like web folks do with  ...

How do I get a UIImage from an image file on my server?

How do I get a UIImage from a small image file on my server (can be .jpg or .png)? ...

Why isn't my UIViewController in the responder chain for its view?

I have written a subclass of UIViewController which creates a view programmatically, instead of loading it from a NIB file. It has a simple loadView method: - (void)loadView { UIScrollView *mainScrollView = [[UIScrollView alloc] initWithFrame:[[UIScreen mainScreen] bounds]]; self.view = mainScrollView; [mainScrollVi...

Does NSMutableArray's -removeLastObject RELEASE the object?

I'm talking about methods like -removeAllObjects, -removeLastObject, etc for NSMutableArray. The documentation only says that these methods 'remove' the object from the array. Are the removed objects released? ...

what does -arrayWithArray actually DO?

I want to see EXACTLY how it creates an array. How can I view the .m files that show how it's done? ...

How do I draw multiple CGContextRefs to -drawRect?

I have saved a bunch of CGContextRefs and I want to draw all of these out in the drawRect portion of my UIView. How can I do this? ...

How do I create a mutable array of CGImageRefs?

I want to keep a mutable collection of CGImageRefs. Do I need to wrap them in NSValue, and if so how do I wrap and unwrap them properly? Can I get away with using a C array? If so how do I construct it and how do I add elements to it later? Is it significantly more costly to use UIImages instead of CGImageRefs as the elements of the coll...

Adding tableview cells at a specific interval of time

I have a tableview. I need to add cells of the tableview at a particular interval of time after loading so that we can view loading the cells.How can i do this. Any idea will be greatly appreciated! ...

How to tell if my iPhone is in manner/silent mode?

How do I determine programatically whether or not the iPhone is in manner mode? And is there a way to tell if the headphones are connected? Edit: This is also called silent mode in some parts of the world. ...

Modal View changes dimensions of original view?

I am specifying the dimensions of a UITabBarController, which is positioned at coordinates 0x 40y on the screen. I then call a ABPeoplePickerNavigationController to view a contacts list. I was able to specifiy the location of the contacts list to match the position of the UITabBarController. However, I am having problems restoring the UI...

IPhone - Get reference to cells that are currently on screen.

I have a Table View Controller with cells. I want to update the text that is displayed on the visible UITableViewCells. Is there a way to get a reference to the cells that are currently on the screen? ...

UIButtons at the bottom of a UIScrollView are not receiving touches.

I am writing an iPhone app with a tab bar and navigation bar. At a certain point, I am pushing an instance of my DetailsViewController class onto the navigation controller stack to show it. This controller creates its view hierarchy in code: the controller's view property is set to a UIScrollView, which contains a plain UIView (let's c...

How can I blend between my UIView and my EAGLView?

I have an opengl scene rendering on an EAGLView layer and some other elements (circles and such) rendering on a UIView (which is a sibling of the EAGLView, positioned above it). Is it possible to blend colors between the two layers? I'd like to do some difference blending to get an inversion effect on the colors from EAGLView. I've ...

Custom animation for pushing a UIViewController

Hi, I want to show a custom animation when pushing a view controller: I would like to achieve something like an "expand" animation, that means the new view expands from a given rectangle, lets say [100,100 220,380] during the animation to full screen. Any suggestions where to start, respectively any documents, tutorials, links? :) hei...

Why is sizeWithFont:constrainedToSize:lineBreakMode: returning an incorrect size?

I have two possible widths for a string i want to display in a label in a table cell, and i need to compute the height so that the table cell's height is recorded correctly. however, no matter what I do for the constraining size i get the same height, which is incorrect in the case i want. The code i'm using: CGFloat width = 300.0f; N...

UIInterfaceOrientationLandscapeLeft and UIInterfaceOrientationLandscapeRight are reversed?

The documentation says: UIInterfaceOrientationLandscapeLeft The device is in landscape mode, with the device held upright and the home button on the right side. UIInterfaceOrientationLandscapeRight The device is in landscape mode, with the device held upright and the home button on the left side. However, I'm getting...

iPhone app is in landscape mode, but view's bounds is still portrait

What's really going on behind the scene when you set the phone's orientation to landscape mode? When I traced out main screen's bounds and any subview's bounds, the width and height is still 320x480, rather than 480x320. Any idea why? ...

iPhone - Center UIImage in UIImageView

I have a UIImageView. I get a UIImage from a URL. The image displays in the UIImageView, but I can't get it to center correctly. The UIImage is 80 x 68 pixels. The UIImaveView's size is 90 x 90. When I display the UIImage in the UIImageView the UIImage is shrunken so that it fits, although it is already smaller than the UIImageView....

Enabling Swipe-to-delete while showing reorder controls on UITableView

I am looking to allow reordering of UITableViewCells and deleting via swipe to delete, but not via the red delete circle. - (void)loadView { [super loadView]; [table setEditing:YES animated:NO]; } - (void)tableView:(UITableView *)tableView commitEditingStyle:(UITableViewCellEditingStyle)editingStyle forRowAtIndexPath:(NSIndexPath *)i...