iphone

Autorotation of UIViewController works only when view is added in specific order

Hello together I'm trying to add rotation support to our application which we are currently developing. Unfortunately its not working. So I created a small test project to test what the reason could be. And I found a strange behavior which I cannot explain. In my test project I have two RotationTestViewController (extended from UINavi...

OCUnit testing NSNotification delivery

For a game I'm developing, I have several model classes that trigger notifications when their state changes. Then, the view subscribes to those notifications and can react on them. I'm doing my unit tests for the model with OCUnit, and want to assert that the expected notifications were posted. For that, I'm doing something like this: ...

Record AVAudioPlayer output using AVAudioRecorder

In my app the user plays a sound by pressing a button. There are several buttons which can be played simultaneously. The sounds are played using AVAudioPlayer instances. I want to record the output of these instances using AVAudioRecorder. I have set it all up and a file is created and records but when I play it back it does not play any...

Writing to a property list on the iPod Touch not working but works in simulator

In the application that I am writing I am trying to write a list of fortunes for a fortune cookie out to a property list. In the simulator this works as expected and everything is great. On the iPod Touch I have it reads from said list fine but it never updates the list. Are there any differences between updating property lists using th...

How to compare UIColors?

I'd like to check the color set for a background on a UIImageView. I've tried: if(myimage.backgroundColor == [UIColor greenColor]){ ...} else{ ...} but that doesn't work, even when I know the color is green, it always falls into the else part. Also, is there a way to output the current color in the debug console. p [myimage backgro...

UINavigationController and autorotation.

I have a UIViewController that returns YES in shouldAutorotateToInterfaceOrientation: for UIDeviceOrientationPortrait and NO for everything else. With that view on the top of the stack, I use pushViewController:animated: to push a new UIViewController. The new controller returns YES for anything in shouldAutorotateToInterfaceOrientation:...

problem with UIWebview and link to App Store

In my iPhone application I have a UIWebview that shows an html page. Inside that page there are links that should lead the user to the iTunes application and the application they tapped on. However, when the user taps on the link it errors out with 'too many redirects'. Looking at it with a packet sniffer I see it just keeps redirecti...

Where to place common utility methods on iPhone

In Visual Studio projects I almost always use the App_Code folder or a reference to a separate class library to store my most commonly used Methods, like a method that formats dates. Where and how should I do the same when developing an iPhone App using Xcode? Is this best practice when it comes to iPhone Apps? ...

Best way to implement animation on iPhone SDK?

I know how to implement the basic animation by moving/resizing a UIView. However, the following two animations seems a bit complicated. 1) Imagine a car game, where when you press on the pedal button the speedometer spins. How to do the kind of animation where the bar "fills up" in a circular shape? Imagine the bars in the following pi...

Does any know where to find a breakdown of iPhone users by phone generation

Now that the 3.0 OS & 3Gs are coming out, there will be a wider range in hardware and also in functional limitations (No P2P on first gen iDevices, No compass on anything but iPhone 3Gs, etc) of users that will be (ideally) buying our apps. In the same way that W3schools has it's browser stats page (http://www.w3schools.com/browsers/bro...

Objective-C Setter Memory Management

Still a little confused about Objective-C memory management. I think my confusion stems from what exactly the autorelease means. NSString *theBackendResponse = [[NSString alloc] initWithData:receivedData encoding:NSASCIIStringEncoding]; NSDictionary *accountDictionary = [theBackendResponse propertyList]; [viewController setAccountDictio...

How should I implement Hash for an NSMutableSet storing SQL objects?

Short description of my setup: There is an SQLObject base class which has an integer rowId. it implements isEqual by comparing its class and its rowId: return [self isKindOfClass:[otherObject class]] && self.rowId == otherObject.rowId; It implements hash by XORing its class with its rowId: return [[self class] hash] ^ self.rowId; ...

The version of iPhone OS on “” does not match any of the versions of iPhone OS supported for development with this copy of Xcode.

Hello experts! I have followed Apples tutorial and upgraded my iphone to 3.0. But i get this error: OS Installed on 3.0 (7A341) Xcode Supported iPhone OS Versions 3.0 (7A312g) 2.2.1 And when i try to run an application on my iphone xcode states: No provisioned iPhone OS device is connected. What have I missed? ...

Is Core Video available on the iPhone SDK

I have some video that I'd like to overlay text on top. Is Core video available on the iPhone? ...

Toolbar placement off with Interface Builder

I have a view xib that I'm manipulating through IB (for various reasons) and it will be launched as a modal view in code. I have a Toolbar at top and another one at bottom with some other UI elements in between. When I run the app, the placement of the top Toolbar isn't as I see it during the layout in IB. In IB, the top Toolbar is pla...

iPhone GUI like the build-in iPod application

Need a GUI with many tabs (TabBarController and UITabBar) and one fullscreen view, e.g. a view with player in the native iPod app. It's possible to show last from any tab. Currently use last iPhone SDK 3.0. I tried many approaches, e.g. create Utility and put TabBarController on the flipside, but it throw an exception, because of there ...

Efficient way to make a Programmatic Audio Mixdown

I'm currently working on the iPhone with Audio Units and I'm playing four tracks simultaneously. To improve the performance of my setup, I thought it would be a good idea to minimize the number of Audio Units / threads, by mixing down the four tracks into one. With the following code I'm processing the next buffer by adding up the samp...

Problem with RegExKitLite and ampersands

Hey all, So I'm trying to rip URLs from an NSString using RegExKitLite and I came across an odd problem. NSLog(@"Array: %@", [message componentsMatchedByRegex:@"^(http://)[-a-zA-Z0-9+&@#/%?=~_()|!:,.;]*"]); NSString *message is just some text with a URL within it. The strange thing is it doesn't work with the ampersand in it. If...

How do I store a string as an array in a Cocoa property list?

I am trying to save two strings. One string needs to be saved as type ARRAY in the pList and the second string needs to be saved as String in the Array. I can use the code: [dictionary setObject:(id)anObject forKey:(id)aKey>] but it doesn't save it correctly. I can cast one of the strings as an array, but it still doesn't work right. ...

Where to put project files?

When I first started using Xcode, I didn't like the default project files location. Instead, I made a folder in my user directory instead. Now, I think that is a mistake, since I now link to libraries in my user folder. If I share code with someone, it breaks (since my user folder isn't located on their machines). What's the best prac...