Advertise Books Events Forum News Social Networking Support Us
Follow @iphonedevsdk on Twitter

sdkIQ for iPhone
($4.99)

Your First iPhone App
($1.99)

iPhone Code Generator
($9.99)

Dual Matches
($0.99)

Calcuccino Programmers' Calculator
($2.99)

SDKtoday
(free)

Want your application or service advertised on iPhone Dev SDK?

Go Back   iPhone Dev SDK Forum > iPhone SDK Development Forums > iPhone SDK Development

Reply
 
LinkBack Thread Tools Display Modes
Old 09-18-2009, 06:20 PM   #1 (permalink)
Registered Member
 
Join Date: Sep 2009
Posts: 13
Default Tutorial with progressView - Troubles

Hi there, I am new on board. I have a little little problem. I succeeded in creating the application as they did it the tutorial but now my app seems to have a problem with linking the things...

/Location/Classes/../MainView.m:16: warning: 'NSTimer' may not respond to '+scheduledTimerWithTimeInterval::target:selector: userInfo:repeats:'

MY ENTIRE CODE IN Main.m looks like that

----------------------------------------

#import "MainView.h"

@implementation MainView

@synthesize timer;

- (IBAction)startLoadingBlue {
progressView.progress = 0.0;
progressLabel.text = @"Color Loading";
timer = [NSTimer scheduledTimerWithTimeInterval:1.0 target:self selector:@selector(updateProgressBlue) userInfo:nil repeats:YES];
}

- (IBAction)startLoadingRed {
progressView.progress = 0.0;
progressLabel.text = @"Color Loading";
timer = [NSTimer scheduledTimerWithTimeInterval:1:0 target:self selector:@selector(updateProgressRed) userInfo:nil repeats:YES];

}

-(void)updateProgressBlue {
progressView.progress = progressView.progress + 0.1;
if (progressView.progress == 0.5) {
progressLabel.text = @"Applying colour";
[self applyColourBlue];
}

if (progressView.progress == 1.0) {
progressLabel.text = @"Colour Applied";
[timer invalidate];
}

}

-(void)updateProgressRed {
progressView.progress = progressView.progress + 0.1;
if (progressView.progress == 0.5) {
progressLabel.text = @"Applying colour";
[self applyColourRed];
}

if (progressView.progress == 1.0) {
progressLabel.text = @"Colour Applied";
[timer invalidate];
}

}

-(void)applyColourRed {
[UIView beginAnimations:nil context:NULL];
[UIView setAnimationDuration:5.0];
self.backgroundColor = [UIColor redColor];
[UIView commitAnimations];
}

-(void)applyColourBlue{
[UIView beginAnimations:nil context:NULL];
[UIView setAnimationDuration:5.0];
self.backgroundColor = [UIColor blueColor];
[UIView commitAnimations];

}

@end
---------------------------

Need help. thx
eggapps is offline   Reply With Quote
Old 09-19-2009, 01:29 AM   #2 (permalink)
Registered Member
 
Join Date: Sep 2009
Posts: 13
Default

what's wrong?
eggapps is offline   Reply With Quote
Old 09-19-2009, 02:17 AM   #3 (permalink)
iPhone Developer
 
Join Date: Jul 2009
Location: Eugene, Oregon
Posts: 88
Default

Quote:
Originally Posted by eggapps View Post
Hi there, I am new on board. I have a little little problem. I succeeded in creating the application as they did it the tutorial but now my app seems to have a problem with linking the things...

/Location/Classes/../MainView.m:16: warning: 'NSTimer' may not respond to '+scheduledTimerWithTimeInterval::target:selector: userInfo:repeats:'

- (IBAction)startLoadingRed {
progressView.progress = 0.0;
progressLabel.text = @"Color Loading";
timer = [NSTimer scheduledTimerWithTimeInterval:1:0 target:self selector:@selector(updateProgressRed) userInfo:nil repeats:YES];

}
The bold line should read:

Code:
timer = [NSTimer scheduledTimerWithTimeInterval:1.0 target:self selector:@selector(updateProgressRed) userInfo:nil repeats:YES];
You simply had a typo. The error told you the _exact_ problem, as there is no +scheduledTimerWithTimerInterval::target:self:sele ctor:userInfo:repeats: method. The extra : in there should throw a red flag.

Brian
williamsbm2000 is offline   Reply With Quote
Old 09-20-2009, 10:36 AM   #4 (permalink)
Registered Member
 
Join Date: Sep 2009
Posts: 13
Default

Thanks a lot for your help Brian. This is much appreciated!

However, I have another little problem. The code now seems to be fine. Only when I debug the app, I get a black screen... I might have something linked in wrong way, .xib-file..

Any idea what to do?
eggapps is offline   Reply With Quote
Old 09-20-2009, 11:28 AM   #5 (permalink)
iPhone Developer
 
Join Date: Jul 2009
Location: Eugene, Oregon
Posts: 88
Default

Quote:
Originally Posted by eggapps View Post
Thanks a lot for your help Brian. This is much appreciated!

However, I have another little problem. The code now seems to be fine. Only when I debug the app, I get a black screen... I might have something linked in wrong way, .xib-file..

Any idea what to do?
You are right... it is probably something wrong in the .xib. Try a clean and then build. See if you have any warnings. Usually Xcode is pretty good about letting you know if something is messed up. *usually*... other than that, maybe put some NSLog(@"I am at ... in my code."); in every function and see if it is stopping somewhere. Good luck.

Brian
williamsbm2000 is offline   Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes

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

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


» Advertisements
» Stats
Members: 41,861
Threads: 49,770
Posts: 213,057
Top Poster: BrianSlick (3,139)
Welcome to our newest member, melodizzzy
Powered by vBadvanced CMPS v3.1.0

All times are GMT -5. The time now is 07:01 PM.
Powered by vBulletin® Version 3.8.0
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0