2011年3月30日 星期三

sharemgr remove share problem

when an asterisk (*) preceding the share. it is a temporary share


We can not delete it


user can access temporary share


It will disappear after reboot 


how to create temporary share:
ex:

sharemgr add-share -t -r peter -s /Test/imac/peter smb_group










share problem:
auto create nfs share because /lib/svc/method/nfs-server call "sharemgr start -P nfs -a" to enable nfs on all group

solution:
not use -a, use specific nfs group name
ex:
sharemgr start -P nfs nfs_group








判斷file是否存在 on iOS

if([[NSFileManager defaultManager] fileExistsAtPath:path])
{

}

macToday magazine的iPad版推出了

macToday magazine的iPad版推出了,做得還不錯。
http://itunes.apple.com/tw/app/id420948459?mt=8

install gcc on solaris

pkg install gcc-dev
or
pkg install SUNWgcc

2011年3月29日 星期二

save data using plist

只有以下類別的物件可以利用writeToFile:atomically:存入plist

NSArray
NSMutableArray
NSDictionary
NSMutableDictionary
NSData
NSMutableData
NSString
NSMutableString
NSNumber
NSDate

UITextField: 按下鍵盤上的return後,讓鍵盤消失

關鍵:  UIControlEventEditingDidEndOnExit和resignFirstResponder


ex:
          Enter鍵按下時觸發的method

    -(void)textFieldDone:(UITextField*)textField
    {
         [textField resignFirstResponder];
    }


          建立TextField

    textField = [[UITextField alloc] initWithFrame:
                              CGRectMake(5, 5,  
                                         image.size.width,
                                         image.size.height)];
    [imageView addSubview:textField];
    [textField addTarget:self  
          action:@selector(textFieldDone:)  
         forControlEvents:UIControlEventEditingDidEndOnExit];
    [textField release];