Displaying and Hidding views

Discussion in 'Mac Programming' started by StrAbZ, May 19, 2008.

  1. StrAbZ macrumors newbie

    Apr 21, 2008
    I've try to search but I didn't find anything about my problem.

    I'm trying to do a loading view or anything that can display, a gear, like a buttonBarItem with custom view, or a view with black background and alpha effect (like the "old" UIProgressHud, is there something to replace it?).

    So i've my code which look like this :

    // Step1 - Loading View (adding the button, or the view etc...)
    UIActivityIndicatorView aiv = [[UIActivityIndicatorView alloc] initWithStyle...]
    UIButtonBarItem *bbi = [[UIButtonBarItem alloc] initWithCustomView: aiv];
    [[self navigationItem] setRightButtonBarItem: bbi];
    // Step2 - Doing some stuff (loading data from url (synchronously),
     having 1min while{} etc...
    // Step3 - Removing View (removing the button, or the view etc...)
    [[self navigationItem] setRightButtonBarItem: nil];

    If I only write step1 and step2, my loading view is displayed, but never disappear, right but not good...
    My problem is when I add the third step, my view doesn't show up... (I have the same problem if I create a UIView, which I add and remove from [self view]

    So if you have any idea I'll take it !

    Thank you
  2. StrAbZ thread starter macrumors newbie

    Apr 21, 2008
    Nobody with a idea?

    In short, i cannot create a View, and add it as a subview and remove it.
    I just can add it.

    If i try to put some code to remove it, the add doesn't work.
  3. 5et macrumors newbie

    Jul 31, 2008
    maybe you know how I can create small modal dialog with label and UIActivityIndicatorView on current view controller?

Share This Page