cocoaTouch/otherSrc/CommodityFunctions.m
changeset 3373 c1ff724a5c34
parent 3365 37ac593e9027
child 3385 361bd29293f4
equal deleted inserted replaced
3372:5d3daec0d0b5 3373:c1ff724a5c34
    48     else
    48     else
    49         return (interfaceOrientation == UIInterfaceOrientationLandscapeRight);
    49         return (interfaceOrientation == UIInterfaceOrientationLandscapeRight);
    50 
    50 
    51 }
    51 }
    52 
    52 
    53 NSInteger randomPort() {
    53 NSInteger randomPort () {
    54     return (random() % 64541) + 1025;
    54     srandom(time(NULL));
       
    55     return (random() % 64511) + 1024;
    55 }
    56 }
    56 
    57 
       
    58 void popError (const char *title, const char *message) {
       
    59     UIAlertView *alert = [[UIAlertView alloc] initWithTitle:[NSString stringWithUTF8String:title]
       
    60                                                     message:[NSString stringWithUTF8String:message]
       
    61                                                    delegate:nil
       
    62                                           cancelButtonTitle:@"Ok"
       
    63                                           otherButtonTitles:nil];
       
    64     [alert show];
       
    65     [alert release];
       
    66 }
       
    67     
    57 
    68 
       
    69