objective c - UIActivityIndicatorView in a class without a view -


I have defined a class that does a long job and I call it to many other classes. Now I want to show an activity indicator, while this work is talking about it, and then it is removed. Since this is just a boring background task, this class has no visual, and I think that where I go into my problem. I can not get to show this thing

That is what I did in my class:

  UIActivityIndicatorView * Activity indicator = [[UIActivityIndicatorView alloc] initWithFrame: CGRectMake 0.0F, 0.0F, 32.0F, 32.0 F)]; [Activity indicator set center: CGPointMake (160.0f, 208.0F)]; Activity indicator. Activation indicator = UIActivityIndicatorViewStyleWhite; UIView * contentView = [[UIView alloc] initWithFrame: [[UIScreen main screen] ApplicationFrame]]; [ContentView addSubview: Activity indicator]; [ActivityInteractive start-up]; // Class is long work that takes several seconds ..... [contentView release]; [Activity indicator release];  

I think that when I get the content view, then I do something wrong, but how should I get it right?

Thanks for any advice ...

You do not get the content view You are creating a new view that is not showing anywhere. This class should be a visual controller, or you will need to see this view somewhere by a View Controller.


Comments

Popular posts from this blog

windows - Heroku throws SQLITE3 Read only exception -

lex - Building a lexical Analyzer in Java -

python - rename keys in a dictionary -