cocoa-touch

Display keyboard above toolbar?

I have a view with a bottom toolbar and a UIWebview that is loading an HTML page with some textboxes. Is there anyway when the user clicks on a textbox, the keyboard appears above the toolbar, that way it doesn't hide its buttons? ...

uitextfield delegate must be file's owner?

I've seen a few references (eg here) in response to folks having trouble getting the keyboard to dismiss in iPhone that say "double check that the delegate is attached to file's owner. Is this necessarily true? Or just standard practice? Can't I have other objects in my nib, such as a subclass of UIViewController, and make connections t...

How can I test Xcode Project on iPhone ?

I have developed a view based project in Xcode. It is successfully running in iPhone Simulator. But I want to test this project on real iPhone device to check the behavior of application. Is there any way I can test my application on iPhone device without buying Apple Developer's License? Thanks in advance. ...

UIImage couldn't load some png picture.

I Use the following code to load png image: UIImage *imageBack1 = [UIImage imageNamed:@"Bar1.png"]; UIImage *imageBack2 = [UIImage imageNamed:@"Bar2.png"]; imageBack1 work right when imageBack2's value is nil, Bar1.png and Bar2.png are located at the same place,but why Bar2.png couldn't be load? ...

MkMapView setRegion animation prevents touch events on Annotation Views

Hi there! We have a MKmapView with a bunch of Image Annotation where each Image annotation responds to touch by overriding these methods of AnnotationView subclass: -(void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event; -(void) touchesEnded:(NSSet *)touches withEvent:(UIEvent *)event Our map region is updated using [Mk...

How do I enter RGB values into Interface Builder?

How can I enter RGB or Hex color values for backgrounds in Interface Builder? I can select predefined colors but I would like to manually enter in RGB values. Where can I do this? ...

How to call a method in init method ?

My program looks like this: -(id)init { if ( (self = [super init]) ) { //TargetWithActions *targetActions= [[TargetWithActions alloc] init]; [self countDownSpeed123]; } return self; } -(void)countDownSpeed123 { countDownSpeed = 5.0f; } @end warning: 'TargetWithActions' may not respond to '-countDown...

How to get active subview (UIImageView) from UIScrollView

I have several UIImage subviews in one UIScrollView. I'm trying to emulate iPhones's Photos app. To enable pinch zooming, I have implemented UIScrollViewDelegate and the one thing I'm unable to figure out is this delegate function: (UIView *)viewForZoomingInScrollView:(UIScrollView *)scrollView; How do I find out which UIImage subvi...

IPad App Issue - Webview

Hi all I developing a Ipad application I am trying to use Webview but not able to open the URL in webview I am using following code NSURL *fileURL = [[[NSURL alloc] initWithString:@"http://www.google.com/"] autorelease]; NSURLRequest *requestObj = [NSURLRequest requestWithURL:fileURL]; [webview loadRequest:requestObj]; this code work...

Some problem with MPMoviePlayerController using in ipad application

Hi all I am using MPMoviePlayerController in Ipad application. Video is not showing but audio comes, same code working well for Iphone NSBundle *bundle = [NSBundle mainBundle]; NSString *moviePath = [bundle pathForResource:@"video" ofType:@"mp4"]; movieURL = [NSURL fileURLWithPath:moviePath]; MPMoviePlayerController *IntroMovie = [[M...

Optimizing drawing on UITableViewCell

I am drawing content to a UITableViewCell and it is working well, but I'm trying to understand if there is a better way of doing this. Each cell has the following components: Thumbnail on the left side - could come from server so it is loaded async Title String - variable length so each cell could be different height Timestamp String ...

How Do I Save What I have Drawn In A CGContext

I have drawn into a CGContext of a UIView. - (void)drawRect:(CGRect)rect { [self drawInContext:UIGraphicsGetCurrentContext()] } I would like to save what I have drawn to a png file. Is there a simple solution? EDIT: Based on suggestions below - here's what I have so far.... -(void)createImage { NSString* outFile = [NSHom...

UITableViewCell color issues with custom table view background

I have a UITableView with a custom background image set like this: self.tableView.backgroundColor = [UIColor colorWithPatternImage:[UIImage imageNamed:@"mybg.png"]]; The background appears fine, but my UITableViewCells (default cells, not custom) have some sort of weird tint to them, and the UILabel containing the "New Project" text a...

UITabBar customization

This looks like a long shot, but does anyone know of a way to: Position a UITabBar on the top part of the screen Change it's height You are welcome to suggest private API methods ...

Problem with cell background in UITableViewCell

I have a full list that populates a UITable. This I want to background the one of the cells with a different color and it works initially, but for some reason when I start scrolling the table up and down, it starts drawing more cells with the green background. Please note that there is ALWAYS one detailCell.detailTimeLabel.text that's ...

iPhone/iPad SDK: homescreen/Photos style grid view?

I'm building an iPad app, and would like to use a "tiled" display with objects arranged in a scrollable grid, similar to the iPhone/iPad home screen and the iPad photos app. What I'm trying to achieve: (iTunes link) Is there any pre-built way in the SDK to do this? If not, how should I go about creating my own? Update: I think I ...

Troubleshooting FORM POST problems

I'm using the following code to submit to a WCF service. I keep getting an error that the key is invalid. I have a webpage on the same server that I submit the same data (but different key) using a FORM POST. It works fine that way. I put the URL below all in a URL (including valid key from server webpage) and get the key is invalid ...

How to change a UIBarButtonItem in a UINavigationBar

I'm trying to set up a list of items that can be edited. I have a main view, with a UINavigationBar at the top and a UITableView directly under it. I'd like to have my "edit" button change to a "done" button on click, but I can't figure out how to do it. If I could do it in the code (not it interface builder), I could just replace it, b...

When we should use NSThreads in a cocoa Touch ?

I am writing a small game by using cocos2d. It is a shooting game. Player on one side and enemy on other side. To run the both actions of player shooting and enemy shooting do we should use threads ? Or can we do without using them. At present I am not using threads. But I can manage to do both actions of player and enemy at same time. S...

how can we count the time interval of the animation in cocos2d ?

Hi, I am doing my program in cocos2d. I am using NSDate to get the current time of the start of animation. And I know my animation takes 3 seconds. So I can get the time at completion of animation by using NSInterval and using the previous time and animation time. But, if If the animation time interval is not fixed how can I calculate t...