objective-c

rfc850 date format and NSDateFormatter

Im having a hard tim getting the NSDateFormatter to give me a correct date format. I need it to look like this: Mon, 04 Jan 2010 10:10:00 GMT But I am getting: Mon, 04 Jan 2010 10:10:00 GMT+00:00 Using the format string: EEE',' dd' 'MMM' 'yyyy HH':'mm':'ss z No matter what value for timezone I use, the +00:00 appears to be stuc...

Memory leak in XML Parser

Hi everyone I use NSXMLParser for parsing an XML document. I have the following functions (among others): - (void) parserDidStartDocument:(NSXMLParser *)parser { // Init tempString tempString = [NSMutableString string]; } - (void)parser:(NSXMLParser *)parser didEndElement:(NSString *)elementName namespaceURI:(NSString *)n...

Updating a UITableView's data

In my application, I have a UITableView with a few rows (let's call it TV1), now, at the bottom of these rows is a row that drills down into another (TV2). This new TV2 asks you which type of data you would like to add to the first view. Then, when the user selects which kind, they're brought to another view, in which they fill in some f...

iPhone -- possible to tell the difference between a fingertip and a whole fingerpad?

Is it possible to detect exactly how much finger is in contact with the screen? Say I wanted to make a fingerprinting app, how would I detect the outline of a person's fingeR? ...

CoreAudio AudioUnitSetProperty always fails to set Sample Rate

I need to change the output sample rate from 44.1 to 32.0, but it always throws an error, Out: AudioUnitSetProperty-SF=\217\325\377\377, -10865. I don't know why it will let me set it for input, but then not set it for output. My code is: - (void)applicationDidFinishLaunching:(NSNotification *)aNotification { OSStatus MyRenderer(void ...

Copying data to the Application Data folder on the iPhone

I am in the process of (finally) loading my App onto an iPhone device for testing. So far I have only tested the App in the simulator. The application is data-centric and uses an SQLite database. I have created an appropriate SQLite database with sample data which I used in the simulator. How can I copy this .sqlite3 file to the actual i...

File size in Snow Leopard

Hello there! I'm trying to figure out how to convert a file's (or directory's) byte size into kilobytes, megabytes, gigabytes, etc... respectively according the file's or directory's size so that is matches what the Finder displays in the panel when you hit "Get Info". The byte size I get perfectly matches the byte size as reported in...

keyboard not appearing when uitextfield is pressed

I have presented a navigation controller (Nav1) as modal view controller from rootViewController Then from Nav1 i created another navigation controller (Nav2) and presented it as modal view controller. In nav2 when i click a table cell it pushes a view controller containing UITextField Now the problem is when I click on UITextField it...

What is the easiest way to populate an object's attributes from an XML response message?

I have a fair bit of experience working with the iPhone SDK. I have a couple fully developed apps including a utility application for tracking data and a board game. I would consider myself a novice on the iPhone SDK. I also have no issues with reviewing documentation and examples for hours until I understand something, as long as the do...

can we check applicationwillresignActive in iphone simulator?

- (void)applicationWillResignActive:(UIApplication *)application { NSLog(@"resigning active status..."); } i have tried hardware-lock in iphone simulator but this isn't called. I do want to call it in another UIviewcontroller class not in the appdelegate itself.I also added in the viewController's header File. ...

Copy folder from iPhone Resources directory to document directory

BOOL success; NSFileManager *fileManager = [[NSFileManager defaultManager]autorelease]; NSError *error; NSArray *paths = NSSearchPathForDirectoriesInDomains( NSDocumentDirectory, NSUserDomainMask, YES); NSString *documentsDirectory = [paths objectAtIndex:0]; NSString *documentDBFolder...

iphone variable problem

// stampDuty percentages float stamp1 = (invalue * 1 / PCENT); float stamp2 = (invalue * 2 / PCENT); // #defined PCENT as 100 // stamp duty NSNumber *stampN1 = [NSNumber numberWithFloat:stamp1]; NSNumber *stampN2 = [NSNumber numberWithFloat:stamp2]; // then goes to // Stamp Duty invalue is entered in the textfield b...

[self.managedObjectContext deleteObject:self];

[self.managedObjectContext deleteObject:self]; Is there a problem, conceptually, with executing this line of code? ...

Are there any Objective-C web frameworks?

Are there any Objective-C web frameworks? The only frameworks I've found is frothkit. I'm primary looking for a way to write RESTful json web services in Objective-C. ...

Programmatically change the UIImageView displaying image1 to image2

The UIImageView is placed in interface builder. I already created an IBOutlet. How do i programmatically change the UIImageView to view another image. Can someone please help me? ...

Error, could not create MachMessagePort for database doctor (com.apple.addressbook.migrationdaemon) starting in process migration

I'm working in address book for iphone. it generate address into UILabel. when I'm running the application everything goes well, but after showing about %30 of the addresses and sadenly stopped without any reason! Only in terminal shows: Error, could not create MachMessagePort for database doctor (com.apple.addressbook.migrationdaemon) s...

Encoding an Objective-c Block?

Is it possible to encode an objective-c block with an NSKeyedArchiver? I dont think a Block object is NSCoding compliant, therefore [coder encodeObject:block forKey:@"block"] does not work? Any ideas? ...

Use C Struct in Objective C

Hi, In an Xcode project I have a C file with functions, it compiles and works OK I want to wrap my C code in struct(s), how will I be able to call them in Objective-C? ...

Delete a photo from the user's photo library?

Hi, Is there a way I can delete an image that is loaded into my app from a UIImagePickerController? I want to be able to delete the image from the user's photo library when the user performs a specific action. I am prompting the user to choose a image from their library, then it gets loaded into my app at which point the app does some...

Is this the best way to dynamically load a UIViewController object based on item selection?

My root view contains three sections in a table view. Depending on which section is selected a corresponding view controller will be popped onto the view stack. The following didSelectRowAtIndexPath method is from my code and it works as I expect, but I was wondering if this is the correct/most elegant way to do it. I'm an Objective-C ne...