#define showAlert(format, ...) myShowAlert(__LINE__, (char *)__FUNCTION__,format, ##__VA_ARGS__)
// Simple Alert Utility
void myShowAlert(int line, char *functname, id formatstring,...)
{
 va_list arglist;
 if (!formatstring) return;
 va_start(arglist, formatstring);
 id outstring = [[[NSString alloc] initWithFormat:formatstring arguments:arglist] autorelease];
 va_end(arglist);
 NSString *filename = [[NSString stringWithCString:__FILE__] lastPathComponent];
 NSString *debugInfo = [NSString stringWithFormat:@"%@:%d\n%s", filename, line, functname];
 UIAlertView *av = [[[UIAlertView alloc] initWithTitle:outstring message:debugInfo delegate:nil cancelButtonTitle:@"OK"otherButtonTitles:nil] autorelease];
 [av show];
}

相关文章:

  • 2021-09-20
  • 2022-12-23
  • 2022-01-08
  • 2021-08-25
  • 2022-12-23
  • 2021-08-06
  • 2022-02-20
  • 2022-01-12
猜你喜欢
  • 2021-10-09
  • 2021-06-18
  • 2022-12-23
  • 2022-12-23
  • 2021-07-16
  • 2021-12-04
  • 2022-12-23
相关资源
相似解决方案