iphone

MPMusicPlayerController stops sending notifications

I have a MPMusicPlayerController playing the entire iPod library and I'm subscribed to the notifications when tracks change etc. This is all working correctly When the end of the playlist is reached, MPMusicPlayerController sends a change of state notification and stops. When I re-start the player, music begins to play again but MPMus...

applicationWillResignActive how to test on iPhone simulator

My iPhone application has code that handles the event for when the iPhone falls asleep, and re-awakens. My question is, how do I test this using either the iPhone or the simulator. Is there a hotkey or command to force the phone or simulator to fake "go to sleep?". Thanks. ...

Objective C Leaks when releasing objects with UITableViewCell

I am running the following code in tableView:cellForRowAtIndexPath: File *file = [[File alloc] init]; file = [self.fileList objectAtIndex:row]; UIImage* theImage = file.fileIconImage; cell.imageView.image = theImage; cell.textLabel.text = file.fileName; cell.detailTextLabel.text = file.fileModificationDate; cell.accessoryType = UITable...

Using delegates for iphone 3.0 classes on older versions, specially the MKReverseGeocoderDelegate

I'm wondering what happens when I use a MKReverseGeocoderDelegate in my ViewController, but the application is running in 2.2.1. Because I'm supporting 2.2.1 but using 3.0 as Base SDK. I have already added the framework as soft linking to support working on 2.2.1 and I understand I have to prepare the code to check if the MKReverseGeoco...

how can I reverse the for( ) loop in xcode?

I'm trying to reverse a for loop in xcode. for (enemyBullet *b in bullets) { } can someone help ? thanks ...

Using audioqueue to stream audio. How to get the length of the audio file before playback ends?

Already finished implementing the player. I want to implement the progress bar. But I wonder if that's possible to do since we are streaming the music. Unless we are provided the length of the song before hand. Please, I need your advice on this. ...

Why is my button clicked event being called 4 times?

Probably a noob question, but I'm trying to write a simple iPhone app that increments a label by the number of times a button is clicked. I have the following code: #import "Controller.h" int *i = 0; @implementation Controller - (IBAction)buttonClicked:(id)sender { NSString *numTimesClicked = [NSString stringWithFormat:@"%d...

storing & reading xml files iPhone

I am using text-editor to store xml files. I know how to read xml files in iPhone application. But the problem which do i get is explained below. When I store xml files through text-editors, it looks perfect. But when iPhone - xCode debugs, xml file data is shown as below. What kind of mistake have I Done? {\rtf1\ansi\ansicpg1252\c...

CoreData: Checking for Null

I have a CoreData entity (waypoint) with a foreign key to another entity (track). When the foreign key is set, or if it is not set, this if statement works fine: if ([wp track]) { thirdLabel.text = [NSString stringWithFormat:@"Part of Track: %@", [[wp track] title]]; } However, if the track that the waypoint is keyed to has been del...

UITabBarController View Position and Size

I have a UITabBarController that adds a viewController, but the positioning is off. There is about a 20px gap at the top of the screen and the bottom of the loaded viewController is hidden. How do I move resize the loaded viewController? viewController = [[FlashCardViewController alloc] initWithNibName:@"FlashCardViewController" bun...

UIImagePickerControllerDelegate Returns Blank "editingInfo" Dictionary Object

Hi there, I have an iPhone app that calls upon the UIImagePickerController to offer folks a choice between selecting images via the camera or via their photo library on the phone. The problem is that sometimes, (Can't always get it to replicate.), the editingInfo dictionary object that is supposed to be returned by didFinishPickingImage...

Trouble with Core Data dates...

I've got a Core Data model set up, with two entities in a one-to-many relationship (Items, and for each item, there can be multiple ResetDates). I'm pretty confident the model is set up correctly. I can add new Items, and when doing so, add a new ResetDate (using the current date, with [NSDate date]). I can retrieve and display Items. W...

problem in drawing using core graphics

hi every one, am making a drawing application for iphone, am facing a prob when i use the core graphics, i am using the CGContext for drawing, and my code is in touchesMoved method, my problem is, if i use the same way in openGL it seems gud, and am getting smooth drawing but, this core graphics guy, also have the same code, but he works...

iPhone memory management Question

Hi , i m new to iPhone programming. i am very confused... plz help .. i have a list of questions. 1. - (void){ ClassOne *ob = [[ClassOne alloc] init]; // do i should use autorelease here ? self.O = ob; [ob release]; // is this correct ?? } or -(void)dealloc{ [O release]; // is this correct ?? } which one will release ob ?...

iphone nslog corrupted data

Hi I am having a weird problem with variable values. This is the code (it is part of a class method): MyAppDelegate *pDelegate = [[UIApplication sharedApplication] delegate]; SomeDictionaryData *appData = [pDelegate.theData retain]; NSLog(@"my instance var: %@",cardIndex); // outputs "my instance var: 4" NSDictionary *currentCard = [...

Is code generated for 2.21 compatible with 3.0?

Hi, here is a good question: I have an application compiled for iPhone OS 2.21. When I run this on my iPhone 3G (updated to OS 3.0) the application runs fine. Is this a guarantee it will run on iPhone 3GS? If I take the same code and compile for 3.0, part of the code do not runs on my iPhone, specially a scroller that does not scrolls....

Lerp between two CGPoints to get values of ALL pixels in between?

I'm trying to lerp between two CGPoints to get the values of all the pixels in between. I'm trying to find a simpler solution since right now I have a confusing recursive mess. The problem is that lerping between two points produces a point in between the two. Now I have two groups of points to lerp through... There has to be an easier...

How can I take a photo frequently with iPhone?

Hello! First sorry for my poor English! Are there any ways to take a photo automatically with iPhone? eg. I need to take 20 pics in 30 sec! Is it possible? I would appreciate any ideas!! ...

RSA Encryption(SecItem.h), PKCSPadding is it available only in Iphone Device?

Hi Can i able to compile and test RSA encryption methods available in Security Framework in simulator or i should buy developer license to enable that framework. is it only available on device with developer license enabled? currently i am getting lot of missing attributes while compiling in simulator , but those attributes are avai...

How do you drag-and-drop from a TableView's icon to a stationary icon?

How do we go about coding drag-and-drop (or tap-and-drag) from a cell in a TableView on an iPhone? I'd like to have a set of drop destination icons that are stationary. I've been trying touchesBegan, touchesMoved and touchedEnded methods. These events fire nicely from a View so I can get a swipe to work nicely. Most likely the destinatio...