iphone

Execute code /after/ UIImagePicker is dismissed

I have a simple iPhone application. I display a UIImagePicker, and let the user select an image. I then execute some code on the image, and want this code to execute after the UIImagePicker has been dismissed. EDIT: updated code, problem remains: -(void)imagePickerController:(UIImagePickerController *)picker didFinishPickingMediaWithIn...

Playing Audio in an iPhone App

What do you think is the best (i.e. most memory efficient) way of playing a few 30 second audio files (m4v) from the bundle within an app to the external speaker? The audio files have to play automatically as soon a specific view appears. There is no mixing, etc. going on. However I'm listening to the microphone at the same time via AVA...

table view cell deleting now working

ive used the sdk standard code for deleting however it crashes once i press the delete button. i am using this code - (void)tableView:(UITableView *)tableView commitEditingStyle:(UITableViewCellEditingStyle)editingStyle forRowAtIndexPath:(NSIndexPath *)indexPath { if (editingStyle == UITableViewCellEditingStyleDelete) { // Delete th...

how to copy an NSMutableArray to anotherNSMutableArray

hi, if i have 2 NSMutableArray declared in .h, synthesize at .m files, how can i copy whole contents of array 1 to 2? actually the same array. can tried using this code only: [self.data addObjectsFromArray:self.temparray] to copy data from temparray to data. doesn't seems to work..... ...

Is there a safe way to schedule an alert for an calendar app?

I want to make a special calendar app, but I am afraid it's not possible to safely schedule an alert for an event. For example: I set up an alert for an event which starts in 3 months. I want to get notified 2 days before the event starts. In iOS 4 there is multitasking, so my app could run in the background all the time. But now lets...

Couple of questions about Cocos2d and iPhone ??

1- is it possible to use interface builder to design the game background and then use code to add cocos2d objects? 2- Is it possible to use iphone UI objects as well as cocos2d objects, for example uibutton, uiScrollView, etc. 3- is it possible to useiphone default template, and cocos2d templates togather? for example my home screen is...

Parsing Multiple XML Docs from a Continuous Stream with NSXMLParser

My iPhone App is socket based and receives a continuous, non-delimited stream of XML documents one after the other in which I intend to parse with the event-based NSXMLParser. Example: 2 documents one after the other <?xml version='1.0' encoding='UTF-8' ?><document name="something"><foo>bar</foo></document><?xml version='1.0' encoding=...

iPhone: "Locking" a Cell to the Top of TableView

I am trying to have a cell at the top of the table always remain there and not scroll down when an object is added i.e. the cell should stay at indexpath.row==0. Is it possible to lock a cell to a certain position in a table? If so, how would this be implemented? EDIT If i made a different section for this cell that would work wouldnt ...

Back button Navigation bar transition.

I created a uibutton that when the user taps it, it performs this action -(IBAction) showMyViewController:(id) sender { MyViewController *mvc = [[MyViewController alloc] initWithNibName:@"MyViewController" bundle:nil]; [UIView beginAnimations:@"animation" context:nil]; [self.navigationController pushViewController: bmvc animat...

iPhone UISlider to NSNumber

Hi All, I'm trying to get the value of a UISlider and store it into part of a CoreData entity. The score I need to save will either be the value of the slider (i.e. slider.value) or 10 minus the value of the slider (i.e. 10 - slider.value) I'm trying to put it into an NSNumber and when I use the intValue it works fine. When I use eit...

Crash involving UISearchDisplayController rotating?

My app seems to crash sometimes when I rotate the phone. ViewControllerA has a UISearchDisplayController. ViewControllerA pushes ViewControllerB onto the nav stack. Exception Type: EXC_CRASH (SIGABRT) Exception Codes: 0x00000000, 0x00000000 Crashed Thread: 0 Thread 0 Crashed: 0 libSystem.B.dylib 0x000791d0 __kill + 8 ...

Can I specify a specific superclass requirement for a class type variable?

I'm making a class that initializes instances of certain classes. This class will be used to initialize a few different types of classes all subclassed from a common super class. Currently I am using an instance variable: Class templateClass; to store the class type. I get compiler warnings saying methods aren't supported by templa...

Is delegation the preferred way to do this?

I have an UIViewController subclass that allows the user to add a new model object, in this case a bank account. I named the view controller AddBankAccountViewController. The user can enter the account number, an account label and the bank of the account, but this is all done in separate view controllers. I'm using delegation to let Add...

SDK StoreKit Warning

I am getting down to the last programming on my little app and I am using the standard StoreKit code as follows: - (void) paymentQueue:(SKPaymentQueue *)queue updatedTransactions:(NSArray *)transactions { for (SKPaymentTransaction *transaction in transactions) { switch ( transaction.transactionState ) { case SKPayment...

adding a new sqlite field problem...

I've added a new field to an SQLite db table and have also added a new attribute in core data xcdatamodel. I made sure to delete the app from the iphone simulator. the app runs fine, but isn't finding the new field. if i change the data on an existing field in SQLite and relaunch the app, the change is there. the new field is not. anyo...

Value from bluetooth barcode scanner

I am developing an application that uses a bluetooth barcode scanner (OPN-2002). To read the value from the scanner I am listening for keyboard events with the following code: [textField addTarget:self action:@selector(valueFromScanner:) forControlEvents:UIControlEventEditingChanged]; ... - (void)valueFromScanner:(id)sender { N...

Responding to didReceiveMemoryWarning oddity

So I have a map with a heap of MKPolygonViews overlaid. When I put a couple on it chugs a bit and then if I put them all on the systems sends a didReceiveMemoryWarning to the system that I've responded to by removing the overlays. Now I wondered how much memory it was actually using when this happens, it's only 10MB real memory and 100M...

Running Ajax in Safari

I am writing an app for the iphone that fetches weather information based on location. The weather feed works fine for a set location. I have created a parser that fetches gps coordinates based on a programmed called instamapper which posts coordinates online in csv format. I can execute the code fine in IE within a HTML file and see my ...

Why do Cocoa-Touch class ivars have leading underscore character?

Is there some purpose for this convention? ...

"Submit Application to iTunes Connect..." Xcode feature with filename that contain whitespace

Xcode has a nice feature that let you submit your application to iTunes connect without launching Application Loader. The problem appears when you have a whitespace in the application name. I understand the problem, but since Xcode is naming the file automatically, how can I use this feature without changing the name of my app? Than...