iphone - Destroy UIView in init if condition isn't met -


i'm trying make custom alert view checks see if condition true, , if builds , attaches window. however, if condition not true, want view deallocate itself, preferably in init method. best way accomplish this?

well better follow solid principles in coding.

singularity important thing.one function supposed single thing not many dependencies.

so keep view show custom alert.and check showing must done outside such

//please note algorithm not exact code in obj-c. if(condition==true) { //display customview } else { //do nothing } 

Comments

Popular posts from this blog

monitor web browser programmatically in Android? -

Shrink a YouTube video to responsive width -

wpf - PdfWriter.GetInstance throws System.NullReferenceException -