I have a class as follows
#import "UtilAlert.h"
@implementation UtilAlert
+(void) showAlert:(NSString *)message andTitle:(NSString *)title andDelegate:(UIViewController *) delegate
{
UIAlertView *alert = [[UIAlertView alloc] initWithTitle:title message:message delegate:delegate cancelButtonTitle:@"Cancel" otherButtonTitles:nil];
[alert show];
}
@end
The problem is that when call the function with necessary parameters…
[UtilAlert showAlert:@"hello" andTitle:@"hello" andDelegate:self] ;
i get a error: Thread 1: stopped at break point 3;
for the function call from an UIController class
This is not an error. You have a breakpoint in your code, which is the little blue arrow in the left margin of your code. Click the blue arrow again to make it really light blue to turn off the breakpoint.
Also, you should release the alert after showing it before exiting the function or you will leak memory.