아이폰어플개발정보2010. 10. 12. 05:06
toolbar button 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;

}

Posted by 오늘마감

댓글을 달아 주세요