作者:老蒋
科学家和工程师降低了摄影这个事的技术门槛,人人都能拍,要想拍的好一点也只需要很少的技术知识,我写的不准确,但是够用了。
作者:老蒋
科学家和工程师降低了摄影这个事的技术门槛,人人都能拍,要想拍的好一点也只需要很少的技术知识,我写的不准确,但是够用了。
- (BOOL) videoRecordingAvailable
{
if (![UIImagePickerController isSourceTypeAvailable:UIImagePickerControllerSourceTypeCamera]) return NO;
return [[UIImagePickerController availableMediaTypesForSourceType:UIImagePickerControllerSourceTypeCamera] containsObject:@"public.movie"];
}
-(void)recordVideo
{
if ([UIImagePickerController isSourceTypeAvailable:UIImagePickerControllerSourceTypeCamera]) {
UIImagePickerController *imagePicker = [[UIImagePickerController alloc] init];
imagePicker.videoQuality = UIImagePickerControllerQualityTypeHigh;
imagePicker.sourceType = UIImagePickerControllerSourceTypeCamera;
imagePicker.delegate = self;
imagePicker.allowsEditing = YES;
imagePicker.videoMaximumDuration = 300.0f;
imagePicker.mediaTypes = [NSArray arrayWithObject:@"public.movie"];
[self presentModalViewController:imagePicker animated:YES];
}
}
- (void)video:(NSString *)videoPath didFinishSavingWithError:(NSError *)error contextInfo:(void *)contextInfo
{
if (!error)
self.title = @"Saved!";
else
CFShow([error localizedDescription]);
}
2010-01-26 14:07:30.397 ePAD[1869:4e0b] parser error Error Domain=NSXMLParserErrorDomain Code=76 "Operation could not be completed. (NSXMLParserErrorDomain error 76.)", userInfo (null)
2010-01-26 14:07:30.397 ePAD[1869:4e0b] parse error = Error Domain=NSXMLParserErrorDomain Code=76 "Operation could not be completed. (NSXMLParserErrorDomain error 76.)"
- (BOOL)tabBarController:(UITabBarController *)tabBarController shouldSelectViewController:(UIViewController *)viewController
{
// NSLog(@"good to see it");
if (self.selectedViewController == viewController ) {
if ([((UINavigationController*)viewController).visibleViewController respondsToSelector:@selector(showCategoryBtns)]) {
[ (TableViewController*)(((UINavigationController*)viewController).visibleViewController) showCategoryBtns];
}
}
return YES;
}
[preBtn addTarget:self action:@selector(pre:) forControlEvents:UIControlEventTouchDown];
[nextBtn addTarget:self action:@selector(next:) forControlEvents:UIControlEventTouchDown];
-(void)pre:(id)sender
{
//if ([controller preItem] != nil) {
[controller preItem:self];
[webView loadHTMLString:self.content baseURL:[NSURL URLWithString:@""]];
//[webView reload];
//}
}
-(void)next:(id)sender
{
//if ([controller nextItem] != nil) {
[controller nextItem:self];
[webView loadHTMLString:self.content baseURL:[NSURL URLWithString:@""]];
//[webView reload];
//}
}
对UITableView 使用category 增加一个方法,用来修改_selectedIndexPaths
@implementation UITableView (section)
-(void)setSelectRow:(NSUInteger)row section:(NSUInteger)asection
{
NSLog(@"row: %d: asection: %d",row,asection);
NSLog(@"selectedIndexPaths: %@",_selectedIndexPaths);
[_selectedIndexPaths removeLastObject];
[_selectedIndexPaths addObject:[NSIndexPath indexPathForRow:row inSection:asection]];
NSLog(@"selectedIndexPaths: %@",_selectedIndexPaths);
}
@end