 |
 |
|
 |
09-18-2009, 06:20 PM
|
#1 (permalink)
|
|
Registered Member
Join Date: Sep 2009
Posts: 13
|
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
|
|
|
09-19-2009, 01:29 AM
|
#2 (permalink)
|
|
Registered Member
Join Date: Sep 2009
Posts: 13
|
what's wrong?
|
|
|
09-19-2009, 02:17 AM
|
#3 (permalink)
|
|
iPhone Developer
Join Date: Jul 2009
Location: Eugene, Oregon
Posts: 88
|
Quote:
Originally Posted by eggapps
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
|
|
|
09-20-2009, 10:36 AM
|
#4 (permalink)
|
|
Registered Member
Join Date: Sep 2009
Posts: 13
|
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?
|
|
|
09-20-2009, 11:28 AM
|
#5 (permalink)
|
|
iPhone Developer
Join Date: Jul 2009
Location: Eugene, Oregon
Posts: 88
|
Quote:
Originally Posted by eggapps
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
|
|
|
 |
| Thread Tools |
|
|
| Display Modes |
Linear Mode
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
|
» Advertisements |
» Online Users: 419 |
| 36 members and 383 guests |
| AdamSubach, aderrington, benoitr007, bensj, BrianSlick, Danneman, dev123, ErichGS, GreatWizard, gustavo7sexton, gw1921, HemiMG, HowEver, iSDK, Jeremy1026, lifeCoder45, mattiahalter, melodizzzy, mriphoneman, newchucky, Ovidius, Piequanna, pofak, qilin, Racker, raheel, rendezvouscp, riq, Sega dude, socals, timle8n1, Whitehk, ZunePod |
| Most users ever online was 965, 06-30-2010 at 04:26 AM. |
» Stats |
Members: 41,861
Threads: 49,770
Posts: 213,057
Top Poster: BrianSlick (3,139)
|
| Welcome to our newest member, melodizzzy |
|