cocoa-touch

setting multiple UITextView's to editable causes cursor to blink between them

I'm attempting to set the UITextViews in a set of UITableViewCell's to editable when the user taps the "edit" button for the UITableView. Each UITableViewCell has a UITextField (cell.blurb). This code will set each UITextView to editable, however, the cursor alternates very rapidly between each one. I'm pretty sure it's a responder ch...

Cocoa Touch - Timers

How can I make a timer that counts down from 3 and then runs a method? How would I do that? ...

UIView Subclass initWithFrame not being called?

I have a custom UIView subclass. In IB, I have specified a "placeholder" UIView and set the class to my class name. My override of drawRect method is working, and the background is coloring properly, but the initWithFrame is not firing. Why? - (id)initWithFrame:(CGRect)frame { NSLog(@"initWithFrame"); if ((self = [super initW...

Downloading large amount of images, making it faster...

I need help with downloading from webserver... What i currently do is get XML file from web servers that contains image locations, parse XML, download each image, store image on iphone, and store image name to sql database. This takes lots of time because there is large amount of images to be downloaded and i am downloading one by one....

How to remove a subview if triggered from one of its components?

I'm looking for a smart way to remove a subview (with removeFromSuperview) when the subview itself (or precisely said one of its components) triggered the removal. As for the source code this would be like UIView * sub_view = [[[UIView alloc] initWith... UIButton *button = [UIButton buttonWithType... [sub_view addSubview:button]; [se...

Target iPhone Simulator Macro Not Working

Using the TARGET_IPHONE_SIMUATOR macro results in the same constant values being defined in am application. For example: #ifdef TARGET_IPHONE_SIMULATOR NSString * const Mode = @"Simulator"; #else NSString * const Mode = @"Device"; #endif - (void)applicationDidFinishLaunching:(UIApplication *)application { ... NSLog(@"Mode: %@", M...

Toggle UIButton on the iPhone

How can I make a button that says "Show Picture" and when it's clicked it changes to "Hide Picture". I'm new to objective C, I know how to make a button in interface builder but don't know how to switch the button's text and function. Can someone help me out? ...

Core Data Navigation with Relationship.

My Core Data model looks like this: The players relationship of the entity Game is a to many relationship and will hold all the player objects related to that Game entity. I have a UITableView that looks like this <-- link . The Table View displays all the games, how would I, when selecting a Game show/push another UITableView to dis...

Make UIView resign first responder when tapped outside of view

Is there any way to make a UIView resign its first responder status when the user taps outside of the view bounds? ...

What is the difference between a popup and a popover (i.e. NSPopupButton vs UIPopoverController)?

I was just wondering why the name popover was chosen vs a hypothetical UIPopupController. ...

UIBarButtonItem icon white when added via IB, black when added programmatically

When I add an icon to a UIBarButtonItem via the Interface Builder, the icon is displayed white. When I add the same icon file programmatically to another UIToolbar, the icon is displayed black. Why? UIImage *image = [UIImage imageNamed:@"icon.png"]; UIButton *button = [UIButton buttonWithType:UIButtonTypeCustom]; [button setImage:image ...

How to add a badge to a UITabBar that is customizable?

I am adding a badge to my UITabBarController's UITabBar as such: UITabBarItem *tbi = (UITabBarItem *)[stTabBarController.tabBar.items objectAtIndex:1]; tbi.badgeValue = @"2"; However, my UITabBarController is customizeable, so the index may change. How can I make sure the badge gets applied to the correct UITabBarItem? ...

Programmatically discover identity of first responder

I want a UITextField to be sent the resignFirstResponder message if it is being edited and a user touches elsewhere on the screen. Since there are several text fields I need a way to programmatically determine which one is the first responder to send it the message. How can I do this? Is there some sort of global first responder object? ...

How to change background color in iPhone app

I tried this code in the view controller, but it didn't work. Why is that? - (void)viewDidLoad { [self setBackgroundColor:[UIColor colorWithRed:1.0 green:1.0 blue:1.0 alpha:1.0]]; [super viewDidLoad]; } ...

The relationship between UIViewController and UIView

I'm trying to understand how these two are connected. Every time you make a UIViewController does it also automatically come with its own UIView? Also are these from Cocoa or Objective-C? ...

How to communicate between objects

Still having trouble with this language. Ok, let's say I have two objects. The first is my application delegate, the second is a custom view containing the various buttons that make up the main menu. When a button is clicked, it is the menu that responds. However, I need to make use of certain instance variables in the application deleg...

Bundle ID Suffix? What is it?

I'm new to the iPhone submission process. Apple asks for the Bundle ID Suffix. What is this? Not sure what to put here and what the significance of it is. ...

How can I determine if a view has been loaded for the first time?

I want to detect the very first time my view is displayed. After that, I wan't to forget about it. Where can I set a BOOL to do this? ...

Cocoa Touch - Color of a round rect button?

Is their anyway to change the white part of a round rect button with out making a custom button? ...

Cocoa Touch - int as string format

playerOneScore is a int, How can I pass it to use a label to display the score? This code just prints %i... -(void)updateScoreLabels{ playerOneScoreLabel.text = @"%i",playerOneScore; playerTwoScoreLabel.text = @"%i",playerTwoScore; playerThreeScoreLabel.text = @"%i",playerThreeScore; playerFourScoreLabel....