try this in iOS 6
UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"" message:@"Please use Settings( ) to configure the phone number and image." delegate:nil cancelButtonTitle:@"OK" otherButtonTitles:nil]; UIImageView *imageView = [[UIImageView alloc] initWithFrame:CGRectMake(160.5, 27, 15, 15)]; NSString *path = [[NSString alloc] initWithString:[[[NSBundle mainBundle] resourcePath] stringByAppendingPathComponent:@"settingIcon.png"]]; UIImage *bkgImg = [[UIImage alloc] initWithContentsOfFile:path]; [imageView setImage:bkgImg]; [alert addSubview:imageView]; [alert show];
Hope this helps u
If you use in iOS 7, we cannot add an image in iOS 7, because in iOS 7, remove all the functionality of addSubview .... Therefore, you cannot add an image in iOS7.
source share