cocoa-touch

iPhone - User Defaults and UIImages

Hello, I've been developing an iPhone app for the last few months. Recently I wanted to up performance and cache a few of the images that are used in the UI. The images are downloaded randomly from the web by the user so I can't add specific images to the project. I'm also already using NSUserDefaults to save other info within the app. ...

UIButton doesn't appear on UIToolbar

I have a UIToolbar where I have dragged a UIButton. When I set the button properties to Custom, and assign an image (or background image) the graphics don't appear. However, when I give it a custom text, the text will appear. Why is it that the images don't appear? ...

iPhone/iPad : Check for invalid characters in a textbox made for Integers only

I noticed that the iPhone OS is pretty good about picking out Integer values when asked to. Specifically, if you use NSString *stringName = @"6("; int number = [stringName intValue]; the iPhone OS will pick out the 6 and turn the variable number into 6. However, in more complex mistypes, this also makes the int variable 6: NSStrin...

iPhone - how to store documents consisting of multiple images?

My iPhone (actually, iPad) app creates documents that consist of several images, plus a bit of metadata. What's the best practice for storing these sorts of documents on disk? I see two main options: Create a folder for each document, and store my images as separate PNG files within the folder (plus another little file for the metada...

Why does my UIButton.titleLabel.text disappear when I place an image in the button?

I've had this problem before but was able to work around it until now, Basically I'm creating a custom UIbutton setting its image as a uiimage and then the button that has had a label until I implimented the below code now loses its label. I need that label because it is set programatically in code that follows. NSString *imageName = [...

Editing a UIViewController from another class.

I am trying to programmatically change the user interface of a UIViewController from another NSObject class. The problem is that I am unsure of how to access the UIViewController's view from the NSObject class. So for example, in my NSObject class, I say something like: self.view = [[UIView alloc] initWithFrame:CGRectMake(0, 0, 320, 480...

How to cache text entered in the UITextField?

I have a requirement where i need to enter a text in the text field and when i come out of the view and again open the same view where text field is present, i need the text entered earlier need to appear on the textfield(caching) before the user enters the text for the second time.. Please help me.. ...

How to handle HTML Strings in Cocoa Touch

I'm using a RSS Reader and works fine when I tap the UITableViewCell to load the <link> either in a UIWebView or to open Safari on that link. But I really want to learn how to load the Topic content into the application instead showing the entire site or jump to Safari In the RSS feed per each <item> there is a <body> tag (and a <Descr...

Storing imageView in NSDictionary iphone sdk

Hi all, I'm my application I want to pass an UIImageView to NSDictionary. Can anybody please help. It's urgent. Thanks in advance. ...

Do [sprite stopActionByTag: kTag]; work differently for CCAction and CCSequence ?

//prog 1 -(void)gameLogic:(ccTime)dt { id actionMove = [CCMoveTo actionWithDuration:1.0 position:ccp(windowSize.width/2-400, actualY)]; [actionMove setTag:6]; [self schedule:@selector(update:)]; [hitBullet runAction:actionMove]; } -(void)update:(ccTime)dt { if ( (CGRectIntersectsRect(hitRect, playerRect)) ) { [[[self getAc...

UIScrollView setZoomScale not working ?

Hi, I am struggeling with my UIScrollview to get it to zoom-in the underlying UIImageView. In my view controller I set - (UIView *)viewForZoomingInScrollView:(UIScrollView *)scrollView { return myImageView; } In the viewDidLoad method I try to set the zoomScale to 2 as follows (note the UIImageView and Image is set in Interface Bui...

Items mixed up after scrolling in UITableView

When I scroll in my UITableView, the cells become mixed up. What am I doing wrong? This is my method: - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { static NSString *CellIdentifier = @"Cell"; UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdent...

problems with didselectrowatindexpath

hi there, i have just converted an app i was making from a navigation controller app into a tab bar app. an everything works fine apart from this one thing, the first of my tabs brings in a table view,and what i want to happen is when a user selects a cell i want it to push on a different view controller(like it did when it was a navig...

What's a good way to create an Event Calendar

Hi, I want to create an Event Calendar for my iPhone App. In a first instance the Event Calendar is supposed to list the Events and have a Details View with additional info. It is also supposed to contain an action to trasfer a specific event to the iPhone Calendar. First thoughts go towards using a UITableView where I make the event da...

How to add a cell to a UITableView?

I want to be able to add 1 cell to the top of a UITableView after the user clicks on a button. How can I achieve this? Update: I also want to hide the cell if the user clicks another button ...

UITableViewCells with different cell sizes

Is it possible to have a UITableView that has a fixed height for all cells, except for the cell at the top (index 0)? If so, how is this possible? ...

What is the difference between a View and a View Controller?

from an iphone development perspective ...

Buttons inside of a Pop Over Controller on the iPad

I am attempting to create a popover similar to this in an iPad app. Does anybody know if there is a built in way to do this? Is it a UISegmentedControl inside of a UIPopoverController? ...

UITableView loading before variables being set

I have a label on a UITableView. When clicked it will refresh my tableview and set the top cell's height. When I am setting the cell height, I am checking if a certain variable is TRUE. If true it will show the large height, if false, the smaller height. At the time of cell height creation, my variable is always false. It is a member va...

NSNumberFormatter, how to remove blank spaces in currency symbol

I'm having some values that I need to format into a currency string. It seems that when using NSNumberFormatter to format an amount, the resulting currency string will contain one or more blank spaces. For instance using the following piece of code to format @"1000" into the European currency format will result in returning @"1,000,00 €...