iphone

iPhone - HTTPS connection to Server with Self-Signed Certificate

How would I accept a self-signed server certificate? Using the code below, I can only connect/authenticate after I accept the Server Cert using Safari. (void)secure:(NSString *)username credentials:(NSString *)login { NSURLCredential *userCredentials = [NSURLCredential credentialWithUser:username pass...

Does Safari and/or WebKit implement the equivalent of window.navigator.online?

Does Safari have anything equivalent to the HTML 5.0 spec for window.navigator.online? http://www.whatwg.org/specs/web-apps/current-work/#browser-state If not are there any alternatives to polling to establish connectivity state? My question pertains to Safari 4.0+ and iPhone software 2.1+ ...

Boolean logic failure

I am having a strange problem with boolean logic. I must be doing something daft, but I can't figure it out. In the below code firstMeasure.isInvisibleArea is true and measureBuffer1 is nil. Even though test1 is evaluating to NO for some reason it is still dropping into my if statement. It works ok if I use the commented out line. Any id...

Create a UIImage from two other UIImages on the iPhone

Hi, I'm trying to write an animation on the iPhone, without much success, getting crashes and nothing seems to work. What I wanna do appears simple, create a UIImage, and draw part of another UIImage into it, I got a bit confused with the context and layers and stuff. Could someone please explain how to write something like that (effi...

Problem to populate a Tableview on iPhone

Code N°1: NSMutableArray *arrayTmp = [[NSMutableArray alloc] initWithObjects:nil]; [arrayTmp addObject:@"line 1" ]; [arrayTmp addObject:@"line 2" ]; self.list = arrayTmp; [self.tableView reloadData]; [super viewDidLoad]; [arrayTmp release]; Code N°2: NSMutableArray *arrayTmp = [[NSMutableArray alloc] initWithObjects:nil]; NSString...

Problem loading Youtube videos

I'm trying to launch embedded Youtube videos from a UIWebView, but get this error in the console when selecting them from the phone: warning: Unable to read symbols for "/Developer/Platforms/iPhoneOS.platform/DeviceSupport/2.2/Symbols/System/Library/Internet Plug-Ins/YouTubePlugIn.webplugin/YouTubePlugIn" (file not found). The URL is g...

reloading a table view in an iphone app?

I have a table view controller that makes an http request, which returns xml. I parse the xml and display it in a UITableView. The first time the http request is called everything works as expected. The second time I call the http request: I receive the xml as expected, but the table does not update. I am calling the reloadData metho...

Why tack a protocol of NSObject to a protocol implementation

I have been seeing some code around that resembles the following: @protocol MyProtocol <NSObject> // write some methods. @end Is there any particular reason why MyProtocol conforms to the NSObject protocol? Isn't that rather redundant in that if you do something such as: id foo; // foo here conforms to NSObject AND MyProtocol? Just...

How can I use CGContextDrawTiledImage to tile an image?

I want to be able to an UI object like a UIImageView and tile an image inside of it. I have been able to use CGContextDrawTiledImage to update the background in the main window, but not an image view. I can do this if I modify the drawRect function inside the MainView class. I feel I'm close, but still missing something. Can someone po...

How to draw signature with lines on iPhone screen?

I want to let user draw a signature on iPhone screen, so I add a subclass of UIView and add some code to its 'touchesMoved' method. -(void)touchesMoved:(NSSet *)touches withEvent:(UIEvent *)event { UITouch *touch = [touches anyObject]; firstTouch = [touch locationInView:self]; CGSize mySize = CGSizeMake(5, 5); UIGraph...

UITableView with dynamic cell heights -- what do I need to do to fix scrolling down?

I am building a teensy tiny little Twitter client on the iPhone. Naturally, I'm displaying the tweets in a UITableView, and they are of course of varying lengths. I'm dynamically changing the height of the cell based on the text quite fine: - (CGFloat)heightForTweetCellWithString:(NSString *)text { CGFloat height = Buffer + [text si...

UIImage and UIImageView problem

set a UIImageView.image property to a UIImage is unable add the image to the view,however if i set the imageview frame property,it works.can anyone tell me how it's happen? and what will happen when i apply the UIImage instance method[drawInRect:] redraw the image frame which is larger than the view frame?i have tried but nothing happen,...

Can we use NSFileManager in iphone ?

Hi all, I need to use the NSFileManager class in my own iPhone app...Before that I would like to know whether it would be supported in iPhone???Can anyone help me??? Thanks in advance, Syam ...

Why won't my UITableView rotate?

Within Interface Builder, I have the following UIViewController -- View ---- TableView In my UIViewController I have set - (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation { return YES; } I also have other view controllers that are in IB. What am I missing here? The only way I can get it...

How to move pixels?

I am creating an iPhone application and I am using OpenGL, which I'm new to. I have to change the pixel positions, can anyone show me the functions to work on pixels? Some example source code to illustrate the idea would be appreciated. ...

how to get location in iphone

how can i get the my current location using WiFi programatically in side a room with my WiFi machine. I have two machine which have Wifi and i want to locate my current location on iphone. So how can i get my current location using two machine? ...

Sprite Delay

i have a sprite & a set of coordinates... I want my sprite to follow that path & its following but its so fast that i can see only the last position...... So i want to introduce delay in every new position.. so how i can achieve this ...

Is there a limit on the size of the variables in a custom URL handler?

I need a way to transfer a bunch of information (1-10kb) from an email in the Mail application to my iPhone app. I was thinking I could craft a custom URL in the body of the email that, when clicked, would transfer the information through a custom URL handler to my app. However, it's a lot of data. Can I pass that much data in the cust...

Beginner questions regarding to "building a library", in Xcode on iPhone specifically.

Hi, I have never been clearly understand all these linking/building/dependency business. Now, I am trying to build the FreeType library (which is in C++), into the *.a library file for the iPhone (because another library I am trying to use, openFrameworks, would depend on FreeType). I know that to compile C++ with iPhone I simply need ...

draw a line in UIImageView problem

In my application i can draw a line in a UIImageView by the code below,and i want redraw the line even longer when i call the function,however,the output come out is not as expected,it will just draw a new line and remove the old one,the length is remain the same jus the y position different,i dont know which line of my code is wrong or ...