toolbar 버튼 enabled, disabled

/**

 Conditionally enable the Add button:

 If the location manager is generating updates, then enable the button;

 If the location manager is failing, then disable the button.

 */

- (void)locationManager:(CLLocationManager *)manager

    didUpdateToLocation:(CLLocation *)newLocation

           fromLocation:(CLLocation *)oldLocation {

    if (!self.editing) {

addButton.enabled = YES;

}

}

- (void)locationManager:(CLLocationManager *)manager

       didFailWithError:(NSError *)error {

    addButton.enabled = NO;

}



출처 : http://blog.naver.com/PostList.nhn?blogId=philipousys¤tPage=26
Posted by 오늘마감