iphone

when to use respondsToSelector in objective-c

- (void)someMethod { if ( [delegate respondsToSelector:@selector(operationShouldProceed)] ) { if ( [delegate operationShouldProceed] ) { // do something appropriate } } } http://developer.apple.com/library/ios/documentation/Cocoa/Conceptual/CocoaFundamentals/CommunicatingWithObjects/CommunicateWithOb...

well using NSXMLParser the values inside an array are all set to the last entry

I use an NSXMLParser to parse YouTube's API and I get all the content I want and put it into a class called Video. When I am writing to the class from inside parserDidEndElement and I end that video I write the class to an NSMutableArray. Then I NSLog the title of the video that was logged into the array. This is different for each video...

Is it safe to call dismissModalViewControllerAnimated within a modal view on iOS?

Is it safe to call dismissModalViewControllerAnimated within a modal view? or should it be called from the controller that initiated the modal view? If so how would I program that? ...

#if Check between iphone and ipad

Is there a build preprocessor I can use, like #if or #ifdef to check whether my current xcode project is being built for iphone or ipad? ...

What iOs version apps are accepted in App Store

Hi, My app is currently in version 3.2.3. What version of iOs apps are currently being accepted by Apple. Links? ...

set delegate in objective-c on iOS

- (id)initWithDelegate:(id)delegate { self = [super init]; if (self) { _delegate = delegate; } return self; } Is it generally recommended to pass in the delegate in the init method? what about in another method that will be called first? Also do I need to set _delegate to nil or release in the dealloc or v...

Adding a line break to a UITextView

Hi I have a UITextView that takes an NSString with formating stringWithUTF8String. It is getting its values from a database and I want the text in the database to be rendered with breaks within the text. I tried using "\n" to do this but it gets rendered as text. Doing this in my information page of the app as straight text worked but I...

UIActionSheet throwing NSInvalidArgumentException

Hello I got a UIViewController implementing UINavigationControllerDelegate and when i try to add UIActionSheetDelegate , it gives exception "NSInvalidArgumentException" Here is my code: RootViewController.h @interface RootViewController : UIViewController <UINavigationControllerDelegate,UIActionSheetDelegate> { } -(IBAction) openAct...

Adding extra graphic to a a UITableViewCell

I have a UITableViewCell setup and i'd like to add a graphic on the right hand side with a number inside it (similar to the way mail shows how many new mail messages you have) So the UITableViewCell would look something like this; Is there a simple way to do this? Many thanks. ...

Whats the proper way to release a UIWebView?

I've been looking at many code samples on the internet. If I add an UIWebView from interface builder as an IBOutlet. Is it right that in the dealloc method of the controller, I need to do the following? [webView stopLoading]; webView.delegate = nil; [webView release]; and what about in the viewDidUnload method? ...

Changing current view in a uitabbar application iOS iPad

UIViewController *newView = [[UIViewController alloc] initWithNibName:@"NewView" bundle:[NSBundle mainBundle]]; tabBarController.selectedViewController = newView; Why doesn't this work? ...

CoreData Relationships Lazy Load?

When I have a CoreData entity named, say, 'Book', which has a one-to-one relationship with another entity ('Bookmark') would I need to insert both an instance of 'Book' and an instance of 'Bookmark' into a managed object context, and manually assign the relationship? If I perform the following code to instantiate an instance of 'Book'.....

Rotate MPMoviePlayerController to Landscape - iPhone SDK

Hello everyone, I am trying to rotate my MPMoviePlayerController to landscape view, but it always stays in portrait mode. I am doing this in a UIViewController and I still can't rotate my MPMoviePlayerController when I am in full screen mode. Do I have to do something to the shouldAutorotatetoOrientation method? If anyone knows how to d...

Create a copy of a NSObject

How do I take a NSObject that I have set all the attributes of and then copy that into another block of memory that an array can use so I can re use the original one? ...

XCODE - Drumming app - Laggy Sounds... How To Fix?

Hey everybody, I have a drum app that I've created basing it off of AVAudioPlayer instead of the common system sounds in order to have a bit of control. The problem is that whenever 2/more sounds are played at once, it lags and stops alls sounds, so your drum beat gets choppy and randomly stopped. like boom boom chhhhh boom boom ch--- ...

Can I delete scores posted on leaderboard in Game Center?

It seems that there is no admin page in Game Center. Is there any way to delete scores on leaderboards? ...

load several images effectiely on iphone

i am loading several images based on when user click any row -> section ->images i am parsing via NSxmlparser now point is i can only go to detail section if all of my images loaded which is too time consuming is there any way that allow me to go to section view(even if 1 image loaded) and then keep loading rest images later this is m...

iPhone - creating Quartz paths on vector app?

I dream of being able to use Illustrator to create my vectorial objects and export them as quartz paths. Is that possible? It needs to be as Quartz paths because I would like to be able to fill the paths with colors, gradients, etc. How do I do that? Is there a way to export (?) from illustrator or such apps and import paths on Xcode t...

IPhone/IPad: Image Resolution Question

So I'm making a universal app (iphone3gs/iphone4/ipad/)... But I have a question about images. Say we have an image of a smiley face... Would you have 3 separate images (each saved with a different width/heights) for all devices i.e.: smiley-iPad.png (for ipad) smiley.png (for iphone 3gs) [email protected] (for iphone 4) or would you j...

UIImageView simply does not appear in custom UITableViewCell

I have a table cell to which I'm adding subviews programmatically. All the textual subviews work fine, but I can't get an image subview working at all. You'll notice that I set the background color to black. This is simply to indicate to me that the subview is indeed being initialized and positioned properly within the cell. When I remo...