iOS 6 MFMailComposeViewController: Only support RGBA or the White color space, this method is a hack iOS 6 MFMailComposeViewController: Only support RGBA or the White color space, this method is a hack ios ios

iOS 6 MFMailComposeViewController: Only support RGBA or the White color space, this method is a hack


Ok only a partial solution but it's the best one I can think of without some fairly disruptive code changes.

For anyone else who gets this problem in future, I think it's a bug in iOS 6, MFMailComposeViewController crashes when you have set the UITableView separatorStyle to a colorWithPatternImage, but it works fine when you use a solid colour, so:

        if ([[[UIDevice currentDevice] systemVersion] floatValue] > 5.2) {           NSLog(@"Using iOS 5x");           [[UITableView appearance]setSeparatorColor:[UIColor colorWithRed:142.0/255.0          green:130.0/255.0 blue:76.0/255.0 alpha:1.0]];        }        else {           NSLog(@"Using iOS 6x, Table view use pattern color");           [[UITableView appearance]setSeparatorColor:[UIColor colorWithPatternImage: [UIImage imageNamed:@"dotted-line2.png"]]];        }


Actually I believe this is a significant bug, did anybody file a radar, yet?

As it seems to me, the assertion throws whenever you use "colorWithPatternImage" ANYWHERE in your presenting view controller's appearance proxies.

I think what happens is that iOS tries to store the appearance of your App before switching to a separate service (which is what MFMailComposeViewController does, it's now a "remote view controller" that gets presented by your App but which is managed by another App/process), since the Mail App wants to determine the appearance itself so it changes things like tint colors etc. More about remote view controller here, in case somebody is interested:http://oleb.net/blog/2012/10/remote-view-controllers-in-ios-6/

This seems to fail. This has to be a bug, the image should be encodable.

Workarounds may be hard. I tried to exchange the patterned color for a plain one right before presenting the view controller but found you at least have to make sure it really gets redrawn on screen and gave up (I don't really needed the pattern).


My problem was also due to using colorWithPatternImage but I found that it seems to only cause an issue when used on elements that are shown on the MFMailCompserViewController e.g.:

[[UINavigationBar appearance] setTintColor:[UIColor colorWithPatternImage:[UIImage imageNamed:@"navbar"]]];


matomo