Search Results

Search found 3 results on 1 pages for 'califguy'.

Page 1/1 | 1 

  • formatting NSArray

    - by califguy
    So from the code below, I have managed to get the string *tempstring into an array chunk. Now chunk[0] contains 'a' while chunk[1] contains 'aa'. I am trying to format chunk[0] to '0a' which I can using the replaceObjectAtIndex method. Here's my question: How do I detect that chunk[0] is formatted as 'a' and not '0a'. I want to check all the indexes and make sure they have double digits and if not use a 0 to prefix it. NSString *tempstring = @"a-aa-bb"; NSMutableArray *chunk = [tempstring componentsSeparatedByString: @"-"]; NSLog(@"%@",[chunk objectAtIndex:0]);

    Read the article

  • NSApp Sheets question in cocoa

    - by califguy
    Hi, Here's what I am trying to do. I need to prompt the user for a password prompt and until he enters the password and hits, say the Enter button on the sheet, I want to prevent the code being parsed in the background. Here's the code to run the sheet and when the user enters the password and hits Enter, endSpeedSheet is run. I am calling all of this from my Main() function. What I am noticing is that the when the main function runs, the sheet shows up, the user is prompted for a password. But in the background, I already see " Code gets here" has been run. This means the code has already run in the background. What I need is the code to wait at the password prompt and then use this password after the Sheet has been dismissed. Any idea's on what I am missing here ? - (IBAction) showSpeedSheet:(id)sender { [NSApp beginSheet:speedSheet modalForWindow:(NSWindow *)window modalDelegate:nil didEndSelector:nil contextInfo:nil]; } -(IBAction)endSpeedSheet:(id)sender { joinPassword = [joinPasswordLabel stringValue]; [NSApp endSheet:speedSheet]; [speedSheet orderOut:sender]; } -(IBAction)main:(id)sender { [self showSpeedSheet:(id)sender]; // More Code here NSLog(@" Code gets here"); }

    Read the article

  • displaying mac address in right format

    - by califguy
    Hi, I am obtaining the mac(hw) address of an interface using CWNetwork. Now OS X gives me this mac address in the xx:xx:xx:xx:xx:xx format. But if the first digit is 0, OS X will output the address as 4:aa:dd:ee:34:40, instead of 04:aa:dd:ee:34:40. Now I am trying to take this string 4:aa:dd:ee:34:40 and convert it to 04:aa:dd:ee:34:40 before displaying it. Any ideas ? APpreciate the help.

    Read the article

1