iphone

iPhone UITextField within TableCell blanking out

In my iPhone app I have a settings page where a user can enter text into multiple TextFields. The text fields are all cells within a table. The problem I'm noticing is that when a field scrolls off the phone's screen it loses the value currently in the text field. I notice Apple's apps always have you click on a field to edit it, whic...

iPhone USB transfer cable->MIDI?

I'm just wondering if this is possible (I think not)... The iPhone has a 30 pin connector cable to USB. It "talks" USB already. Is it possible to talk to a MIDI device (i.e. a keyboard with USB) using the cable with the current API? Ideally, one could plug the iPhone directly into the USB port of a MIDI keyboard and then talk to the ke...

What exactly does rangeOfCharacterFromSet do?

NSString *foo = @" x "; NSRange r = [foo rangeOfCharacterFromSet:[NSCharacterSet whitespaceAndNewlineCharacterSet]]; NSLog(@"foo range = %d,%d",r.location, r.length); Results in "foo range = 0,1" So will it ever return a length > 1? ...

enemies and slopes

How would you achieve a certain slope for a moving object ? I'm trying to get a enemy to spawn of the screen at point x,y and fly by itself across the screen to a new x,y while aslo adding a slope so it looks like it's swooping downward,straight, or upwards.. something like that. Right now I only have the knowledge of spawning and movi...

attaching a text file to an email

I successfully created a txt file (i.e. the file exists and opens), I would like to attach it to an email that I am successfully generating (i.e. the email opens and I can put text into the email etc. and send it). Here is the code I have now for performing the attachment: // Attach a file to the email NSString *path = [self dataFilePa...

Using AVAudioPlayer and MPMoviePlayerController simultaneously

Hi All, I need to use AVAudioPlayer and MPMoviePlayerController simultaneously i.e play a movie while the background loop is playing is it possible .My bg music loop stops working when a movie starts playing , so I tried to stop the bg music loop and start the movie and when movie stops, start playing the bg loop again but this is also ...

Trying to figure out where my touches are, when moving a slider control.

I would like to create a variable speed slider control on the iPhone. Basically I am using a UISlider control but I would like to add a second dimension to this control by detecting where the finger is in the current view. E.G. A user can slide the control left and right, but I want to see where their finger is vertically in the view. ...

Image stretching

Hi All, I want Stretch a image. For that i use sprite. I want stretch sprite & this stretching is may be Circular or curve animation. I don't understand what methode used for that. Can anyone help me? ...

How to receive application wide events with multiview application

Hello, I am developing an iPhone application with multiviews (Nav controller), but i like to receive an event if user touches in any view of the view. I understand it can be done by subclassing application delegate? If that's true how can i do it? My requirement is, i like to receive an event as soon as user touches any where in any vie...

OpenGL for Android and iPhone

In discussion with some colleagues we were wondering whether OpenGL work developed for Android or iPhone are effectively interchangeable given that both support the spec. Or is the reality of sharing OpenGL between the two platforms more a case of quirks, tweaks and not as easy as one might have hoped. ...

How can i rotate body when user touch the screen in cocos2d.

Hi, I am facing one problem. I have done some coding to rotate cpSegmentShapeNew but its not working . Have a look on the following code, //**creating shape testBody = cpBodyNew(INFINITY, INFINITY); cpShape* testShape = cpSegmentShapeNew(testBody, cpv(230, 82), cpv(193, 46), 0.0f); testShape->e = 0.0; testShape->u = 0.0; testShape-...

Is Macro Better Than UIColor for Setting RGB Color?

I have this macro in my header file: #define UIColorFromRGB(rgbValue) \ [UIColor colorWithRed:((float)((rgbValue So I want to ask everyone is this better or should I use this approach: cell.textColor = [UIColor colorWithRed:66/255.0 green:33/255.0 blue:33/255....

Problems with IBOutlet getting nil.

I have an instance of a class "A" in my EAGLView class, it gets instantiated in the EAGLView's initWithCoder method. This class "A" contains an IBOutlet to a UIView. I also have an instance of this class "A" in the Interface Builder, to connect the class "A" IBOutlet to the corresponding view. So the class "A" is being instanciated t...

How do I suppress animation during AutoRotation

I'm making an app where one of the objects needs to appear not to move or rotate during AutoRotation, but everything else needs to rotate and be repositioned. The way I did this is by manually rotating the object, and moving it into the same position, relative to the device, that it had prior to rotation. The problem is that it looks f...

Call using Skype.app via openURL:

Hi! Does anybody know if it is possible open Skype.app to call phone via - (BOOL)openURL:(NSURL *)url UIApplication message? If it possible, what url a need pass to this message? Thanks ...

How do I know when a page has failed to load in UIWebView as opposed to being "Stopped" by the user?

Hey Guys, I have a UIWebView within my application which I'm using to provide web browsing functionality. I have a button on my toolbar which calls -(void)stopLoading; on the UIWebView. The problem with this is that when this method is sent to the web view, the delegate receives the - (void)webView:(UIWebView *)webView didFailLoad...

Is there a way to fake a Touch into the system?

I discovered this: When a UIView's touchesBegan: method is fired and there is only one finger on the screen, the system will wait up to 0.25 seconds to see if the finger move far enough, before it will fire touchesMoved:. There is no programmatically way to get around this problem. But now the interesting part: If one finger is already ...

Difference in App load time when built for distribution?

This may sound like an odd question, but has anyone noticed that their iPhone apps launch quicker when built for distribution over being built for debugging? Our app initially launches really slowly when compiling it for debugging / running it through xcode. (on device) So I then dis-connected the phone from xcode and ran some extremel...

Video recording API in iPhone SDK 3.0

I am working on an app which should allow user to record video on iPhone 3GS. I was looking into MediaPlayer references but could not find anything there. Can someone give me a head start on the APIs to look for? ...

"-(void)connection:(NSURLConnection *)connection didReceiveData:(NSData *)data" not called...

Hi All , Have a look to this code snippet:- -(void)connection:(NSURLConnection *)connection didReceiveResponse:(NSURLResponse *)response { [webData setLength: 0]; } -(void)connection:(NSURLConnection *)connection didReceiveData:(NSData *)data { NSLog(@"Recieving Data..."); [webData appendData:data]...