cocoa-touch

Is there a pre-iOS 4 replacement or workaround for UINib?

My application features a tableview which contains some rather complex tableviewcells. Therefore, these cells have been designed in Interface Builder and are instanciated later as needed using UINib which allows just that - load the content from a nib and instanciate it as needed. But UINib is only available for iOS 4.0 and above. Befor...

NSDateFormatter is showing wrong date format (nachm. instead of PM) in the simulator

Why does the simulator is showing me 10:30 nachm. instead of 10:30 PM? I use the following code: NSDateFormatter *dateFormat = [[NSDateFormatter alloc] init]; [dateFormat setDateFormat: @"h:mm a"]; NSLog(@"%@",[dateformat stringFromDate: myDate]); OK I think I have to set a Locale somewhere ... ...

Accessing UITableViewController > UIView > UIView?

Can anyone tell me if this is possible? I have a setup a UITableViewController which consists of a number of cells, if you select one of these cells you are taken to a new viewController using pushViewController (see below) - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath { NSUInteger row ...

Call Google Maps with Url from Objectve-C

i call the url of googlemaps to show a position to a given lat and long. How can i mark this position on the map with a pin ? NSString *latlong = [NSString stringWithFormat:@"%@,%@", einBetrieb.lat, einBetrieb.lng]; NSString *url = [NSString stringWithFormat: @"http://maps.google.com/maps?ll=%@", [latlong stringByAddingPercentE...

UIImagePickerController Image Orientation

Can anyone tell me how to use the UIImagePickerController (camera and album) delegates determine the image's orientation, rotate accordingly, and assign it to a UIImageView? ...

Draw part of a circle

For an iPhone application I want to draw a circle, that is only for an x percentage filled. Something like this: I have no problems calculating the radius, the degrees or the radians, that is no problem. Also drawing the circle is already done. But how do I get the iPhone SDK to draw the part that is filled. I can draw a rectangle t...

Is NSMutableString's -appendString: method an efficient way to build up a large string?

I'm planning on building up a potentially large string by iterating over a collection and generating chunks at a time. If I were to simply start with an NSMutableString and repeatedly append chunks to it, does that work reasonably efficiently or is it a Schlemiel the Painter situation? It seems plausible to me that NSMutableString is imp...

Custom UITableViewCell subview layout

I'm creating a custom UITableViewCell, similar in style to UITableViewCellStyleValue1 but with an editable text field on the right side instead of the detailTextLabel. I'm a little confused on how to size the edit field properly. I want to take the length of the textLabel into account, as well as the size of the contentView, and be abl...

precompiler for ipad

HI all, In xcode I am trying to load different nib file in case I am using iphone/ipod or ipad. I have a Define.h file with all enum and constants in it, so I would like to put in there a kind of (obviously wrong because I don't know how to do it): #if IPHONE // <-- can I intercept the Active Executable here ? #define MY_VIEW @"Tab...

How to find out which file gets run first in XCode

In an XCode project that has a lot of h and m files, how do you find out which file gets executed first? ...

How can I programmatically launch Contacts.app on the iPhone

I would like to launch the Contacts.app when the user needs to add a contact. My app already reads from the contact API. I would rather not re-implement functionality if I can avoid it. I am targeting iOS 4.0 and above. ...

How to access a member object

I have made a custom object called students that has two nsstring object. One is for the name and the other for the student id. If I try to pass the custom object to something that takes nsstring, it doesn't work. I want to pass the name. How can I do this? ...

UITabBar selected tint color

I need to change uitabbar selected tint color from blue to yellow. How can i do it??? Can any one help me with this?? ...

How to add and delete items in an array from inside a child view

Let's say I declare an NSMutableArray in the class file foo.h. Then in the viewDidLoad method in foo.m I populate the array. Inside foo.m I can add, delete, or modify array elements. Then let's say the following code executes inside foo.m [self.navigationController pushViewController:bar animated:YES]; This will switch the view and p...

When manually triggering a KVO event, can the change dictionary be amended?

I have a data model, composed mostly of an NSMutableArray 'contents' and NSMutableDictionary 'contentsByName'. I have ViewController objects that I wish to observe changes in the data model. I have a property "count" on the model that returns the size of the array 'contents' and I can trigger a KVO change observation with willChange: an...

Programmatic View Offset by Status Bar?

I am just looking at setting a up a custom UIViewController programatically (see code below) and I am just curious about the white line I am getting at the bottom of the display, I don't see this when I create the view using a NIB in InterfaceBuilder. Is it just a case of offsetting the frame down by the height of the status bar or am I ...

Parent UIScrollView detecting child UIView's touches

Basically... I have a UIScrollView subclass which you can add a target and selector too, which get fired if a touch event is detected within the view. I am using the scroll view as an image gallery, and the touch inside the scroll view is used to fade out the HUD components (UItoolBar, etc): @implementation TouchableScrollView - (voi...

Compare sounds inside of the App

Is it possible to compare two sounds ? for example app have already a sound file mp3 or any format, is it possible to compare any static sound file and recorded sound inside of app ? Any comments are welcomed. Regards ...

iPhone - Making a Tab Bar Transparent

How do I make a tab bar transparent in cocoa touch? Thx Evolve ...

Screen Resolutions and Frame Size?

I am curious about how the iPhone4 works out the size of frame items, for example: - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { MyController *tempController = [[MyController alloc] init]; [[tempController view] setFrame:CGRectMake(0.0,20.0,320.0,460.0)]; [self...