cocoa-touch

How do I get my app to prevent switching back to portrait mode during navigation?

When a user moves their iPhone, my views switch appropriately between portrait and landscape mode with no problem using the following code: -(BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation { // Return YES for supported orientations return (interfaceOrientation == UIInterfaceOrientationPortra...

Have WebView zoomed by default

Is it possible to have a WebView zoomed in by default. Im trying to place and advert in my application and would like it to be zoomed to 100% by default so it fills the space. Being able to disable zooming would also be a benefit but I cant disable all interaction as I would like them to be able to click the link ...

How to link to Google Map directions from iPhone app

I have been developing a location based application and would ideally like to link directly to the directions using the Google application. I have seen a few applications such as AroundMe which already seem to do this but I can't work out how they have managed to implement it ...

NSURLRequest and requested page

Hi There, Im trapping link clicked information in a UIWebView in the shouldStartLoadWithRequest delegate. I am using mainDocumentURL to get the url of the linked clicked. This shows the complete url but I need JUST the name of the page i.e .html, .htm etc requested. I cant see any property that would return this. Do i need to parse and e...

Bind Action to UIButton

In my AppController I'm loading a View with the following code. - (void) loadSettingsController { settingsViewController = [[SettingsViewController alloc] initWithNibName:@"SettingsView" bundle:nil]; UIButton *button = settingsViewController.loginButton; [button addTarget:self action:@selector(saveSettings:) forControlEvent...

iPhone or Cocoa: Handling order of multiple HTTP requests

When working with Cocoa/Cocoa-Touch and the iPhone SDK, a typical convention is to build a client which speaks to a server-side web server. One common problem I face when programming is making multiple HTTP requests in sequence, sometimes up to 5-6 requests. The order in which the requests are made is not linear in which they will return...

initializing a class. Can you see any problems with this?

-(id)init { if (self = [super init]) { self.name = [[NSString alloc] init]; self.type = [[NSString alloc] init]; self.phoneNumber = [[NSString alloc]init]; self.webAddress = [[NSString alloc] init]; NSMutableArray *pricesArray = [[NSMutableArray alloc] init]; NSMutableArray *poolsArray = [[NSMutableArray alloc] init]; self.pric...

Simple application structure. What do you think?

I'm interested in the way I am retaining my properties and the aspects of memory management. This is for a simple application that edits the information of a class that is stored in a table. There are 3 ViewControllers. A list view (list all classes) a detail view of the selected item (lists properties of selected class) an edit view...

How can I control the color of the text used in a magnify window?

We are using a UITextView with a dark background. As such we have made the text white color in order to be easier to read. The problem is the magnify window that pops up when you hold down your finger to move the insertion point uses white for the text color as well. This makes it impossible to see exactly where the insertion point is...

set view property in a UIViewController from a NIB programatically (not during initialization)

At the beginning of my app, I am initializing a UIViewController with a NIB. At some point, I am removing the view from the screen, then releasing it, so it no longer takes up memory. (At this point I am also saving the state of the view in the UIViewController) At a later point, I want to recreate the view and bring it back on screen...

Creating a navigation view in Interface Builder

I'm trying to create a navigation view in the Interface Builder. It's not in the MainWindow.xib, so the relevant sample project on the Apple Dev. site is useless. The most logical (and cleanest) way to approach this seems to create a Xib-file where the File's Owner is a subclass of UINavigationController - however, I cannot get this to ...

UIImageView inside UITableViewCell does not get updated

Hi I am creating a custom UITableViewCell to include an image and some related text. I am getting the images from the Internet and while the images load, I display a temporary image. I am using a separate thread to get the images. Once an image is downloaded, I am firing a method on the main thread to set the image in the UIImageView (...

UIViewController rotate methods

What object is responsible for dipatching the UIViewController rotation method calls, i.e: – shouldAutorotateToInterfaceOrientation: – willRotateToInterfaceOrientation:duration: – willAnimateFirstHalfOfRotationToInterfaceOrientation:duration: – willAnimateSecondHalfOfRotationFromInterfaceOrientation:duration: – didRotateFromInterfaceOri...

UIApplication launching the phone app and returning user to the wrong screen

My iPhone app initiates a phone call with: NSURL *phoneURL = [NSURL URLWithString:[NSString stringWithFormat:@"tel://%@", @"11111111"]]; [[UIApplication sharedApplication] openURL:phoneURL]; This is from a UIView inside a UINavigationController. It is not the root UIView however. When the phone app is finished with the call and retu...

Back button not rendering

I have an overlay that I want to slide in my cocoa-touch application. I have created the view controller for it and the corresponding nib. The nib just has a View with a text field in it. I move to the view using: [[self navigationController] pushViewController:[[[AddPlayerViewController alloc] initWithNibName:@"AddPlayerViewController...

How do I make a reusable XIB with it's own UIViewController ?

I am trying to create a reusable "picker". It is basically like a keypad of a phone. Since I will be using this a lot in my iPhone app, I have been frustrated with trying to make it appear. It is in its own XIB file and has its own UIViewController subclass as the FileOwner. However, when I instantiate this with: MonthPickerViewControl...

Is it possible to observe a readonly property of an object in Cocoa Touch?

I've attempted to observe the (readonly) visibileViewController property of a UINavigationController with no success. I was able to successfully observe a readwrite property I defined myself for testing purposes on another class. Is it possible to observer readonly attributes? ...

Is It Possible to NSLog C Structs (Like CGRect or CGPoint)?

I want to be able to debug C structures without having to explicitly type every property that they consist of. i.e. I want to be able to do something like this: CGPoint cgPoint = CGPointMake(0,0); NSLog(@"%@",cgPoint); Obviously the '%@' won't work, hence the question. ...

Recreating the call menu on the iPhone

I've been looking through the iPhone's UI catalog and cant seem to find what I'm looking for. Essentially I want a customizable version of the 'in call' menu as found on the iPhone so I can use my own icons and call my own functions. Example of 'in call' menu: http://cache.gizmodo.com/assets/resources/2007/08/call-vodafone.jpg UIAler...

How do I put files into the Documents folder in xcode for iPhone development?

I would like to put some sample images in the applications Documents directory. Can I put these somewhere in my xcode project or do I have to programmatically add them to the Documents folder from the project resources? Users will be able to add their own images (which will be written to the Documents folder) and I would prefer not to a...