cocoa-touch

Where to put project files?

When I first started using Xcode, I didn't like the default project files location. Instead, I made a folder in my user directory instead. Now, I think that is a mistake, since I now link to libraries in my user folder. If I share code with someone, it breaks (since my user folder isn't located on their machines). What's the best prac...

How do I put the 'M' in MVC using Interface Builder

I agree with the answers given at http://stackoverflow.com/questions/569940/whats-the-best-way-to-communicate-between-viewcontrollers but what if I'm using the Interface Builder to design my application Views? Without using the Application Delegate, how can I reference Model objects from within Controller objects? As far as I can tel...

Core Location opt-in protocol

Is there any documentation the defines the protocol followed by iPhone OS to obtain the Core Location opt-in from the user? I've observed that the user is shown a dialog the first two times an application is run. The dialog asks the user if it's OK for that particular application to use location information. Once the user has approved...

Scrollable menu using MenuItem's

What I am trying to accomplish with Cocos2d, is to create a horizontal menu, which can be swiped from left to right. I posted an image, to show my idea. The image below has a white bar, where I want to show MenuItem objects, now I want to be able to do a swipe in the white region, so that the next menu item is centered. The problem I...

What's the difference between a View XIB and an Empty XIB?

I know that the View XIB has a view already in place, but are there any other differences? I've read tutorials which say to create a View XIB, change the class and delete the view, then insert a Table View and remake the connections (File's Owner to the Table View, Table View delegate and datasource back to the File's Owner). Is there an...

Defining and using protocols in objective-c.

Hi, I'm trying to extend NSImageView so I can delegate the drag/drop responsibility to the controller. It all works fine with the one problem that the compiler is now displaying warnings about sending messages to objects with type id. To solve this I assumed I would simply have to suffix the ivar's type with the name of the protocol. Ho...

UITextField - capture return button event

Hi, How can I detect when a user pressed "return" keyboard button while editing UITextField? I need to do this in order to dismiss keyboard when user pressed the "return" button. Thanks. ...

Change text of "return" keyboard button

Hi, How can I change the standard text of "return" button to something else? I want it to be "add" Thanks. ...

Change color of magnifying glass

Hi, The color of a magnifying glass is being taken automatically from the background color of UITextView. Under the text view I have an image and the text view background itself is opaque. So in this case the magnifying glass is white even though the picture under UITextView is yellow. Is it possible to override the color of magnifying...

Get a UITableView to not scroll and grow within a UIScrollView

I need to create a screen that is similar to the one below. The only way I can come up with is to have a UIScrollView be the parent view. Then have a UIImageView and UILabels for the thumbnail and main text ("All3Sports"). For the sections like the phone numbers and home page, I thought I could have a UITableView and have it simply no...

how to set image for uitabbarcontroller in cocoa code

Hi I am creating a tab bar controller in xcode and not in interface builder. the titles of the views in the tabs set the titles in the tabs but I'm unsure how to set images. Can anyone help? ...

how to set individual tabbaritem icons in uitabbarcontroller in cocoa

I was answered how to set images in general for a uitabbarcontroller. however my uitabbarcontroller is an array of views that looks like: tabBarController = [[UITabBarController alloc] init]; viewTab1controller = [[ViewTab1Controller alloc] initWithNibName:@"ViewTab1" bundle:nil]; viewTab1controller.title = @"Sched...

Repeating events on a gregorian calendar in Cocoa Touch

How would I set up a gregorian calendar in cocoa touch and set an event that will repeat every X days? Thanks ...

Point not in Rect but CGRectContainsPoint says yes

If I have a UIImageView and want to know if a user has tapped the image. In touchesBegan, I do the following but always end up in the first conditional. The window is in portrait mode and the image is at the bottom. I can tap in the upper right of the window and still go into the first condition, which seems very incorrect. - (void)t...

iPhone Flipside Template (Utility Application): Where did the view come from ?

When I start a project with the Utility Application Template (which has a flipview), I get 3 .xib files. When I open the "MainWindow.xib", I get two rectangular pieces. One of them represents the window. The other is called RootViewController. This has a view in it. My question is : 1) How is this view represented, because there is n...

iPhone save the rotated UIImage

I want to save the rotated image to the photo library. I have a UIImageView in which the image is displayed. I used the below snippet to flip the image. The rotated image does get displayed since I transform the image view. But while saving the image I get the original image (not flipped). How do I save a flipped image? #define DEGREES_...

TouchXML parsing XML attributes

How do I use touchXML to parse this XML? I want to store all the attributes as key/value pairs in a dictionary. <Player PlayerName="Padraig HARRINGTON" CurrentPosition="1" CurrentRank="1" Country="IRL" NumberOfHolesPlayed="18" ParRelativeScore="+3"> <RoundScore RoundNumber="1" Score="74" /> <RoundScore RoundNumber="2" Score="68"...

Using undocumented iPhone SDK features?

Hi, In my app, I am using the following undocumented feature: UIAlertView *alertView; [alertView addTextFieldWithValue:@""label:@""]; UITextField *textField = [alertView textFieldAtIndex:0]; Is it ok to use to have my application approved for distribution? Or I should replace this code? ...

Objective-C - Test for object instance being dealloced/freed

There's some way to test for an objective-c instance for being dealloced/freed (retain count == 0)?? By example, object A have a reference (pointer) to object B, but object B can be freed in memory low levels, how i test reference B to be sure it was dealloced?? @interface A : NSObject { B b; } @implementation A { - (void) someAc...

How to retain or animate subview background color in UITableViewCell on selection?

I have a UIView as a subview of a custom subclass of UITableViewCell. I'm using it to change the color of just a small area of the cell dynamically. When I select the cell, the background color of the entire cell -- including the background color of the subview -- is changed to blue. That's fine, it happens instantaneously. Selection...