Q:

Is there a limit to number of arguments in stringWithFormat?

I'm trying to compose an email using MFMailComposeViewController and I'm using a HTML string wich draws a table. It has 265 arguments so I have to pass it like this:
[mailViewController setMessageBody:
[NSString stringWithFormat:NSLocalizedString(@"EMAIL_HTML_KEY", nil),

                                                date,

                                                object.foo[0],

                                                [object.bar[0] objectAtIndex:0],

                                                [object.bar[0] objectAtIndex:1], ... ...

When I run the app, it always hangs with a EXC_BAD_ACCESS error. It just stops at objc_msgSend after NSDescriptionWithLocaleFunc according to the list shown in debugger so it seems clear that there's a problem with my string. The thing is... there isn't. I double checked both parts (the string itself and the list of arguments) and they were OK so I tried to cut the string to see where the problem was and I found that I only got the error when the string was big enough.
String="123456"  --> Error
String="123"  --> OK
String="234"  --> OK
String="456"  --> OK
So, it seems the HTML string is well formatted and the list of arguments is correct. The only thing I can imagine is that there's a limit to the number of arguments I can send to a NSString created with stringWithFormat. Is it right?. I would split the string but, being HTML code, I must pass it as a single string to mailViewController.
Any suggestion?. What am I missing?.

A:

For your Header... NO. You can put any number of arguments.
And I can see 
[mailViewController setMessageBody:NSString stringWithFormat:NSLocalizedString

Which should be
[mailViewController setMessageBody:[NSString stringWithFormat:NSLocalizedString

And you should use mutalbeString with appendString and a loop can do, as your index is seen as changing from 0 to 1....

