uikit

UITableView section header in editing mode only

The table view section headers in my plain (non-grouped) UITableView only appear when the table has been placed into editing mode. This is because I have two sections in the table view: Active and Inactive. I only wish the Active section to be displayed normally, but require both Active and Inactive to be displayed when in editing mode. ...

Zoom UIScrollView with multiple images

I have a UIScrollFrame that contains multiple UIImageViews. What is the correct way of supporting zoom in such a control? Which view should 'viewForZoomingInScrollView' return? ...

get the UIImage (or CGImage) from drawRect

I'm calling the following code from drawRect - (void) drawPartial:(UIImage *)img colour:(UIColor *)colour { CGContextRef context = UIGraphicsGetCurrentContext(); CGContextSaveGState(context); CGContextTranslateCTM(context, 0.0, self.bounds.size.height); CGContextScaleCTM(context, 1.0, -1.0); CGContextDrawImage(c...

iPhone SDK: Rendering a CGLayer into an image object

Hi all, I am trying to add a curved border around an image downloaded and to be displayed in a UITableViewCell. In the large view (ie one image on the screen) I have the following: productImageView = [[UIImageView alloc] initWithImage:[UIImage imageNamed:product.image]]; [productImageView setAlpha:0.4]; productImageView.frame = CG...

Popping UIView programmatically failing.

I am having trouble programmatically removing stacks from a view. I am doing things a bit convoluted, which is certainly not helping matters. Here is what I want to do: User is in one tab of a tab view controller. User selects item from table that contains URL. App switches to another tab view, and sets an existing UIWebView to the sel...

How to create an timeline on iPhone

Hello, I am trying to create an inifite timeline in my iPhone app to scroll through time. I think I am going to use a UIScrollView to do that but I am not sure how to do that. Am I supposed to create a reusable queue of views from scratch with views containing the days/months/years and reuse them when they go out of the screen ? (I have...

read from NSMutableDictionary without leaks ;)

Hello everyone. I've searched for some time already so I ask my question. I want to display data in a UITableView. each content of each cell of this tableview is set in an object specially created for this purpose (cellPlainObject). a cellPlainObject contains many strings, images and so on ... theses cellPlainObject are storred in a N...

How to figure out the font size of an UILabel when -adjustsFontSizeToFitWidth is set to YES?

When myLabel.adjustsFontSizeToFitWidth = YES, UILabel will adjust the font size automatically in case the text is too long for the label. For example, if my label is just 100px width, and my text is too long to fit with the current font size, it will shrink down the font size until the text fits into the label. I need to get the actual ...

Best way to set default tint for UINavigationController

I use a lot of UINavigationControllers in my app. I am using a UIColor to set the tintcolor of the navigationBar. This works as expected, but I am trying to find an easy way to set a default tintcolor for all UINavigationControllers. What is the best way to do this? Is it subclassing the UINavigationController, or is there something ...

Cell Dequeue problem when table inside another table's cell content view

I am using two table views (Main Table and Sub Table), one table inside other's cell. I am adding Sub Table in Main Table's cell content view. I am also using different Cell Identifier for both table cells. Now, issue is : When - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath is ca...

Cocoa Touch : A method each time view is shown?

hi, there is a method called viewDidLoad that execute a code when the view is loaded is there a method that do the samething but each time the view is shown? ...

iphone - passing an object on an UIToolbarButton action

Is that possible to make a UIToolbarButton pass an object to its target by using some exoteric method (as it seems not to be possible using regular button use)? I mean something like UIBarButtonItem *Button = [[UIBarButtonItem alloc] initWithImage:buttonImage style:UIBarButtonItemStylePlain target:self action:@selector(doSomething:) ...

Custom Keyboard (iPhone), UIKeyboardDidShowNotification and UITableViewController

On an iPhone App, I've got a custom keyboard which works like the standard keyboard; it appears if a custom textfield becomes first responder and hides if the field resigns first responder. I'm also posting the Generic UIKeyboardWillShowNotification, UIKeyboardDidShowNotification and their hiding counterparts, like follows: NSMutableDic...

Can UIDatePicker's minimumDate and maximumDate include time?

Need a UIDatePicker with specific maximum and minimum dates and times. Currently NSDatePicker.minimumDate and .maximumDate appear to only consider the date. What's the proper way to handle this? ...

iPhone - Reset UINavigation Controller

Hey there, I have a UINavigationController inside a UITabBarController. When a user presses the first tab, I want to reset the navigation controller back to the first screen instead of displaying whichever view they last selected in the navigation controller. Is there an easy way to reset the stack? Thanks, Howie ...

Is it possible to use PVRTVC textures in UIImages?

I'm running into some issues with having a lot of UIImages in memory, so I was wondering if there is any way of using PVRTC images instead of PNGs in UIImages. ...

Cocoa Touch text view with aligned, justified text

I am trying to create a textview with predefined height that will contain justified text. When entering the text into the view, I need to be able to check when the view is full. How would I do this? Core Text? I am using sdk-3.2. ...

Enabling bookmarking on a UIWebView (to make shortcuts on springboard)

I wan't to add shortcuts on my springboard form my application. The way i'm following is loading a UIWebView and then trying to add a bookmark. But I can't figure out how to add the "+" button to bookmark the content of my WebView... Is there a way to do so ? Or is there another way to add shortcuts on the springboard programmatically...

How to set iPhone tab bar icon in code?

I am using the same ViewController for several different views. When instantiating the ViewController for a specific view, is there an easy way to specify the tab bar icon via code? ...

iphone - calculating the font size

I have to show a label with font size = 14 when the view is 480x320. Supposing I would like to do this in a way that my code will be working well for all future device's screen sizes, including iPad and others following (I am sure more will come), what is the best way to do that? I could do this proportionally, I mean, if the scale in...