uikit

Do something if view loads

Hi, I shift to my view by [[self navigationController] popToViewController:controller animated:YES]; In that ViewController, I'm not able to get a notice, that it comes back to front (e.g. by viewWillAppear). I want to reload a table, as soon as the view is visible again. How do I get a notice, that the view comes back on the scree...

How can I move an rotated view relative to the coordinate system of it's superview?

When changing the center point of an 10 degrees rotated view, the specified coordinates for the center point will not match the coordinate system of the superview. As an example, when you want to go straight up by y - 50, and no horizontal movement (i.e. x = theRotatedView.center.x), the shift in y-direction will be rotated. The view wi...

Does UIView's addSubview really retain the view?

I ran into a situation that seems to suggest otherwise. In the following code snippet, if I remove the line: self.navigationController = nav, the root controller's view won't show up, suggesting to me that addSubview might not actually retain the view as otherwise suggested. Any idea? - (void)applicationDidFinishLaunching:(UIApplicati...

Setting UIImage dimensions on UITableViewCell image

I've got a standard UITableViewCell where I'm using the text and image properties to display a favicon.ico and a label. For the most part, this works really well since UIImage supports the ICO format. However, some sites (like Amazon.com say) have favicon.icos that make use of the ICO format's ability to store multiple sizes in the same ...

UIWebView in multithread ViewController

I have a UIWebView in a viewcontroller, which has two methods as below. The question is if I pop out(tap back on navigation bar) this controller before the second thread is done, the app will crash after [super dealloc], because "Tried to obtain the web lock from a thread other than the main thread or the web thread. This may be a result...

Presenting modal view occasionally hides the navigation bar

I've come across this twice now. Sometimes using the following line of code: [self.navigationController presentModalViewController:aViewController animated:YES]; displays the view, but the navigation bar is then hidden. I can write: [self.navigationController setNavigationBarHidden:NO]; to my hearts content, everywhere I can ...

uibutton title alignment and multiline support

How do I set the title of a UIButton to be left aligned and, how can I show multiple lines of text in a UIButton? thanks and regards, raju. ...

Error building pch file with CPP definitions

We're adding CoreData support to our iPhone app. It's a far reaching change (moving from SQLitePersistentObject). To avoid branching, we are running a single codeline with the new code within #ifdef blocks. When I enable this code from one of my headers (#define CORE_DATA_BUILD) everything works fine. When I create a new target and defi...

UITableView Index and Scrollers

I have a UITableView with about 400 entries so I'm using sections and an index. I'd also like to see the scroller to indicate position in the table as the sections vary in size considerably. It looks like there is enough room to display the scroller next to the index, but I don't see how to do this. I have the scrollers enabled in IB and...

UIKit. How to set Transparent color?

Is there any way to set any color of UIImage (or it CALayer content) as transparent color? I cannot use single image resource(PNG file) with built-in transparency. I need to hide some area from first Layer by overlaying second Layer with specific color at that place. So I need to set this specific color as "transparent color" before ...

How do I give a UITextView focus programatically?

Hello, So I want to bring in a modal view controller that has a UITextView in it and I want the keyboard to automatically popup and the UITextView have focus. I found a way to accomplish this by doing the following: textView.editable = YES; textView.editable = NO; This just seems hacky to me, is there another way? ...

How to know when dismissModalViewControllerAnimated is initiated and also when it is done?

Is there a way to know when the dismissModalViewControllerAnimated is initiated and when it is completed (such as the idiom for viewWillAppear and viewDidAppear)? Unlike other animations, this one doesn't seem to have a delegate that tells you. ...

Differentiating Between UITouch Objects On The iPhone

Hey guys, I'm trying to differentiate between two (or more) UITouch objects on the iPhone. Specifically, I'd like to know the order in which the touches occurred. For instance, in my -touchesBegan:withEvent: method I get an NSSet of UITouch objects. Now I can find out how many touches there are, but, which object represents which finge...

Handling zooming and panning inside UIWebView

Hi all, I am using a UIWebview for loading the web pages in my application. Since the UIWebView automatically supports the zooming and pinching effect, so it there any way to control this zooming and pinching effect? I want to trace the scaling of the view? Is there any way to handle the zooming and panning inside the UIwebView ? An...

Is there any ready-made calendar control for iPhone apps?

I am building an applicaiton for the iPhone that will display upcoming and past events. I settled for a list view, but then I realized that a calendar (just like the one displayed in the "month" view in the built-in Calendar application) would be a best match (that is, this one). However, the iPhone Human Interface Guidelines just menti...

How to deal with non-visible rows during row deletion. (UITableViews)

I am performing a deletion of several rows of a table. In fact, on this occasion all visible cells are in fact deleted. This causes the cell immediately below the visible frame to become visible after the animation, since all cells above it are now gone. Here is the issue, this cell is also deleted. So I get the following error, I assu...

Pattern to update a UItableView and its datasource after filtering with NSPredicate.

This seems like it should be straight forward. Technically I can make this work, but if I want to perform certain UI animations, (using deleteRowsAtIndexPaths:withRowAnimation:) things get hairy. It seems as though the datasource and UI are fighting over who should delete first. Then I have to artificially keep data around for the UI up...

How to delete the last row of a section?

Hello, This problem has kept me busy for the last hours. I have two sections with one row in each section. When I delete the row in one of the sections than it throws an exception saying this is an invalid update (number of rows/sections before and after the update are not the same). This is understandable as I delete the last row of a ...

UIProgressView: How to get the old style?

Hi, I'm searching for the old style of the UIProgressView: The only UIProgressViewStyle, I'm able to present is this: Is the old one still available? Setting the property UIProgressViewStyle always leads to the blue UIProgressView. ...

What's UIBarButtonItem's possibleTitles for?

In UIKit, UIBarButtonItem has a property called possibleTitles. How is that being used? ...