UIAlertView fails to show and results in “EXC_BAD_ACCESS” error

前端 未结 6 2104
一向
一向 2021-01-21 01:05

A method is called when a return button on the keyboard is pressed. After calling another method which returns an integer a message is created based on that integer. The message

6条回答
  •  谎友^
    谎友^ (楼主)
    2021-01-21 01:36

    Sean is right - you don't need to call [message release] here, because you're never actually retaining the message object.

    Instead of just saying message = @"string", you need to say message = [NSString stringWithString:@"string"]; To be completely honest I'm not sure why (maybe someone can comment and I can improve this post!) but that should do the trick.

提交回复
热议问题