« Creating a First iPhone Game: Output & Input | Main | Core Data, Part 7: Lightweight Migration »

February 03, 2010

TrackBack

TrackBack URL for this entry:
http://www.typepad.com/services/trackback/6a010535e1becf970c0128775c7722970c

Listed below are links to weblogs that reference Bringing Mü to the iPhone:

Comments

Feed You can follow this conversation by subscribing to the comment feed for this post.

Vinay Nair

Hello Mr. Blanding,

I have been reading couple of your blogs and I must say that you have gone in detail to discuss critical iphone development issues/features.

I am not much of a board game player myself, so I am not commenting on Mu application. But for beginners like me,just to go through the entire process as you described in your February 10 blog is itself a learning process. Thanks for sharing!

I have a very small team of three working on iphone app development; we have just started with our first application. Our background is from web based Java apps. So, like you, we are going through a reading phase to understand iphone development environment/core data/objective C.

Currently we are stuck at a task which requires us to"export records from core data through the app in a .txt or any other format and send it as an Email attachment". I was wondering if you would be able to guide us in any way.


Thank you very much and keep up the good work.

Steve Blanding

Hi Vinay,

Sorry for not responding sooner. This isn't actually my blog (mine is at http://hfog.blogspot.com/) so I haven't been actively monitoring this post for comments.

Here's some sample code that shows how I used the iPhone's built in email client for emailing stats to myself from testers. This should give you a starting place. Feel free to send me email (steve at housefullofgames dot com) if you have any questions about it.

Good luck!

Steve

----code follows----

-(void)sendEmail{
// build up a report that can be sent via email

YourAppDelegate * pDelegate = [[UIApplication sharedApplication] delegate];
NSMutableString * messageText = [NSMutableString stringWithCapacity:10000];

// Build up your message here.
[messageText appendString:@"Hello World!\n"];

// I spewed my message text to the log just to make sure it was being built up properly.
NSLog(messageText);

// we need an escaped string that's properly UTF8 encoded so that we can build a legit URL out of it
NSString * escapedString = (NSString*)
CFURLCreateStringByAddingPercentEscapes(kCFAllocatorDefault, (CFStringRef)messageText, NULL, NULL, kCFStringEncodingUTF8);

// now we can build our full message as a mailto: message sending it to foo@bar.com (substitute your own email addy here)
NSString * fullMessage = [NSString stringWithFormat:@"mailto:foo@bar.com?subject=Your%20Text%20Here&body=%@",escapedString];

// turn it into a URL
NSURL * url = [NSURL URLWithString:fullMessage];

// and open it. Since it's a mailto: URL, the iPhone will automatically open the email application and create a message with our text in it
[[UIApplication sharedApplication] openURL:url];

}

Verify your Comment

Previewing your Comment

This is only a preview. Your comment has not yet been posted.

Working...
Your comment could not be posted. Error type:
Your comment has been posted. Post another comment

The letters and numbers you entered did not match the image. Please try again.

As a final step before posting your comment, enter the letters and numbers you see in the image below. This prevents automated programs from posting comments.

Having trouble reading this image? View an alternate.

Working...

Post a comment