iphone

Why does my Quartz arcs display thicker than the straight lines?

Hi! I'm trying to create a custom UIButton that should look like a UIButtonTypeRoundedRect. In my drawRect:, I'm creating a path with first one call to CGContextMoveToPoint() and then four calls to CGContextAddArc(). I then stroke the path. However, in the resulting image the four rounded corners are clearly thicker than the rest of the...

How do i change the location of the text in UITableView?

How do i change the location of the text AND show the FULL string in UITableView? Here is a screen shot of what I have, once you look at it you will know what I mean. Thanks ...

Setting background color of a table view cell on iPhone

Hello, I want to achieve the effect where one cell of the table view will have blue background, the next one will have white, the next one will have blue again, and then white and so on... could you let me know how can I do that? Thanks. ...

Why does the iPhone SDK use categories, rather than protocols, for some delegates?

My understanding is that protocols are like interfaces in other languages -- they declare expected methods -- while categories allow you to add new methods to existing types (perhaps even types you don't own.) Why, then, does the iPhone SDK sometimes use categories for declaring delegate types? Normally I would expect all delegates to b...

Does anyone have a good way to scroll text off to one side, like a stock ticker in a label on a nib in an iphone app?

I want to scroll text starting on the right and make it smoothly move to the left and off the screen. Does anyone have an example of something they tried that worked? Thank You. ...

Slow start for AVAudioPlayer the first time a sound is played

I'm trying to eliminate startup lag when playing a (very short -- less than 2 seconds) audio file via AVAudioPlayer on the iPhone. First, the code: NSString *audioFile = [NSString stringWithFormat:@"%@/%@.caf", [[NSBundle mainBundle] resourcePath], @"audiofile"]; NSData *audioData = [NSData dataWithContentsOfMappedFile:audioFile]; NSE...

how to use Firefox but pretend that I am using iPhone (to use Firebug to examine the page design)

Is there a way to use Firefox and Firebug but pretend it is iPhone's Safari by faking the User Agent string? I want to use Firefox to examine the Amazon or Gmail sites and see how the page is laid out for iPhone... just for fun and for experiment. Is there a way? thanks? ...

Connection reset by peer with iPhone NSURLConnection

I'm trying to connect to a C# HTTP server with an iPhone app. Pretty simple code so far: NSData *requestData = [ NSData dataWithBytes: [ requestMessage UTF8String ] length: [ requestMessage length ] ]; NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:infoURL]]; [request setValue:@"appl...

What is the minimum boilerplate code for a OpenGL 2D View?

What's the minimum boilerplate code required to setup an OpenGL view (with the necessary projections,camera angles etc) for drawing a 2D game? For example, the minimum required to do Quartz 2D drawing in a custom view (and, say, load a background image) is the following: #import <Cocoa/Cocoa.h> @interface MyView : NSView { } @end =...

Is there any way to determine if the iphone is roaming?

I am working on an iPhone application and would really like to determine if the device is roaming so that I can intelligently avoid costing my users expensive connections if out of their home network. The application I am writing is for jailbroken phones, however I would prefer to use standard SDKs if possible. Here is what I've alre...

Anyone succesful in debugging unit tests for iPhone?

I found examples on how to debug your unit test in Cocoa or the ADC page here. But I can't get the debugging to work for an iPhone app target. I can get the tests up and running and they are run during the build, but what I need is to debug the tests for some of the more complex failures. ...

How to check for existing item in NSSet or NSCountedSet?

Hello, I'm currently populating model objects into an NSSet (perhaps I should be using NSCountedSet). The models should be unique. What I do is pull them in from a web service, and then instantiate them on the client-side and add them to a set. My problem is the following: There are times when I'll only pull one model and add it to the...

Why is the Status Bar STILL showing during Default.png?

I'm pretty sure that I've taken all steps to correctly set my status bar to hidden. I did this in both the info.plist file (setting a UIStatusBarHidden to a boolean TRUE) as well as in the applicationDidFinishLaunching method in the Application Delegate using: [[UIApplication sharedApplication] setStatusBarHidden:YES animated:NO]; An...

Why is UILabel 0x0?

I'm loading a nib as: ContentViewController *theController = [[ContentViewController alloc] initWithNibName:@"ContentView" bundle:nil]; which has a label on it. The view controller has an IBOutlet of UILabel with a @property of retain and synthesized variable. When I load the nib as above from another class and reference the label's...

Getting title of UIButton in event handler

I create a button and set title as "Click here". When I press that button I want to get that button title and log it. Here's my code, where am I going wrong? -(void)clicketbutton { UIButton *mybutton = [UIButton buttonWithType:UIButtonTypeCustom]; [mybutton setTitle:@"Click here" forState:UIControlStateNormal]; [mybutton ad...

An efficient way of redrawing a UITableViewCell once its data is available

Hi all, I currently have one UITableViewController that contains many cells with simple data in it. When the UITableViewController instantiates a UITableViewCell, it begins running a background thread for each individual cell to get its state from the server. The UITableViewCell is subclassed and already has a UIImageView property that ...

iPhone: How to wrap text in drawRect?

This is an iPhone question. How does one draw wrappped text in the drawRect method? I'm trying to use atebits' ABTableViewCell class to do custom drawing of a table view cell. I'd like to draw a small picture and then text next to it which may or may not need to line wrap. Think of the table cells in a Twitter client like Tweetie which s...

load a google map from this information in iphone?

hello guys i have a UITableCell which has some details like this "550 Ashbury St., San Francisco, CA, 94117".the details are coming from database.now i want that when i click on the cell a new view should be loaded with google map with this address. any idea how to achieve this??? ...

strange splash screen problem in iphone native application?

i have a application i put Default.png for splash screen according to apple's documentation.the splash screen is displaying fine.but when i delete the Default.png and references of png.it does not removed it is still showing the splash screen.i am running the program in simulator.? ...

how to put different max character limit on textfields in one View in iphone?

i have a UIView with 10 UITextFields on it.i want to limit the different max character length on each UItextField.suppose on the first textfield the max length should be 17,for second and third it should be 2.how do i achieve this? ...