iphone-sdk-3.0

Cannot hide a UIButton - Please help!

Hey again, I have the following code: visitSite.hidden = YES; For some reason, when I click a UIButton and call this piece of code, the visitSite button does not hide. The code is within this block: -(IBAction)welcomeButtonPressed:(id)sender { [UIButton beginAnimations:@"welcomeAnimation" context:NULL]; [UIButton setAnimationDu...

How to hide the label (CCLabel) after a certain time in cocos2d ?

I added a label by using CCLabel to my layer. Now I want it do disappear after some time like (2sec). How can I make it to disappear? CCLabel *labelPerfectDraw = [CCLabel labelWithString:@"Perfect Draw" fontName:@"Marker Felt" fontSize:30 ]; labelPerfectDraw.color = ccc3(0x00, 0x00, 0xff); labelPerfectDraw.position = cc...

cocoa - I've discovered what I think is a bug with NSDecimalNumber ...

Here is a simple code that shows what I think is a bug when dealing with double numbers... double wtf = 36.76662445068359375000; id xxx = [NSDecimalNumber numberWithDouble: wtf]; NSString *myBug = [xxx stringValue]; NSLog(@"%.20f", wtf); NSLog(@"%@", myBug); NSLog(@"-------\n"); the terminal will show two different numbers 36.7666244...

How to make a Global Array?

So, I read this post, and it's pretty much exactly what I was looking for. However... it doesn't work. I guess I'm not going to go with the singleton object, but rather making the array in either a Global.h file, or insert it into the _Prefix file. Both times I do that though, I get the error: Expected specifier-qualifier-list before...

Need Help With Simple Counting Bug in iPhone SDK

So I'm basically making an app that adds a count to a number and then displays it each time you tap the button. However, the first tap issued doesn't take any action but adds one (just as planned) on the second tap. I've searched to the ends of the earth looking for the solution with no luck, so I'll see what you guys can make of this. ...

How can we detect a touch of a sprite?

I have two sprites in my app. Both should have touches enabled and both touches are independent of one another. And if I touch the screen (not on sprites) it should have different touches. My problem is all three sprite1, sprite2, remaining screen should have independent touches. But my program is taking all the touches as same. How can ...

NSSet to NSData, then back out again, for GameKit?

Hi guys, I'm trying to do some image edit syncing between two of the same app running on different iPhones. I would like to send an NSSet * from one device to another (which I imagine involves encapsulating in NSData) then decrypting this back to an NSSet, then using it in a touchesMoved type of function. Is this feasible, or should I w...

iPhone SDK can't get UIScrollView to work with a UIWebView

I am building an app that in part of it has two views - one portrait and one landscape. And I want to offer scrolling and pinch & zooming on the landscape orientation. I've built the two views and the simple UIImages in the landscape view all work OK but it does not seem to insert my UIWebView into the UIScrollView. I've done this before...

Playing sounds in iPhone SDK?

Does anyone have a snippet that uses the AudioToolBox framework that can be used to play a short sound? I would be grateful if you shared it with me and the rest of the community. Everywhere else I have looked doesn't seem to be too clear with their code. Thanks! ...

iphone file download not working

Hi, In my app I 'm first connecting to a web service, which in return sends a url for a file. I use the url to download the file and then display it on the new view. I get the correct URL but not able to download file from that location. I have another test app which will download file from the same location and it works like a charm. ...

iphone - compiler conditional on header

I have a project that generates applications for two targets. One of the targets has to include one additional delegate protocol that should not be present on the other one. So, I have created a macro on Xcode and declared the header like this: #ifdef TARGET_1 @interface myViewController : UIViewController <UIScrollViewDelegate, UIPopo...

How to edit Selection indicator in UIPicker?

Ad you can see, there is a example. The UI picker's Selection indicator. How can I do the similar thing on my Apps? ...

Detecting view the user was in with - (void)applicationWillTerminate

Is there a way for me to check which view the user was in when the application is about to quit? I want to make sure that once the app starts again that view will be the first thing the user sees, so I'm guessing this is the best way to go about doing it. ...

Rotate UIViewController to counteract changes in UIInterfaceOrientation

Hi there, I've been searching a lot on this, and can't find anything to help me. I have a UIViewController contained within another UIViewController. When the parent UIViewController rotates, say from Portrait to LandscapeLeft, I want to make it look as though the child didn't rotate. That is to say. I want the child to have the same or...

openURL tel: on iPhone 3.0.1, is it asking for confirmation before dialing?

I need to change the message when it ask for confirmation, it only show you tel number. i want to flash custom message for better understanding. ...

How can we send MMS attachments from our iPhone application?

Hi all In my application i want to send a attachments, Test through MMS. How can we do it using iPhone SDK. Please help me out. Thank you ...

How to place UIBarButtonItem on the right side of a UIToolbar?

I have designed a view with a toolbar that appears modally in Interface Builder. I have a UIBarButtonItem that is on the left hand side, which I would like to appear on the right hand side of the toolbar. How can I do this in IB, or via code? ...

Turn off or fix Bounce Zoom warning from iPhone XIB compilation

This has been annoying me for a while in several XCode projects. I really don't like to have compiler warnings when I build. When I build my current project, I get the following warning from a bunch of XIB files: /.../CaseInformationView.xib:3:0 UIScrollView's 'Bounce Zoom' option will be ignored on iPhone OS versions prior to 2.1. ...

Easiest way to support multiple orientations? How do I load a custom NIB when the application is in Landscape?

Hi there, I have an application in which I would like to support multiple orientations. I have two .xib files that I want to use, myViewController.xib and myViewControllerLandscape.xib. myViewController.xib exists in project/Resources and myViewControllerLandscape.xib exists in the root project directory. What I want to do is use a sep...

iPhone PlayAndRecord silences all system audio??

Hi, In my iPhone app I am trying to record audio and play iPod music at the same time, so I set the audio session category to kAudioSessionCategory_PlayAndRecord. But when I set this, all system audio (including vibrate) doesn't work anymore, although the iPod audio still does work. Does anyone know if this is a bug in the SDK or somethi...