iphone

AVAudioRecorder Won't Record On Device

This is my method: -(void) playOrRecord:(UIButton *)sender { if (playBool == YES) { NSError *error = nil; NSString *filePath = [[NSBundle mainBundle] pathForResource:[NSString stringWithFormat: @"%d", [sender tag]] ofType:@"caf"]; NSURL *fileUrl = [NSURL fileURLWithPath:filePath]; AVAudioPlayer *playe...

Connectin an iPhone device to an external device

Hello, I have to develope a software that connect to an external device. The problem is the connection. Is there a way to connect without Apple's special chip? Any way is possible: Bluetooth, Wifi, or USB. Thank You ...

iPhone - database reading method and memory leaks

Hi, in my application, a RSS reader, I get memory leaks that I can't fix because I can't understand from where they come from. Here is the code pointed out by Instruments. -(void) readArticlesFromDatabase { [self setDatabaseInfo]; sqlite3 *database; articles = [[NSMutableArray alloc] init]; if(sqlite3_open([databasePath UTF8String]...

Is there a list of notifications which are posted by the default notification center?

I tried to find one, but couldn't. Would like to know what kind of notifications are posted around in iPhone OS, by default. ...

How to get rect size of UITableViewCell?

How can I get the rect size of a UITableViewCell? I am trying to display a pop hover every time the user clicks on a cell, and would like the pop hover to appear centered on every cell: [replyPopover presentPopoverFromRect:CGRectMake(77, 25, 408, 68) inView:self.view permittedArrowDirections...

How to post and receive an notification?

Is there an easy-to-grock pattern how to send a notification and how to receive one? Code snippet? The docs write like 150 pages on the topic. Would like to see a quick example. ...

How to provide an own UIWindow subclass as the main window in an iPhone app?

For inspecting all events posted to the views of the window, I want to make a subclass of UIWindow and make that -keyAndVisible in the app delegate. However, my project already came with an nasty MainWindow.xib file ;-) so I find it hard to do that now, since that nib guy is creating the window. Is there any way I can get rid of this Ma...

UITableViewCells loaded from NIB always nil

I'm trying to create a simple form using a UITableViewController as documented in the Apple Developer Documentation here: http://developer.apple.com/iphone/library/documentation/UserExperience/Conceptual/TableView_iPhone/TableViewCells/TableViewCells.html What I'm trying to do is located in the section entitled: "The Technique for Stat...

Is there a rule of thumb when porting iPhone graphics to Android?

I'd like to port my iPhone app to Android. The interface is constructed with artwork designed for 320x480 resolution. What steps do I need to take when I'm constructing the XML interface for the Android so that my GUI will be compatible with the different screen sizes (or at least the most popular ones...)? ...

Will iPhone App with future "Availability Date" show up in "New Releases" on that day?

I plan to submit my first iPhone game "The Twiggles" to the iPhone app store today. Like many people suggest, I want to set the "Availability Date" to a date way in the future and change it later. But there are two different opinions on what to do once the app is approved: A: Some people say, I have to quickly change the "Availability D...

UIImagePickerController can not select picture

I have some problem when i work with UIImagePickerController .when I presentModalViewController,and the picker pops up right,but i can not select a picture! when i touch on the picture list, the list can only scroll up and down,but can not select! how about this? thanks. ...

How to not persist NSManagedObjects retrieved from NSManagedObjectContext

Hi I parse an xml file containing books, for each new node I go: Book *book = (Book*)[NSEntityDescription insertNewObjectForEntityForName:@"Book" inManagedObjectContext:managedObjectContext]; To obtain an NSManagedObject of my Core Data Book Entity, I then proceed to populate the managed Book object with data, add it to an array, rin...

locationManager:didUpdateToLocation:fromLocation: vs. mapView.userLocation.location

For the moment, I use mapView.showsUserLocation=YES; for the radiating blue icon showing the iPhone's position, but do not know how to get the coordinates behind it. I tried the locationManager:didUpdateToLocation:fromLocation: with the configuration of self.locationManager = [[[CLLocationManager alloc] init] autorelease]; locationMana...

How to check if *number* is in a array

Pretty basic programming question, I know PHP have a function for it, but does the iPhone OS have one? I want to check if the current indexPath is a value in an array. PHP Example: <?php $indexPath = 3; $array = array("0", "1", "2", "3", "4"); if (in_array($indexPath, $array)) { // Do something } ?> Does anybody know how to do the...

UITextView - preserving carriage returns on COPY - iPhone

Hello Everyone, When I try to copy text from a UITextView to say an Email message to compose and send, the carriage returns (new lines) of the text disappear and the text connects up into one LARGE paragraph. I am not sure why this is happening. How do I fix this? Thanks ...

How can I make Director to be attached multiple times, each time to different view

Hello to all. I need to attach cc2d Director in different views. After a lot of manipulations I found that I can't use only one instance of EAGLView that is present in [Direcor sharedDirector]. So, I have done some changes, and now I use a separate instances of EAGLView for each view. The problem I am trying to solve, could be describe...

What's a good place to unregister an observer from the notification center?

When I add an observer to the default notification center, where would I unregister that? Example: I have a UIView subclass which lives inside a view controller. That subclass is an observer for the FooBarNotification. If this notification is posted, that view will get it. But now, the view controller decides to throw away the view. Is ...

Use of type 'id' in cocoa class

Hey guys, I want to implement a class which can be used by two classes of my project. One is manipulating 'NewsRecord' objects. One is manipulating 'GalleriesRecord' objects. In another class, I may use one of the two objects so i do something like that : // header class id myNewsRecordOrGalleriesRecord; // class.m // NewsRecord an...

Google Translate API for iPhone - UTF8 problem in Chinese Translation

I've tested a workable translation API url by: http://translate.google.com/translate_a/t?client=t&amp;text=%E5%BB%A3%E5%A0%B4&amp;langpair=zh|zh-CN And it returns the correct result as the following which is in JSON format: {"sentences":[{"trans":"广场","orig":"廣場","translit":"Guǎngchǎng"}],"src":"zh-CN"} However, when I try to use thi...

How to write the VIN Scanner tool

Hi, I have a requirement where I have to scan the VIN barcode. Can anyone guide me how to proceed. Its an iPhone Requirement. ...