Results 1 to 7 of 7

Your favorite Apple, iPhone, iPad, iOS, Jailbreak, and Cydia site.


Thread: How can I add a UIProgressView to a theos app?

  1. #1
    Formerly known as [email protected] Technologx's Avatar
    Join Date
    Oct 2011
    Location
    /etc/host(with blocked ads)
    Posts
    85
    Thanks
    8
    Thanked 9 Times in 7 Posts

    Default How can I add a UIProgressView to a theos app?
    Here's my code so you know what's going on.
    #import "RootViewController.h"
    #import <UIKit/UIKit.h>

    @implementation RootViewController
    - (void)loadView {
    self.view = [[[UIView alloc] initWithFrame:[[UIScreen mainScreen] applicationFrame]] autorelease];
    self.view.backgroundColor = [UIColor colorWithPatternImage:[UIImage imageNamed:@"Background"]];

    UIButton *installButton = [UIButton buttonWithType:UIButtonTypeRoundedRect];
    installButton.frame = CGRectMake(21, 80, 100, 35);
    [installButton setTitle:@"Install Theos" forState:UIControlStateNormal];
    [self.view addSubview:installButton];
    [installButton addTarget:self action:@selector(installButtonPressed) forControlEvents:UIControlEventTouchUpInside];
    }

    -(void)installButtonPressed
    {
    system("apt-get update");
    system("apt-get install perl net.howett.theos");
    }
    @end

    I want people to know that something is going on instead of just closing the app.
    Also did I get the background code line right.
    I've tried creating the app with make package and got error 2.


    [email protected]'s Creations
    Where Dreams Come True!
    deathscreations.22web.org

  2. #2
    Formerly known as [email protected] Technologx's Avatar
    Join Date
    Oct 2011
    Location
    /etc/host(with blocked ads)
    Posts
    85
    Thanks
    8
    Thanked 9 Times in 7 Posts

    I want when the button is pressed to show something like Cydia install screen.


    [email protected]'s Creations
    Where Dreams Come True!
    deathscreations.22web.org

  3. #3
    first you create IBOutlet in .h file

    Code:
     IBOutlet UIProgressView * threadProgressView;
    Then in .m file in viewdidload first set progress to 0.0 and then call makeMyProgressMoving method

    Code:
    threadProgressView.progress = 0.0;
        [self performSelectorOnMainThread:@selector(makeMyProgressBarMoving) withObject:nil waitUntilDone:NO];
    then add below method

    Code:
    - (void)makeMyProgressBarMoving {
    
            float actual = [threadProgressView progress];
            if (actual < 1) {
                threadProgressView.progress = actual + ((float)recievedData/(float)xpectedTotalSize);
                [NSTimer scheduledTimerWithTimeInterval:0.05 target:self selector:@selector(makeMyProgressBarMoving) userInfo:nil repeats:NO];
            }
            else{
    
    
    
            }
    
        }

  4. #4
    Formerly known as [email protected] Technologx's Avatar
    Join Date
    Oct 2011
    Location
    /etc/host(with blocked ads)
    Posts
    85
    Thanks
    8
    Thanked 9 Times in 7 Posts

    Will that work with the apt-get install?


    [email protected]'s Creations
    Where Dreams Come True!
    deathscreations.22web.org

  5. #5
    Alternatively, you can add with 3 lines of code for simple UIActivityIndicator

    Code:
    - (void)viewDidLoad {
        [super viewDidLoad];
         
        UIActivityIndicatorView *ai = [[UIActivityIndicatorView alloc] initWithActivityIndicatorStyle:UIActivityIndicatorViewStyleWhite];
        ai.center = self.view.center;
        [self.view addSubview:ai];
    }
    Quote Originally Posted by [email protected] View Post
    Will that work with the apt-get install?


    [email protected]'s Creations
    Where Dreams Come True!
    deathscreations.22web.org
    I use Xcode for everything, then unsign the code and make a deb for installation.

  6. #6
    Formerly known as [email protected] Technologx's Avatar
    Join Date
    Oct 2011
    Location
    /etc/host(with blocked ads)
    Posts
    85
    Thanks
    8
    Thanked 9 Times in 7 Posts

    I'm using theos on my phone but I'll try that thank you.


    [email protected]'s Creations
    Where Dreams Come True!
    deathscreations.22web.org

  7. #7
    Formerly known as [email protected] Technologx's Avatar
    Join Date
    Oct 2011
    Location
    /etc/host(with blocked ads)
    Posts
    85
    Thanks
    8
    Thanked 9 Times in 7 Posts

    Quote Originally Posted by MamaJaay View Post
    first you create IBOutlet in .h file

    Code:
     IBOutlet UIProgressView * threadProgressView;
    Then in .m file in viewdidload first set progress to 0.0 and then call makeMyProgressMoving method

    Code:
    threadProgressView.progress = 0.0;
        [self performSelectorOnMainThread:@selector(makeMyProgressBarMoving) withObject:nil waitUntilDone:NO];
    then add below method

    Code:
    - (void)makeMyProgressBarMoving {
    
            float actual = [threadProgressView progress];
            if (actual < 1) {
                threadProgressView.progress = actual + ((float)recievedData/(float)xpectedTotalSize);
                [NSTimer scheduledTimerWithTimeInterval:0.05 target:self selector:@selector(makeMyProgressBarMoving) userInfo:nil repeats:NO];
            }
            else{
    
    
    
            }
    
        }
    It didn't work

    Quote Originally Posted by MamaJaay View Post
    Alternatively, you can add with 3 lines of code for simple UIActivityIndicator

    Code:
    - (void)viewDidLoad {
        [super viewDidLoad];
         
        UIActivityIndicatorView *ai = [[UIActivityIndicatorView alloc] initWithActivityIndicatorStyle:UIActivityIndicatorViewStyleWhite];
        ai.center = self.view.center;
        [self.view addSubview:ai];
    }


    I use Xcode for everything, then unsign the code and make a deb for installation.
    Neither did this

Posting Permissions
  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •