Here is a hack that I have used successfully in many shipping apps.
- Use
sizeWithFont
to figure out how much space you need (from the message text). - Set the message to an appropriate number of
@"\n"
. - Insert a new transparent
UILabel
as a subview of the alert view with your text.
If you need really long texts, you could try inserting a UITextView
, which theoretically can be scrolled. (Please tell me if it works if you try it.) However, I would strongly advise not to use this design and construct a proper view controller instead.
[alertView addSubview:label];