ios4

Detect Retina Display

Does iOS SDK provides an easy way to check if the currentDevice has an high-resolution display (retina) ? The best way I've found to do it now is : if ([[UIScreen mainScreen] respondsToSelector:@selector(scale)] == YES && [[UIScreen mainScreen] scale] == 2.00) { // RETINA DISPLAY } ...

TableView help pushing a custom view

Hello again, So I am trying to simple traverse to the next level of a table view by doing this: - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath { if (indexPath.row == 1) { FiltersController *aFiltersCont = [[FiltersController alloc] init]; aFiltersCont.displayedFilters = [appD...

Iphone programming IOS4 - add video to HTML code in JSON wrapper

Hello, I am writing an application which is based in HTML and has a JSON wrapper in the app. After the 4.0.2 update the iphone does not play video files properly anymore. All the code to play video files is based in HTML but after the update it shows the play button only and I can not click on the video to play it. The file is loca...

Subclass NSCache - App Singleton

I am writing an iPhone app and I want to create a NSCache singleton. I am having trouble, here's the code that I have: MyAppCache.h: #import <Foundation/Foundation.h> @interface MyAppCache : NSCache {} + (MyAppCache *) sharedCache; @end MyAppCache.m: #import "SpotmoCache.h" static MyAppCache *sharedMyAppCache = nil; @implement...

HTML with event.preventDefault

If the html document is disabled. (no scrolling...) document.ontouchmove = function(event){ event.preventDefault(); } Can I selectively enabled elements in the html document? such as a div, span What javascript should I use to do that? ...

Strangeness with a view controller's frame

I've created a simple application with a single view controller and removed the status bar so I can use the full height of the screen. The view controller's xib file loads perfectly well, displaying a backdrop image very nicely. I then added a custom view object which will be handling certain graphical tasks directly for me, and asked it...

How to check programatically if an App is installed?

I am developing an iPhone application which will install few third party applications in an enterprise. I have the information about the bundle IDs. Is there a way to check if the application is already installed, using some system APIs? Currently the application gets installed again, overwriting the current installation. I need to preve...

AVCaptureSession commitConfiguration stuck

Hi all, I'm working on an iPhone app that requires both live capture frames and the ability to take full resolution photos. This requires switching from AVCaptureVideoDataOutput to AVCaptureStillImageOutput and back. I do this by having 2 outputs, and changing the preset according to the needed state. This is the code that is called a...

NSDictionary functionality question

Hello All, So I am trying to save arrays into an NSDictionary on the fly. Let me show you the code and explain what is going on. for (int x= 0; x <[appDelegate.people count]; x++) { Person *aPerson = [[Person alloc] init]; aPerson = [appDelegate.people objectAtIndex:x]; if ([appDelegate.groupedBusiness objectForKey:aPerson...

iPhone: How much memory usage is too much?

This is a pretty weird question I guess, but I've never really had to deal with memory allocation before so now I'm really paranoid about using too much of it or forgetting to deallocate stuff. I've found the extremely useful memory leak tool (and am quite proud to see that, so far at least, I'm not losing anything that way) and also the...

html video code

Hello all, I am writing video code in an iphone, based on HTML. With the following code the movie will play but when I click done the video stops but the html page is gone, all I see is a giant video play button taking up the entire screen. Anyone have any ideas how to go back to the page where the video was clicked? a href="videos.m...

Multiple Copies of XCode - Testing code against older versions of iPhone SDK

I am interested in testing my current iPhone app against an older version of the SDK (3.1.3). I know that I can compile my code to run on this version of the SDK, but I want to test it to make sure it still works since I am using newer APIs and using weak linking so that it will continue to work on older iOS versions. Ever since upgraded...

attempting to initialize a mutable array, and then load it with images that are referenced by name

Howdy one and all, I am trying to write my first iOS app that is not out of a book (though I guess I am stitching things together like crazy....) At this point, I am attempting to initialize a mutable array, and then load it with images that are referenced by name (they are in with the project.) This is what I have so far, and based u...

iPad Rotation and Keyboard pop up

I'm building an app that uses a UIView that contains a UIScrollView within it so that when the keyboard shows up, users can still scroll downwards to see the content within the view. It seems like I have gotten everything perfectly set up but when I rotate, everything goes completely unusable. The views are all out of place and I am unsu...

MPMoviePlayerLoadStateDidChangeNotification isn't called

Hi, I'm converting my iOS3 app to iOS4 and having problems with the movie player! I have followed the example here: http://is.gd/eowgi (I don't need it to work in iOS3 anymore!) and subclassed UIViewController with the following code: #import "moviePlayer.h" @implementation moviePlayer @synthesize mainAppDelegate; @synthesize mp; - ...

What's the simplest way to obtain the current weather and forecast for an iPhone app?

Using iOS 4, what's the quickest way to obtain the user's current location (assuming they grant it to you) and use it to obtain the current weather conditions and forecast? I'm mainly interested in solutions that don't have any licensing restrictions and don't use APIs that will ban the app from the app store. Many of the other relat...

Why am I getting an error?

The following line of code compiles with the following warning: Code: [[[AVAudioPlayer alloc] initWithContentsOfURL:url error:&error] play]; Warning: /Users/moshe/Development/iPhone/Apps/Live/iDecide/iDecideViewController.m:29:0 /Users/moshe/Development/iPhone/Apps/Live/iDecide/iDecideViewController.m:29: warning: multiple me...

iOS 4 Application Termination and Undo

What is a good way to handle iOS 4 app termination when using an NSUndoManager? I have an iPhone (iOS 4) application that uses Core Data. The app allows the user to edit managed objects, and I implement undo using NSUndoManager in a straightforward manner: Before displaying an editor view modally, I create a new NSUndoManager for the ma...

Pull data from a website into my iphone app

I basically want to make part of my iphone app display schedule within the app, my thought is to make an xml template and then edit the file on the webserver as the schedule changes, then as a user views the file the schedule will load. My question would be what the best way would be to implement this? Just call the URL? I would like to ...

Problem with UIImagePickerController

I'm having a problem with the UIImagePickerController being presented with presentModalViewController. As soon as the view displays (be it camera or photo album), the app crashes. The whole UI is created in code, no interface builder. This has only stopped working since I've been updating the code to run on ios4. Using leaks, I can't fi...