Tag: iphone

MPVolumeView in a UIAlertView?

Is it possibe to put an MPVolumeView in a UIAlertView? I have tried to put it inside of it, but it does not display. It may be the sizeToFit or initWithFrame: part? Is there a way of testing if the MPVolumeView is actually being created? Here’s the code I initialize both the UIAlertView and MPVolumeView […]

What about this mailto: openURL might be causing a this malloc crash?

I’m using openURL to send an email w/some links. The function looks like this: // + (void) sendEmail:(NSString *) subject withBody:(NSString *)body { NSString *mailString = [NSString stringWithFormat:@”mailto:?@&subject=%@&body=%@”, [subject stringByAddingPercentEscapesUsingEncoding:NSASCIIStringEncoding], [body stringByAddingPercentEscapesUsingEncoding:NSASCIIStringEncoding]]; [[UIApplication sharedApplication] openURL:[NSURL URLWithString:mailString]]; [mailString autorelease]; } The code that calls this function looks like this: [AppNameAppDelegate sendEmail:subjectLine withBody:bodyText]; No matter what the […]

iPhone: UITabBar custom image doesn't work

I use the following UITTabBar and UINavigationBar built-in code to place my own custom image on the background of Tabbar and Navigation bar. It works great in my iPhone 3.0 application. Now, i am trying to convert my iPhone 3.0 application to iOS4.0. I ran the same project in Xcode 3.2.3(for iOS 4.0) now but […]

MASSIVE AVAudioPlayer Memory Leaks

I am using AVAudioPLayer to do the audio for my game. I have the following code in a method in a seperate class, which is called every time I want the ‘boing’ sound to play. Problem is, it leaks huge amounts of memory, to the point where the game becomes unplayable. Now i’m not releasing […]

Load PDF from documents directory – iPhone

Instead of loading a PDF from the resources folder I would like to load it from the documents directory. I have been trying to do this for days but the CGPDFDocumentRef keeps returning NULL. Here is my code: // Get Documents Directory NSArray *searchPaths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES); NSString *documentsDirectoryPath = [searchPaths objectAtIndex:0]; NSString *tempPath […]

why wont my UILabel display a NSInteger

I have a ViewController, and GameController class which is just subclassed from NSObject. The view controller has one button linked to it and fires a IBAction that inits a GameController class. In the init of the GameController class is a CADisplayLink that adds one to an int named score. In the debugger the score is […]

Retaining repeating NSTimer for later access?

I am creating an NSTimer in the createTimer method that I want to refer back to in the later cancelTimer method. To facilitate this I am taking ownership of the NSTimer via a retained property so that I can refer back to it later. The issue that is confusing me is, if I start the […]

NSPredicate for to-many relationship, where a relationship (NSSet) must contain Entities defined in an NSArray

Given the following Core Data Model: -> : to-one releationship ->>: to-many relationship Entity A ->> Entity B Entity B -> A // each B belongs to exactly one A Entity B ->> B // a B can be related to other B’s So in class A: @property (nonatomic, retain) NSSet *Bs; In class B: […]

Why Isn't Core Data Fetching My Data?

My data for for an entity’s attribute is not being fetched upon restart or not being saved before quitting (could be either case). The bottom line is, the data is not showing up in the table upon restart. I think I may need to consolidate my core data methods or move them to the app […]

userLocation: latitude/longitude return zero?

I am just looking at mapKit and decided to make a quick button to display my current location, however when I press the button my latitude/longitude always display as [0.000000] [0.000000]. The mapView is loaded as I can see the map on the simulator before I press the button. Previously I have done this by […]