InsanelyApple
Apr 15, 04:51 PM
It's more.... FABULOUS!
:)
Bravo, good sir/madam. Bravo. You made me laugh. *applause*
:)
Bravo, good sir/madam. Bravo. You made me laugh. *applause*
wlh99
Apr 26, 05:44 PM
I'm aware of that ulbador, and my point is that like any other language.. you get better with time & practice. Nobody FORCES you or dejo to read my threads, or answer them. If you see lack of objective-C fundamentals, just go to another thread (for Pros), is that simple. Some people like to help, others laugh, others ignore you or get frustrated because they can't read ... who cares man, if you don't like the thread just go to another one but never try to discourage a person who's starting to learn, that I'm against.
(about the code) Thanks for pointing that out, I needed a variable, after that I created a timer appropriately and used the variable as a reference to trigger my cancel methods (invalidate).
Have you read the documentation for NSTimer?
+ (NSTimer *)scheduledTimerWithTimeInterval:(NSTimeInterval)seconds invocation:(NSInvocation *)invocation repeats:(BOOL)repeats
The above line has your answer.
(about the code) Thanks for pointing that out, I needed a variable, after that I created a timer appropriately and used the variable as a reference to trigger my cancel methods (invalidate).
Have you read the documentation for NSTimer?
+ (NSTimer *)scheduledTimerWithTimeInterval:(NSTimeInterval)seconds invocation:(NSInvocation *)invocation repeats:(BOOL)repeats
The above line has your answer.
wlh99
Apr 28, 10:08 AM
By the way, what's with 3rd person reference? the OP? you can call me Nekbeth or Chrystian, it's a lot more polite. Maybe you guys have a way to refer to someone , I don't know.
I appologize for that. I didn't recall your name. I was replying to KnightWRX, so I took a shorcut (original poster).
I won't do that any further.
I through together a simple program that I think does exactly as you want. It is a Mac version, but the different there is trival, and instead of a picker, it is a text field the user enters a time into for the timer duration. You will need to change the NSTextFields into UITextFields.
The bulk of the code is exactly what I posted before, but I modified the EchoIt method to work with an NSDate. I implemeted it in the appDelegate, and you are using your viewController. That doesn't change the code any, and your way is more correct.
I can email you the whole project as a zip if you want. It is about 2.5 meg. Just PM me your email address.
//
// timertestAppDelegate.m
// timertest
//
// Created by Warren Holybee on 4/27/11.
// Copyright 2011 Warren Holybee. All rights reserved.
//
#import "timertestAppDelegate.h"
@implementation timertestAppDelegate
@synthesize window, timeTextField, elapsedTimeTextField, timeLeftTextField;
- (void)applicationDidFinishLaunching:(NSNotification *)aNotification {
// Insert code here to initialize your application
}
-(IBAction)startButton:(id) sender {
// myTimer is declared in header file ...
if (myTimer!=nil) { // if the pointer already points to a timer, you don't want to
//create a second one without stoping and destroying the first
[myTimer invalidate];
[myTimer release];
[startDate release];
}
// Now that we know myTimer doesn't point to a timer already..
startDate = [[NSDate date] retain]; // remember what time this timer is created and started
// so we can calculate elapsed time later
NSTimeInterval myTimeInterval = 0.1; // How often the timer fires.
myTimer = [NSTimer scheduledTimerWithTimeInterval:myTimeInterval target:self selector:@selector(echoIt)
userInfo:nil repeats:YES];
[myTimer retain];
}
-(IBAction)cancelIt:(id) sender {
[myTimer invalidate];
[myTimer release]; // This timer is now gone, and you won't reuse it.
myTimer = nil;
}
-(void)echoIt {
NSDate *now = [[NSDate date] retain]; // Get the current time
NSTimeInterval elapsedTime = [now timeIntervalSinceDate:startDate]; // compare the current time to
[now release]; // our remembered time
NSLog(@"Elapsed Time = %.1f",elapsedTime); // log it and display it in a textField
[elapsedTimeTextField setStringValue:[NSString stringWithFormat:@"%.1f",elapsedTime]];
float timeValue = [timeTextField floatValue]; // timeValueTextField is where a user
// enters the countdown length
float timeLeft = timeValue - elapsedTime; // Calculate How much time is left.
NSLog(@"Time Left = %.1f",timeLeft); // log it and display it
[timeLeftTextField setStringValue:[NSString stringWithFormat:@"%.1f",timeLeft]];
if (timeLeft < 0) { // if the time is up, send "cancelIt:"
[self cancelIt:self]; // message to ourself.
}
}
@end
*edit:
If you like, later tonight I can show you how to do this as you first tried, by incrementing a seconds variable. Or wait for KnightWRX. My concern is accuracy of the timer. It might be off by several seconds after running an hour. That might not be an issue for your application, but you should be aware of it.
I appologize for that. I didn't recall your name. I was replying to KnightWRX, so I took a shorcut (original poster).
I won't do that any further.
I through together a simple program that I think does exactly as you want. It is a Mac version, but the different there is trival, and instead of a picker, it is a text field the user enters a time into for the timer duration. You will need to change the NSTextFields into UITextFields.
The bulk of the code is exactly what I posted before, but I modified the EchoIt method to work with an NSDate. I implemeted it in the appDelegate, and you are using your viewController. That doesn't change the code any, and your way is more correct.
I can email you the whole project as a zip if you want. It is about 2.5 meg. Just PM me your email address.
//
// timertestAppDelegate.m
// timertest
//
// Created by Warren Holybee on 4/27/11.
// Copyright 2011 Warren Holybee. All rights reserved.
//
#import "timertestAppDelegate.h"
@implementation timertestAppDelegate
@synthesize window, timeTextField, elapsedTimeTextField, timeLeftTextField;
- (void)applicationDidFinishLaunching:(NSNotification *)aNotification {
// Insert code here to initialize your application
}
-(IBAction)startButton:(id) sender {
// myTimer is declared in header file ...
if (myTimer!=nil) { // if the pointer already points to a timer, you don't want to
//create a second one without stoping and destroying the first
[myTimer invalidate];
[myTimer release];
[startDate release];
}
// Now that we know myTimer doesn't point to a timer already..
startDate = [[NSDate date] retain]; // remember what time this timer is created and started
// so we can calculate elapsed time later
NSTimeInterval myTimeInterval = 0.1; // How often the timer fires.
myTimer = [NSTimer scheduledTimerWithTimeInterval:myTimeInterval target:self selector:@selector(echoIt)
userInfo:nil repeats:YES];
[myTimer retain];
}
-(IBAction)cancelIt:(id) sender {
[myTimer invalidate];
[myTimer release]; // This timer is now gone, and you won't reuse it.
myTimer = nil;
}
-(void)echoIt {
NSDate *now = [[NSDate date] retain]; // Get the current time
NSTimeInterval elapsedTime = [now timeIntervalSinceDate:startDate]; // compare the current time to
[now release]; // our remembered time
NSLog(@"Elapsed Time = %.1f",elapsedTime); // log it and display it in a textField
[elapsedTimeTextField setStringValue:[NSString stringWithFormat:@"%.1f",elapsedTime]];
float timeValue = [timeTextField floatValue]; // timeValueTextField is where a user
// enters the countdown length
float timeLeft = timeValue - elapsedTime; // Calculate How much time is left.
NSLog(@"Time Left = %.1f",timeLeft); // log it and display it
[timeLeftTextField setStringValue:[NSString stringWithFormat:@"%.1f",timeLeft]];
if (timeLeft < 0) { // if the time is up, send "cancelIt:"
[self cancelIt:self]; // message to ourself.
}
}
@end
*edit:
If you like, later tonight I can show you how to do this as you first tried, by incrementing a seconds variable. Or wait for KnightWRX. My concern is accuracy of the timer. It might be off by several seconds after running an hour. That might not be an issue for your application, but you should be aware of it.
bretm
Sep 30, 09:13 AM
Thats not apart of what a home should be. Homes are for eating, sleeping, loving, and relaxing. A screening room is for... Well, none of those.
I guess you are still in the lets all commute to work and congest the highways and burn all the electricity and gas we can boat. I've gone the route of live and work at home. Much less stress. Much more time for lovin.
I guess you are still in the lets all commute to work and congest the highways and burn all the electricity and gas we can boat. I've gone the route of live and work at home. Much less stress. Much more time for lovin.
more...
Lord Blackadder
May 5, 06:24 PM
If we were to implement restrictions it would have to be nation-wide, or else it would be too easily thwarted.
What do we do with the 200 million legally owned guns? Not to mention the unknown (but surely quite significant) number of illegally owned or stolen guns we can't even track?
I think any talk of a blanket ban is pure folly and ignores the reality of the situation.
The biggest problem is just how far apart people are on this issue. People with little or no exposure to guns generally fear them and support draconian bans; people who grew up surrounded by them are much more likely to support some level of gun ownership, but a vocal minority of them want to do away with most or all regulation. I think both extreme positions (seeking to ban most/all guns vs advocating little/no regulation) are unrealistic and need to be abandoned.
The NRA's current policy leans heavily towards automatic knee-jerk attacks towards any person or organization that might appear to criticise or question any aspect of firearms ownership, or to undertake any scientific study involving guns, safety, culture, crime, etc etc. Speaking as a gun owner myself, I think the NRA is a wayward, counterproductive organization that is far too combative and has strayed too far from their original purpose, becoming in the process a horrible caricature of itself. On the other hand, a large chunk of the anti-gun lobby consists of fearmongers who are themselves largely ignorant when it comes to firearms and prey on the ignorance and fear of people to gain support.
The whole political debate is broken, and I see no evidence that this will ever change. Both sides fear nothing more than concession to their opponent, so an eternal stalemate will continue.
The OP is an example of just how far from reality the "gun debate" in this country has strayed.
What do we do with the 200 million legally owned guns? Not to mention the unknown (but surely quite significant) number of illegally owned or stolen guns we can't even track?
I think any talk of a blanket ban is pure folly and ignores the reality of the situation.
The biggest problem is just how far apart people are on this issue. People with little or no exposure to guns generally fear them and support draconian bans; people who grew up surrounded by them are much more likely to support some level of gun ownership, but a vocal minority of them want to do away with most or all regulation. I think both extreme positions (seeking to ban most/all guns vs advocating little/no regulation) are unrealistic and need to be abandoned.
The NRA's current policy leans heavily towards automatic knee-jerk attacks towards any person or organization that might appear to criticise or question any aspect of firearms ownership, or to undertake any scientific study involving guns, safety, culture, crime, etc etc. Speaking as a gun owner myself, I think the NRA is a wayward, counterproductive organization that is far too combative and has strayed too far from their original purpose, becoming in the process a horrible caricature of itself. On the other hand, a large chunk of the anti-gun lobby consists of fearmongers who are themselves largely ignorant when it comes to firearms and prey on the ignorance and fear of people to gain support.
The whole political debate is broken, and I see no evidence that this will ever change. Both sides fear nothing more than concession to their opponent, so an eternal stalemate will continue.
The OP is an example of just how far from reality the "gun debate" in this country has strayed.
thegman1234
Jan 3, 01:09 AM
I love reading this, suddenly half of the forum is a network specialist and knows what Apple will and will not do. Of course you can't forget the Verizon's network will fail just because all you specialists say so. Oh and the LTE network is only available in limited areas...gotta start somewhere...
I actually claimed to know little to nothing technical about LTE or cell networks. I was stating what I had been told and was making opinionated judgements based on my own logic.
I actually claimed to know little to nothing technical about LTE or cell networks. I was stating what I had been told and was making opinionated judgements based on my own logic.
more...
hyperpasta
Sep 25, 03:54 PM
Prob a dumb question but is my mac fast enough to run aperture?
20 inch imac
2 gb ram
intel 2.0
Answer: Yes
20 inch imac
2 gb ram
intel 2.0
Answer: Yes
aristobrat
Oct 6, 03:28 PM
i live in the san francisco bay area ---berkeley.
<snip>
I really love my iphone and am sorely regretting that i'm going to have to give it up because of att's unacceptable lack of reliable service
Yeah, you live in one of the two cities that AT&T repeatedly admits it's screwed up ... SF and NYC. :eek:
A little over two weeks ago, AT&T started turning on 3G coverage on their 850mhz frequency, which has greater range. Hopefully that will impact your service positively.
http://www.phonescoop.com/news/item.php?n=4718
<snip>
I really love my iphone and am sorely regretting that i'm going to have to give it up because of att's unacceptable lack of reliable service
Yeah, you live in one of the two cities that AT&T repeatedly admits it's screwed up ... SF and NYC. :eek:
A little over two weeks ago, AT&T started turning on 3G coverage on their 850mhz frequency, which has greater range. Hopefully that will impact your service positively.
http://www.phonescoop.com/news/item.php?n=4718
more...
mcmlxix
Apr 5, 04:50 PM
�iAd Gallery is a free download.� I would certainly hope so.
Could you imagine a TV channel that is nothing but ads? In a way QVC/HSN are a little bit like that. I just hope iAD Gallery won�t be hawking porcelain figurines, food dehydrators, and authentic, genuine, faux diamonelle rings.
Oh yeah�what would I do oo oo for a Klondike Bar.
Could you imagine a TV channel that is nothing but ads? In a way QVC/HSN are a little bit like that. I just hope iAD Gallery won�t be hawking porcelain figurines, food dehydrators, and authentic, genuine, faux diamonelle rings.
Oh yeah�what would I do oo oo for a Klondike Bar.
milo
Sep 12, 08:01 AM
The Stores seem to be listing MacBook delivery times as 5-7 working days. Is that normal or has it been increased? If it's an increase might that suggest a speedbump or something? There's not been much rumour activity around that though.
Not at this event.
Not at this event.
more...
Dagless
Mar 28, 02:52 PM
Eh, they could do with renaming this award ceremony. "App Store Award"? It's hardly "Apple Design Awards" if they're excluding a lot of those developers.
CalBoy
Apr 25, 05:21 PM
That's not fair. It's not the company's fault. It's called individual responsibilities and these employees should be fired.
It's perfectly fair. McDonalds gets the fruits of it's employees' labor if they do a superior job, so McDonalds should have to pay for their employees' screw-ups if they are work-related. The legal doctrine that expresses this is called respondeat superior.
The employees that were involved in this didn't commit any personal torts against the transgender lady, but they didn't do their jobs properly. McDonalds is (and should be) on the hook for this.
The video was hard to watch and saddens me more because a double minority (a black woman) should know better. The irony of this beating should be lost on no one.
It's perfectly fair. McDonalds gets the fruits of it's employees' labor if they do a superior job, so McDonalds should have to pay for their employees' screw-ups if they are work-related. The legal doctrine that expresses this is called respondeat superior.
The employees that were involved in this didn't commit any personal torts against the transgender lady, but they didn't do their jobs properly. McDonalds is (and should be) on the hook for this.
The video was hard to watch and saddens me more because a double minority (a black woman) should know better. The irony of this beating should be lost on no one.
more...
weg
Jan 15, 05:23 PM
the apple remote is an optional extra! like the superdrive, theres an optional extra ethernet USB adapter.
The price of the "Superdrive" ($99) is the real revolution. I've paid more than twice as much just for replacing the Combodrive of my Powerbook G4 with a Superdrive...
Now if Apple would start charging reasonable prices for RAM...
The price of the "Superdrive" ($99) is the real revolution. I've paid more than twice as much just for replacing the Combodrive of my Powerbook G4 with a Superdrive...
Now if Apple would start charging reasonable prices for RAM...
jackc
Jan 14, 08:56 PM
Now, Gizmodo just posted another editorial. They are not just refusing to apologize, they are actually proud. Supposedly this is a an act of civil disobedience, a sign of their independence. Not only are they being immature jerks, but exhibit this self righteous attitude. It is just a prank, (actually it is not even a creative one) so it is not that big of a deal, but their new editorial makes them seem even more immature. I wonder if somebody is going to play pranks on them to show some independence of his own.
Linky (http://gizmodo.com/344447/giz-banned-for-life-and-loving-it-on-pranks-and-civil-disobedience-at-ces)
They should be writing political speeches, I had a tear rolling down my cheek thinking about how they're standing up to corporations
Linky (http://gizmodo.com/344447/giz-banned-for-life-and-loving-it-on-pranks-and-civil-disobedience-at-ces)
They should be writing political speeches, I had a tear rolling down my cheek thinking about how they're standing up to corporations
more...
9secondadidas
Mar 24, 03:56 PM
Here's to 10 more!
tbobmccoy
Mar 24, 04:16 PM
Personally, I liked OS X 10.4 the best. My first Mac OS and I'll always have a special place in my heart for Tiger :cool:
more...
KeriJane
Apr 9, 12:50 PM
Let's see....
They're FINALLY going to some sort of UNIX thing.... Like Apple did.
Theyre FINALLY getting some sort of responsible backup system.... Like Apple did...
They're FINALLY going to self-contained applications, like Apple...
They're FINALLY building in PDF support like Apple
Etc, etc....
Why not just skip 8 and 9 and call it Windows 10? Or WINDOWS X.... Just like SURPRISE! Apple did! :p
All of which are necessary and seriously overdue. But how can anyone say it's not just another cheap ripoff of Apple yet again?
My big question is... How is MS going to maintain strict control and ownership of a UNIX core?
Isn't that why they've been sticking with their inferior, outdated and disasterously defective proprietary MS technology up until now?
Have Fun,
Keri
They're FINALLY going to some sort of UNIX thing.... Like Apple did.
Theyre FINALLY getting some sort of responsible backup system.... Like Apple did...
They're FINALLY going to self-contained applications, like Apple...
They're FINALLY building in PDF support like Apple
Etc, etc....
Why not just skip 8 and 9 and call it Windows 10? Or WINDOWS X.... Just like SURPRISE! Apple did! :p
All of which are necessary and seriously overdue. But how can anyone say it's not just another cheap ripoff of Apple yet again?
My big question is... How is MS going to maintain strict control and ownership of a UNIX core?
Isn't that why they've been sticking with their inferior, outdated and disasterously defective proprietary MS technology up until now?
Have Fun,
Keri
millerb7
May 2, 11:03 AM
I find it hilarious that Steve Jobs claimed Apple was not tracking users, but now all of a sudden we find Location tracking being completely removed from this version of iOS, that is honestly something that annoyes me..
Well that's just wrong... they aren't completely removing location tracking in anything. Just fixing "bugs" that stored to much information in a file on your phone.
FAIL
Well that's just wrong... they aren't completely removing location tracking in anything. Just fixing "bugs" that stored to much information in a file on your phone.
FAIL
PlaceofDis
Jan 13, 03:04 PM
That childish prank is close to the kind of thing that Woz pulled in college, so I can appreciate the humor on one level. The problem is that this was done at a trade show and is completely unacceptable behavior for any group passing themselves off as professional journalists or industry bloggers who wish to be taken seriously.
If I were CES management, I'd ban them for life. Can't imagine Apple will let them anywhere near Moscone.
agreed. they should totally be banned for this. its not acceptable behavior.
I agree it was immature.
Still, it probably will lead vendors to 'secure' their sets in the future, and the fact that it was so obnoxious and obvious means it's very unlikely this sort of vulnerability will present itself next year.
the thing is, at a trade show, this shouldn't be an issue, as since gizmondo wants to act like a child, people have to spend more time and energy to make sure it doesn't happen again? its everyone paying for some stupid prank that was meaningless in the first place, which is way gizmondo fails.
If I were CES management, I'd ban them for life. Can't imagine Apple will let them anywhere near Moscone.
agreed. they should totally be banned for this. its not acceptable behavior.
I agree it was immature.
Still, it probably will lead vendors to 'secure' their sets in the future, and the fact that it was so obnoxious and obvious means it's very unlikely this sort of vulnerability will present itself next year.
the thing is, at a trade show, this shouldn't be an issue, as since gizmondo wants to act like a child, people have to spend more time and energy to make sure it doesn't happen again? its everyone paying for some stupid prank that was meaningless in the first place, which is way gizmondo fails.
Koodauw
Sep 12, 01:01 AM
That phone looks amazing. Wish I could have one.
slabbius
Nov 24, 08:45 PM
just ordered a nano
caliguy
Nov 23, 08:16 PM
yeah that's early! hmmm, what about the new york city 5th ave store? since they're 24/7, when would the sale start off for that store?? ...at 12 midnight tonight??:rolleyes:
Ha, never thought of that. I supposed so :). The people can pick out what they want at 10 'till 12 and then get in line at 12:00.
Ha, never thought of that. I supposed so :). The people can pick out what they want at 10 'till 12 and then get in line at 12:00.
eXoticon
Apr 15, 06:08 PM
i think it's ugly. i would not want my iphone to look like that.
peharri
Oct 31, 09:34 AM
The thin veneer is off the vast majority of people that clamor for OSS.
Whenever I hear the OSS crowd scream "Software should be FREE!" I translate that to mean "I refuse to pay someone for their work, thus I will STEAL it"!
I don't blame Apple. The OSS community abused what they had and turned to piracy by stealing the GUI. Kudos Apple.
What on Earth are you talking about? What are people stealing in the Arn's summary? The modified code isn't capable of running OS X, and until they closed the source, Darwin worked on most generic x86 platforms anyway.
Someone fixes a lack of functionality that existed in previous public versions and you call it "stealing"? WTF?
Whenever I hear the OSS crowd scream "Software should be FREE!" I translate that to mean "I refuse to pay someone for their work, thus I will STEAL it"!
I don't blame Apple. The OSS community abused what they had and turned to piracy by stealing the GUI. Kudos Apple.
What on Earth are you talking about? What are people stealing in the Arn's summary? The modified code isn't capable of running OS X, and until they closed the source, Darwin worked on most generic x86 platforms anyway.
Someone fixes a lack of functionality that existed in previous public versions and you call it "stealing"? WTF?
No comments:
Post a Comment