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

Mockup & CodeGen, iPhone & iPad
($9.99)

Make your own iPhone apps
and run them live!
(free)

Manu
($0.99)

Want your application or service advertised on iPhone Dev SDK?

Go Back   iPhone Dev SDK Forum

View Single Post
Old 03-10-2009, 06:52 PM   #2 (permalink)
Legrend
New Member
 
Join Date: Mar 2009
Location: Covina, California - United States
Age: 28
Posts: 22
Default

Hey,

I'm kind of new to programming in general and Objective-C, Cocoa, Xcode, and pretty much everything in general, but personally I hate the tunary operator. I would ditch it as it has caused me issues in other API's I've used.

Other than that, I would put a NSLog in your function call.

Code:
- (IBAction)start:(id)sender
{
     NSLog(@"Entering: (IBAction)start:(id)sender");

     UIBarButtonItem *button = (UIBarButtonItem *)sender;
     NSString *title = (timer!=nil) ? @"Start" : @"Stop";
     if (timer!=nil)
     {
          NSLog(@"(timer != nil) == TRUE))";
          [timer invalidate];
          [timer release];
          timer = nil;
    } 
    else 
    {
          NSLog(@"(timer != nil) == FALSE))";
         timer = [NSTimer scheduledTimerWithTimeInterval:0.025 target:self selector:@selector(tick) userInfo:nil repeats:YES];
    }
    [button setTitle:title];

NSLog(@"Exiting: (IBAction)start:(id)sender");
}

Hope this will help a little. I figure any suggestions is better than none.
Legrend is offline   Reply With Quote
 

» Advertisements
» Online Users: 714
21 members and 693 guests
ADY, AppleSteve, blueskysinger, ckgni, clovisbear, Domele, jkigel, Josh11, k2c, learningtocode, Oral B, pratikchandak, sacha1996, shairah27, Thompson22, Walbuzen, williamWang, wrom567, zamoraalex2696, zom888, zuil777
Most users ever online was 1,187, 10-11-2011 at 08:09 AM.
» Stats
Members: 158,618
Threads: 89,140
Posts: 380,325
Top Poster: BrianSlick (7,110)
Welcome to our newest member, jkigel
Powered by vBadvanced CMPS v3.1.0

All times are GMT -5. The time now is 01:17 AM.
Powered by vBulletin® Version 3.8.0
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.