ViewController gets deallocated which leads to crash

Best way to deal with this is using a property. Here's how:

In your .h file:

#import "MainViewController.h"

@interface MyClass : UIViewController

@property (strong, nonatomic) MainViewController *mvc;

@end

In your .m file:

#import "MyClass.h"

@implementation MyClass

@synthesize mvc;

// Your code here
- (void)yourMethodHere {
self.mvc = [self.storyboard instantiateViewControllerWithIdentifier:@"MainView"];
[self.view addSubview:mvc.view];
}

New hot tips

UIAlertView in one line

http://ios.biomsoft.com/2012/05/31/uialertview-in-one-line/

Three useful UIWebView tweaks

http://ios.biomsoft.com/2012/04/26/three-useful-uiwebview-tweaks/

iOS QR encoder for iOS

http://ios.biomsoft.com/2012/04/11/ios-qr-encoder-for-ios/

Load a PDF File in the iPhone App Smoothly

http://ios.biomsoft.com/2012/02/17/load-a-pdf-file-in-the-iphone-app-smoothly/

Excellent Easy To Use Flip (Flipboard Style) Transition Component

http://ios.biomsoft.com/2012/02/11/excellent-easy-to-use-flip-flipboard-style-transition-component/

 

How to change/customize mail signature in Mountain Lion?

• open Mail
• create a new signature
• open this folder /Users/you/Library/Mail/V2/MailData/Signatures/
• open the latest *.mailsignature file with a text editor
• replace everything under this code with your custom html (replace iso-8859-1 with uft-8for umlaut support)

Content-Transfer-Encoding: quoted-printable
Content-Type: text/html;
    charset=iso-8859-1
Message-Id: <[email protected]_W_722V_Typ_B>
Mime-Version: 1.0 (Mac OS X Mail 6.0 \(1486\))

• save the file and open the Get Info Dialogue and check Locked, so that it doesn't get overwritten by Mail