Tag: ipad

How to make an ipad app only portrait?

I am making an ipad app, and i set the the app to only portrait, but it still works in landscape? Why is this happening only on an ipad? How do i fix this? Note: if the answer is in code, please write it in swift.

Not sure how to properly subclass UIApplication while using storyboards

I want to return to my storyboard’s initial viewcontroller after X time of user inactivity (no touch events fired). After some research I see that the most common way of detecting inactivity is to fire an NSTimer and reset the interval when an event is fired. To detect a fired event, we override [UIApplication sentEvent:] […]

Connect to MySQL directly from an iPad app (not via PHP, etc.)

Before anyone has a chance: Yes, i know it’s a bad idea. Please, don’t give me a lecture on how i should use a web service instead. Thanks. So, how could this be done? I found this bit http://www.karlkraft.com/index.php/2010/09/17/mysql-for-iphone-and-osx/ and thought it might do the trick. I got a bunch of ARC error messages, cleaned […]

CoreData application directory crashes on iOS3

I have nearly finished my application that works well on iOS4, however when loading it into the 3.2 simulator it crashes with.. 2010-12-21 07:54:32.052 App[14044:207] *** -[NSPathStore2 URLByAppendingPathComponent:]: unrecognized selector sent to instance 0x4d2b640 2010-12-21 07:54:32.054 App[14044:207] *** Terminating app due to uncaught exception ‘NSInvalidArgumentException’, reason: ‘*** -[NSPathStore2 URLByAppendingPathComponent:]: unrecognized selector sent to instance 0x4d2b640’ […]

Remove ability for portrait orientation for app in iPhone SDK

Is there a way where I can only allow my app viewable in landscape mode? I’ve managed to default the application’s orientation to landscape, however in the iPad simulator, when I do Command->Arrow, the application rotates to portrait. I’ve removed the listings in the plist under “Supported interface orientations” for both of the Portrait entries, […]

Why is my object not being passed correctly via segue?

Say I have 2 controllers, BarViewController and FooViewController. FooViewController has an outlet to a UIImageView called imageView: @property (nonatomic, weak) UIImageView *imageView; BarViewController has an outlet to a UIButton button. BarViewController has a segue from this button to FooViewController, called BarToFooSegue (done in storyboard). When I run the following code, and call NSLog on FooViewController.imageView.image, […]

Objective-C SQLite join tables from multiple database

I am working on an IPAD project. The project has 2 sqlite database. the first one say customer.sqlite and the second one called address.sqlite. Customer.sqlite comes along with the app and the address.sqlite is downloaded from the server every time the app is started. Everything works fine. The question i have here, can i do […]

Why is scale] 1 on an iPad 3 with Xcode 4.2?

When testing on my iPad 3, [[UIScreen mainScreen] scale] == 1.0 My understanding is that this should be 2.0. I am using the iOS 5.1 SDK with Xcode 4.2 on Snow Leopard, which I understand is not an “officially supported” configuration. However, I can’t imagine why that would affect what is happening purely on the […]

Trying to understand AVAudioPlayer and audio level metering

I’m trying to understand AVAudioPlayer and audio level metering. What I have below is an object “AudioPlayer” that is playing a short audio sound. Now I want to output the power of this sound (decibels). Somehow I don’t think I’m doing this right. audioPlayer.meteringEnabled = YES; [audioPlayer play]; int channels = audioPlayer.numberOfChannels; [audioPlayer updateMeters]; for […]

Localizable.strings (base) x English

When you localize a file on Xcode 5 now, you have this “base” file, that I understand will be used if the user is using another language that was not localized. On older versions of Xcode, you did not have that. I want english to be the base language, that will be used by default. […]