ios4

AVPlayer vs. AVAudioPlayer

The documentation for AVPlayer states the following: [The] player works equally well with local and remote media files However, the documentation for AVAudioPlayer states the following: Apple recommends that you use this class for audio playback unless you are playing audio captured from a network stream For the work I am doi...

CoreLocation: monitor only certain regions at a time

In my iPhone app I'd like to monitor if the user enters some particular geographycal regions at a time and act consequently. I now saw that with the new iOS 4 it is possible to register some interest regions (CLRegion) to a CLLocationManager, so it would do some job for me, but... I'd also need to dynamically change the set of the regio...

Iphone's HD screen is not mapping to drawing coordinates

I read about the point/pixels bit in the apple documentation, but still things are not completely clear to me. What I try to accomplish is placing a toolbar just above the keypad that appears when a textview is touched. The way it was working before IOS4 was by placing the toolbar at position 0,480 and then let it come up by subtracting ...

iOS4 code on iOS3 devices.

Is it possible to have iOS4 specific code (ie the MKMapView overlays) in an application, build using 4.0, set the Deployment Target to 3.0, and still have it work so long as the iOS4 code isn't called on a 3.x device? I am trying to do that now, and only calling the iOS4 code if the device supports it, but I can't get it installed. GDB ...

I'm using three20 in an iphone iOS 4 project. I cant compile the project to the device

I try to compile but it fails because it find a duplicated definition of class in one of the dependencies and in the main dependency. I googled a lot and i even found the cause of this, due to a bug in xcode and the optimization for amr6 and arm7 code. But i could't found how to solve this. Has anybody use the three20 library with iOS4 ?...

iPhone app crashing on iPhone 3G iOS4

Hi, My iphone application is crashing on iPhone 3G with iOS4 device with some of the logs as below: 9 libobjc.A.dylib 0x00006504 objc_exception_throw + 104 10 CoreFoundation 0x000a3e08 -[NSObject(NSObject) doesNotRecognizeSelector:] + 92 11 CoreFoundation 0x000a32a4 ___forwarding___ ...

HTTP-Live-Streaming - Loading Issue?

I'm (trying) to use HTTP-Live-Streaming in my app and after weeks of re-encoding it seems to work now without errors by the mediastream validator. On my latest iPod Touch (iOS 4.0) with WiFi the videostream loads in 1sec and switches to the highest bandwidth stream. On another test device iPhone 3G (iOS 3.0) with WiFi it takes up to 30...

iOS: Problems with a button which is on a UIView located in a UINavigationView which is in a UITabView

Hi, I have a following application structure: Tabs - Tab1 - 5. On on of the Tabs I have a navigation view and instead of having a tableview like in following tutorial: http://broadcast.oreilly.com/2009/06/tab-bars-and-navigation-bars-t.html I would like to have buttons on a page instead of a table view just like in this tutorial: h t ...

iPhone App backgrounding with MPMusicPlayer

Hi, I'm working on an iPhone iOS4 application that incorporates playing music from the user's iPod library. I also want to keep track of what songs have been played and be able to change the song randomly, even while in the background. So I set the music player using: [self setMusicPlayer: [MPMusicPlayerController iPodMusicPlayer]]; ...

iPhone - performSelectorOnMainThread:@selector(setNeedsDisplay) doesn't work on iOS 4????

Hi there, I have this really simply code: myPageRef = CGPDFDocumentGetPage(myDocumentRef,CGPDFPageGetPageNumber(myPageRef)+1); if (CGPDFPageGetPageNumber(myPageRef) == CGPDFDocumentGetNumberOfPages(myDocumentRef)) { succBtn.enabled = NO; } precBtn.enabled = YES; [tiledLayer performSelectorOnMainThread:@selector(setNeedsDisplay) wit...

Drawing on a view(in a scroll-view) is consuming too much memory in ipad devices.

I have a view added on a scrollview(maxZoomScale = 1, minZoomScale=0.25). view-frame have a size of near-about(2000, 2000). I have written code for drawing a path(for ~8000 points) in the drawRect of the view. Whenever scrollview's zooming ends, i flagged the view's drawing. Now each time drawRect is called it consumes huge memory (~16MB...

Problem with class_getInstanceSize

I have my class derived from UITabBar: @interface MyTabBar : UITabBar @end @implementation MyTabBar @end Further, in my code, I call class_getInstanceSize for my class and system UITabBar class: size_t origSize = class_getInstanceSize([UITabBar class]); size_t mySize = class_getInstanceSize([MyTabBar class]); I use iOS SDK 4.1. ...

Possible to mirror iPhone/iPad screen on a monitor without jailbreaking?

I have been looking for a way to show the iPhone screen (not the simulator) on a monitor or projector for demo purposes. Previous SO post suggested jailbreak (Veency, iDemo/DemoGod, screensplitr) or simulator. Release notes iOS 3.2 (External Display Support) and iOS 4.0 (Inherited Improvements) mentions that it should be possible to con...

Problem with a countdown in the background in iOS

Here's my code (simplified a bit). I have an NSTimer firing every second which subtracts one from the countervariable. When the app goes in the background, I'm stopping the counter and saving the time the counter would reach zero into an NSDefault value. However, when restoring the app from background, when I subtract the current time ...

In objective-c on iPhone, I am attempting to use the NSFileManager. I can't figure out what directory it starts out in.

My question is, what directory does the NSFileManager start out in, I am really confused because when I run code to tell me what directory I'm in, it just outputs /. Also I can change directory to /private/var but not into /mobile and /mobile/applications which is where the application is. Bellow is my code. NSString *currentpath; fil...

Upgrading Existing XCode iPhone Project to 3.2.3

Hi, I upgraded xcode to 3.2.3 and loaded an existing project I had created with a prior version of xcode. It seems to compile fine as I have set up the correct deployment target and base sdk. When I look under Groups & Files, the Framework group, the Framework files are red and are pointing to the old framework files which don't exist...

How to anti-alias layers against their superviews in iOS?

Hello, I'm trying to lay out a bunch of views as shown in this photo: Each view has sublayers whose backgroundColor produces the colours you see. The problem is that when the view is rotated, the sublayer doesn't anti-alias, so these ugly white specks appear (I confirmed that they are indeed the backgroundColor of the UIView) Is the...

iphone: playing audio playlist in the background?

Hi guys, I'm trying to play sequence of audio files in the background using AVAudioPlayer. When the app is not in the background it plays well, but when the app goes to the background it won't play the second song. Here is my code: -(void)playAudio:(NSString *)path{ NSURL *url = [NSURL fileURLWithPath:path]; NSError *error...

AVAsset and AVAssetTrack - Track Management in IOS 4.0

Hi, The new features list of IOS 4.0 says that AV Foundation framework has got Media asset management, Track management, Media editing, and Metadata management for media items. What do they mean by this? Using track management and media asset management can i access media files from the photos app? Can i make my custom compositions us...

iPhone application crash (iOS4 Only)

Hi there, My iPhone application occasionally crashs the first time it is run after being installed. After this every time i try and run the app it remains on the splash screen or even a black screen until eventually it dies. I have to restart the device to get the application to work. After this it works fine every time. The only change...