iphone

IPhone mp3 playback problem

Hello everyone. I'm writing a game for iphone, and without background music it runs smoothly at 30 fps. But if I add music (using AudioQueues or AVAudioPlayer, both give similar effect), framerate periodically drops to 10 (about once per second), and then returns to 30. Music is mp3@128kps, 44kHz. It degrades performance not constantly, ...

If I install the 3.0 SDK, can I still make 2.0 compatible apps?

I've been putting off installing the 3.0 beta SDK in case I can't make apps to target 2.0. If I install 3.0 on my computer and iPhone, will I still be able to submit apps to the app store for users with 2.0 iPhones to download? Will I have to wait until 3.0 is released to submit more apps? ...

Empty UIView with minimal drawRect: overhead

Hi, I have an application that has three nested views that are mechanically important, but have no visual elements: A vanila UIView that doesn't have any content of its own, and is simply used as a host for CALayers. A UIScrollView (that is queried for it's origin and used to position CALayers in 3d: I really only use this view to fai...

Running a gcc execuatble in Iphone simulator or terminal

I have a helloworld.c file, with the contents : #include "stdio.h" main{ printf"Hello World\n");} I compile it using the arm-apple-darwin-gcc-4.0.1 toolchain and create a hello.out executable. Can i run this execuatble on iPhone Simulator / terminal ? ...

Why is my initWithNib method not called when the view controller is loaded?

I have an class that inherits from UIViewController. There, I want to make some ivar initialization like this: - (id)initWithNibName:(NSString *)nibName bundle:(NSBundle *)nibBundle { // Load the view nib NSLog(@"Hello Earth!"); if (self = [super initWithNibName:nibName bundle:nibBundle]) { self.visibleIndex = 0; NSLog...

iPhone TableView Cell - weird bug in device : cell content not displayed

I have this really weird bug. When I scroll down my table view, down to a section I called "description", the cells in this section won't be displayed. Instead, the title of the section is repeated again and again. It sounds like whoever is in charge of the screen display in the iPhone does not find anything to display and let what was o...

How can I exclude a piece of code inside a core animation block from being animated?

I have an core animation block where I call a method that will load a view controller. there is an custom transition between two view controllers happening. However, when the view controller builds up the interface, all this stuff is affected by core animation. Although it results in some interesting effects, I don't want that ;) [UIVie...

How to delete a row in UITableView manually?

Here's what I've come up with: NSIndexPath *indexPath = [NSIndexPath indexPathForRow:0 inSection:1]; // my table view has 2 sections [tableView deleteRowsAtIndexPaths:[NSArray arrayWithObject:indexPath] withRowAnimation:UITableViewRowAnimationTop]; Everytime I build and run, it throws the following exception: Invalid update: inval...

can i write in XML file in objective c application?

i want to write some data in XML file.I can read in XML file but how can i write this. please give me some intruction. ...

iPhone Modal View Smaller that the screen

Hi I'm trying to do something that shouldn't be that complicated, but I can't figure it out. I have a UIViewController displaying a UITableView. I want to present a context menu when the user press on a row. I want this to be a semi-transparent view with labels and buttons. I could use an AlertView, but I want full control on the format...

Is NSNumber overkill for an instance-level counter?

I'm new to Objective-C and Cocoa. I've read that NSInteger and NSNumber are preferred when working with simple integers because they're the "platform-safe" versions of the primitive numeric types (and in NSNumber's case, wrapped in an object). So, I need a counter in my class that gets incremented when an NSTimer fires. On an Apple fo...

UIWebView incl. content encoding/decoding

My aim: to continue a web session across an app interruption (eg. incoming SMS that is read). Approach A: I have tried to store the contents of a UIWebView in NSUserDefaults, like this: NSData *webViewData = [NSKeyedArchiver archivedDataWithRootObject:webView]; [[NSUserDefaults standardUserDefaults] setObject:webViewData forKey:kDefaul...

NStimer slow when use CGContextClipToRect in iphone device

I am new to iphone development. I used NSTimer scheduledTimerWithTimeInterval 0.01 seconds for game loop. The game consists drawscreen function inwhich I use CGContextClipToRect to clip the large images for animation. But the speed 0.01 seconds is working in simulator only not in the iphone(device). How can i overcome this problem? I res...

Is there an way to make an invisible UIButton that will still "be there" and catch touch events for my UIImageView?

I thought to be clever and just put an transparent UIButton over an UIImageView with the exact frame size, so that I can wire it up easily with any event I like, for example TouchUpInside, and make it call a action method of an view controller when the user touches it. Well, it works until alpha is below 0.1f. If I do 0.01f, it will not ...

Am I using NSTimer correctly in iPhone View-based app?

I'm working on a simple proof-of-concept for an iPhone app (and important bit of info, I'm pretty new to Mac OSX development all around). I created a view based app with a timer. I declared my NSTimer in the interface of my app's controller, used @property and @synthesize, and I initialize it in the controller's viewDidLoad method with...

willAnimateSecondHalfOfRotationFromInterfaceOrientation not called in root view controller

I have created the one rootviewcontroller , and then make that geosensitive by writing - (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation { return YES; } In rootviewcontroller willAnimateSecondHalfOfRotationFromInterfaceOrientation method is called and images are resizing. I also have so...

GPS Application for iphone

Hello I want to develop an iphone application which uses GPS. So from where i can start ? ...

Is it possible to change the app icon programmatically?

I want to make two different app icons, and programmatically switch betweem then. When the user quits the app without finishing an workflow-process, then I want to switch to an icon that will indicate that there's something undone when launching the app. Well, just theoretically, just for testing. I think that the icon file is just a no...

Multiple parameters in NSURL object

I would like to pass multiple parameters from the iphone sdk to a server-side php which interfaces with a mySQL database. i found some answers on how to do this, but i'm having a hard time figuring out how to include several parameters. what i have right now is - (IBAction)sendButtonPressed:(id)sender { NSString *urlstr = [[NSSt...

UIWebView resetting my form input values

I have a UIWebView that is typically browsing a J2EE application but I have a hardcoded check in shouldStartLoadWithRequest: to find the string "mobile_get_photo" in the URL and if present push a new view controller onto the navigation controller that allows a user to select an image via the photo library or the phone. The mobile_get_p...