iPhone Memory Management -
I am about to fool myself, but I have seen many friendly and patient people here, so I I try:
I am developing an iPhone app that includes a database of car reviews, I want the user to be able to share the review by email. Therefore, when he finds an interesting car in the app, he will press a button, and the app creates an e-mail via the iPhone's Mail.App.
Now. I am a newbie, and I have to admit that I am not very familiar with memory management on the iPhone. The code that I wrote, this specific mail method, comes out of the application with the horror "program received signal:" EXC_BAD_ACCESS "" message. A small suggestion from Googling suggests that this is the result of bad memory management.
With my little understanding of this matter, I started from the beginning and later released all the floating variables, like crazy still, "EXC_BAD_ACCESS" continues to show. Interesting point here: As soon as I kill my app, the creation URL still triggers Mail.app, and creates an email for me happily.
Please consider the following sample code, and send me
- Send (IBAction) to CortoFriend {car accessed * app delegate = (car expressive) * [[UIAPCC share Part] representative]; // HTML Template Read NSString * ResourcesPath = [[NSBundle Main Bundle] ResourcesPath]; NSString * EmailFile = [source text stringing path comparison: @ "mail dummy HIM"]; NSMutableString * eMailRaw = [[[NSMutableString alloc] initWithContentsOfFile: EmailFile] AutoExecution]; // set the variable NSString * carNamePlaceholder = [[NSString alloc] initWithString: @ "Cartitle"]; NSString * Cronyms = [[NSString alloc] initWithString: car.shortname]; [Change EMailRaw Order: Offer: String with Event Placeholder: Carnival Option: NSCCInnsistive Search Range: NSMKrenges (0, [Amel Rara Length]); [Fraction Placeholder Release]; [Release Release]; NSString * carReviewPlaceholder = [[NSString alloc] initWithString: @ "Carreview"]; NSString * carReview = [[NSString alloc] initWithString: car.review]; [Replace EMailRaw OCurrencesOfString: CarReviewPlaceholder withString: carReview Option: NSCaseInsensitiveSearch range: NSMakeRange (0, [eMailRaw Length])]; [Carrier placeholder release]; [Car Reviews Release]; // There are more than 5 search / replacement jobs "car review" though the biggest is several hundred characters in it. // Write message NSString * eMailSubject = @ "Good little car!"; NSString * encoded topic = [[NSString alloc] initWithString: [e-mailspace stringbearingaddingprobert escaping encoding: NSUTF8 string encoding]]; NSSTING * E-mailBody = E-mailRou; NSLog (eMailBody); NSString * encodedBody = [[NSString alloc] initWithString: [E-Mailbox StringBeidingContentsCasus utility encoding: NSUFF 8 string encoding]]; NSString * urlString = [[NSString alloc] initWithString: [NSString stringWithFormat: @ "melto:? Topic =% @ and body =% @", encoded topic, encoded body]]; NSDRL * URL = [[NSRL Alok] InitwithString: URL String]; [UrlString release]; [Encoded BD release]; [Encoded topic publication]; [E-mailarrow release]; [[UIApplication shared application] Open URL: URL]; [Url release];
hmm .. at first glance:
you 're The e-mailer is issuing from, however it is set to the autorillage.
Can this be the problem?
Comments
Post a Comment