iphone

Playing short sound on timer end?

Hi... In my app I have a timer that counts down, and when it stops an image is displayed and a sound is played. The sound is loaded like this: NSString *path = [[NSBundle mainBundle] pathForResource:@"scream" ofType:@"wav"]; AudioServicesCreateSystemSoundID((CFURLRef)[NSURL fileURLWithPath:path], &soundID); And Played like this...

Objective-C: How to get class and runtime information?

Hi all, For debugging purposes, I'd like to display as much class information as I can, and possibly runtime information (which thread does the class/function run in, etc) into the console. Is there an easy way to do this with a function, variable or even (external) framework? P.S: I'm using Cocoa Touch. ...

Passing variables through classes in Objective-C

In my scenario I have 2 view controllers, one tied to the main view and one that is connected to the first one as a subview. Now let's say that my App Delegate class wants to pass a string to the subview controller. What is the best practice to achieve this? If I wanted to pass it to the 1st controller i could just say something like [...

sample code MoviePlayer problem

i have post this question before but cannot get a answer so i post it again.is about the MoviePlayer sample download from iphone developer site, when i press the Done button come with the movie player control mode, the movie was finish and exit to main view,at the same time the moviePlayBackDidFinish function have been called, however wh...

iPhone UIViewController init method not being called

Hi folks, I am very new to iPhone programming and am running into a little bit of weirdness. For the following class, the init method just never gets called -- I have an NSLog function which should tell me when init is executed. Here's the relevant code: @interface MyViewController : UIViewController { } @end @implementation MyViewCont...

How do I save a reference to a specific photo on iPhone for loading without picker?

A user can select a photo from their library using the image picker - I want to remember this selection and display this picture in future without the user having to pick it. How can I reference the specific photo or is there a way I can copy the photo to my application's storage? ...

badgeValue in UISegmentedControl

Hi, In UITabBar class, there is a property called setBadgeValue to display a text in the upper right corner of the item with a surrounding red oval. I need to display a control like badgeValue in UISegmentedControl. There is no functionality like badgValue in UISegmentedControl. Please give me some ideas to do this thanks in Advance! ...

program access to iPhone volume buttons

Is there any way to subscribe to volume buttons press evens? ...

Validate iPhone device Ids?

Is there a way to validate an iPhone device ID? I want to be able to accept device IDs submitted from iPhone users via HTTP request and validate that they are tied to a legitimate device. ...

Converting a CGPoint to NSValue

in CABasicAnimation.fromValue i want to convert a CGPoint to a "class" so i used NSValue valueWithPoint but in device mode or simulator one is not working... need to use NSMakePoint or CGPointMake if in device or simulator... ...

inserting various views into UIScrollView

Hi: we're trying to implement an article detail view for an RSS-like application. The windows has a UIScrollView that contains a UITextView (which is the title), a UIButton (which opens a gallery), and a UIWebView (with the body). The idea is that all these elements scroll together... The problem is that whenever we have a body over 1...

What does 8badf00d mean?

Sometimes my iPhone application crashes with a weird crashlog, that reads exception code is 0x8badf00d. The stacktraces show random snapshots of app execution, but nothing suspicious. This happens very rarely and I'm not able to find out how to reproduce it. Does anybody know more about this kind of exception and exception code? Here ...

Is the visibleRect method also available on iPhone? How do I find it out?

Apple says that there is a visibleRect method on the mac (Source), that helps doing graphic operations only in the visible content rectangle from an view. When I try to access that method, XCode gives me no completion hint, so it seems that this one is not available on iPhone. How could I find that out? ...

touchesEnded

I have a simple OpenGL:ES application running (it is a game). The game loads and presents the user with a "new game button" and then you are in the game. I'm using touchesBegan / touchesEnded to handle the touches. Then I take the coordinates and process them accordingly. I also have an NSTimer running at 30Hz that calls renderScene ...

Why can't I access the visibleRect Property of an CALayer in iPhone SDK?

I am having trouble doing this: CALayer *myLayer = myUIImageView.layer; //works, no error from compiler CGRect visRect = myLayer.visibleRect; //fat error, see below The Error I get is: error: request for member 'visibleRect' in something not a structure or union but the documentation says: visibleRect Returns the visi...

XML Parsing in Cocoa Touch/iPhone

Okay i have seen TouchXML, parseXML, NSXMLDocument, NSXMLParser but i am really confused with what to to do. I have an iphone app which connects to a servers, requests data and gets XML response. Sample xml response to different set of queries is give at http://pastebin.com/f681c4b04 I have another classes which acts as Controller (As ...

UITableView - delete button

Hi, in my app when user swipes a certain row I want to display a delete button. And when the button appears it obscures IndexTitles and another label in my cell (it has subviews). How can I customize my table when the button appears? Thank you. ...

iPhone UIWebview: How to force a numeric keyboard? Is it possible?

I'm experimenting with PhoneGap to develop some iPhone apps. PhoneGap basically wraps a UIWebView - it works well. The problem is the my app has several input fields that only take numeric input. I really need to force the numeric keypad instead of accepting the default standard keyboard, which then forces the user to switch to the num...

can not redraw rect from callback

I am new on iphone what I wanna do is to render image to iphone so I have one module to generate image data, after done invoke callback function to notify UIView, in UIView I have I have callback function to give the image to UIImage, and then I setNeedsDisplay and return. In my UIView class drawRect:(CGRect)rect I call drawImage, but...

How do I get the visibleRect Rectangle out of an UIImageView?

Actually that should work, but it doesnt: CALayer *myLayer = [myUIImageView layer]; CGRect visRect = [myLayer visibleRect]; I get an "invalid initializer" error, although my view is loaded definitely since in the next few lines I obtain the frame from the view and move the view around. But under no circumstances I can obtain that visi...