iphone

Can MFMailComposeViewController attach an XML doc to an HTML message?

I am creating an email in MFMaiilComposeViewController and if I simply create some html snippets and assign them to the message body - all is well. The resulting email (in GMail and Yahoo) looks like the original HTML I sent. [mailMan_ setMessageBody:body isHTML:YES]; On the other hand, if I also include an XML attachment, my email r...

Drill down tableView: it doesn't show any row on the second view.

I'm trying to build a Drill down tableview to show the information that I have in a hierachy of arrays and classes. I have 3 classes: class Video { nameVideo, id, description, user... } class Topic {nameTopic, topicID, NSMutableArray videos; } class Category {nameCategory, categoryID, NSMUtableArray topics} //AppDelegate.h NS...

iPhone best location for code used by more than one viewcontroller?

The more I develop iPhone apps, the more reusable functions I write. At the moment I just copy them into the .m files that need them. But would it be better to have a separate .m file and #import it instead? I don't wish to compile a library, I just want to know how other folks have handled this. Thanks. Clarification: I want other .m f...

Is there an autorelease pool in class methods?

I have an class method which generates a UIImage, like this: + (UIImage*)imageWithFileName:(NSString*)imgFile { UIImage *img = nil; NSBundle *appBundle = [NSBundle mainBundle]; NSString *resourcePath = [appBundle pathForResource:imgFile ofType:nil]; if (resourcePath != nil) { NSURL *imageURL = [NSURL fileURLWit...

How to detect when UITextField become empty

Hello, I would like to perform a certain action when UITextField becomes empty (user deletes everything one sign after another or uses the clear option). I thought about using two methods - (BOOL)textField:(UITextField *)textField shouldChangeCharactersInRange:(NSRange)range replacementString:(NSString *)string; and - (BOOL)textF...

Three20 Library Cannot find its own headers Xcode iPhone

#import "Three20/Three20.h" Fails. Go download it and build a sample app. If that works, then make a new app from the templates provided, then watch as it fails spectacularly to find the right HEADER_SEARCH_PATH. 1) I've gone to the info page for the TARGET and not the PROJECT (Well, I tried both) and tried a bunch of different paths fo...

How to get last edit point of editing a UITextView?

I am trying to get the last editing point of a UITextView box. I have tried getting the value textView.selectedRange.location,but it always comes out as 2147483647 (which is -1). When should I read this value ...

MapKit Annotations and User location

Hi all, I followed this tutorial to make my first app: http://icodeblog.com/2009/12/21/introduction-to-mapkit-in-iphone-os-3-0/ I would really like to know how to sort the annotations in the Table in order of distance to the user (the nearest annotation is the first one on the table) How is it possible to do that? I understand that I ...

Combining multiple UIImageViews and preserve resolution

I am designing an application where a user places multiple UIImageViews one over another. When the user decides to save this to photo album, I have to combine all these UIImageViews and save it to Photo Library. While combining them I need to preserve their positions, resolutions, zorder. The approach I tried I was to have a parent UIVie...

iPhone Setting ViewController nested in NSMutableArray

Hello I'm trying to set attributes for a viewcontroller nested inside a NSMutableArray, for example I have 3 ViewController inside this array: FirstViewController *firstViewController = [FirstViewController alloc]; SecondViewController *secondViewController = [SecondViewController alloc]; ThirdViewController *thirdViewController = [Thir...

iPhone/ARM calling convention

Hi all, on iPhone/ARM, which CPU registers are functions supposed to preserve, if any? ...

How to request device token on iphone

Hello, I am able to use the didRegisterForRemoteNotificationWithDeviceToken callback method to get the device token of my iphone when subscribing to push notifications. My question is how can I get this token again a later time? When a user subscribes to something in my application, I want to send the device token and the id of the ite...

How do you implement an MPVolumeView?

Hey! I want the user to be able to change the system volume with a slider, and I realized the only way to do this is with an MPVolumeView. But I can't find any example code for it, and every method I try to implement won't show up. So what is the easiest and correct, working way of implementing a MPVolumeView? ...

How do I take a pair of latitude,longitude floats and get the MKMapView to drop a pin and display the location?

Hi, Given a pair of floats for latitude and longitude, and a MapView, how do I get the MapView to drop a pin in the location and "zoom" the screen to display the location? I've read through some of the SO posts and they all seem to be about specific aspects of this, but I haven't been able to "put them together" in my head. Thanks ver...

Generate vCard from AddressBook.framework

I'm utilising the AddressBook.framework in my iPhone app, and I'd like to replicate something along the lines of the share feature in Contacts.app. This basically attach's a specific contacts vCard to an email. As far as I know, there is nothing in the documentation that mentions generating a vCard. Is this a case of generating one myse...

previousFailureCount always stays on 0 (zero)

Hello all, First of all, I'd like to thank the good people who helped me around on this site. Thanks. I'm trying to detect a failed authentication attempt in my app... I'm using the didReceiveAuthenticationChallenge method, and the checking if [challenge previousFailureCount] is equal to 0. The problem is that it's always stays on zero...

open app in mobile safari browser

I have been using the uiwebview for a app that consists a index.html,css and javascript files.I'd like to do away with the uiwebview and open the app in the safari browser instead.All source files are located within the app bundle.Is it possible and if so can someone point me in the rite direction.Thanks in advance for any help offered. ...

For my website, is it possible to create a button where users can click on it to create an ICON on their iPhone desktop?

User clicks the button, and an icon is added to the iPhone desktop. If possible, can I activate this button manually? ...

How can I get the UITableView scroll position so I can save it?

Is there any way to find out which UITableViewCell is at the top of the scroll window? I'd like to get the current scroll position so that I can save it when the app exits. When the app gets started I want to scroll to the position it was at when it last exited. ...

Do you need to release xib UI elements that aren't IBOutlets?

If I have a xib file with, say, a UIButton element, but I do not create an IBOutlet to it, will it be released automatically? Or do I need to create outlets to all UI elements, and release them, even if I don't necessarily need the outlet for other purposes? ...