将HTML复制到UIPasteboard

我想从我的应用程序传输HTML到iPhone邮件应用程序。 我已经有了HTML文本 – 唯恐说<span style ='color:red>> Test </ span>我可以把它放到UIPasteBoard上 – 但是当我把它粘贴到邮件里时,我得到了html源文件。 当我在HTMLView中放置相同的string时 – select它并将其复制粘贴为邮件中的红色文本。 我需要做些什么才能将string放在UIPasteBoard中,以便将其粘贴为红色文本到邮件应用程序中? 我一直在寻找“格式types” – 并发现,UIPasteBoard返回“Aplle Web Archive粘贴板types”,当我有剪贴板中的元素(从UIWebView复制)。 但是在将内容添加到UIPasteBoard时,将其设置为types将不会在邮件应用程序中粘贴任何内容。 曼弗雷德

在sqlite中设置user_version

我在这里看到关于阅读user_version的其他问题,这似乎对我工作正常。 但是我想在FMDB中使用sqlite来设置我的版本号,它不是设置。 _db = [self openDatabase]; [_db executeUpdate:[StudentController creationString]]; [_db executeUpdate:[ReadingController creationString]]; [_db executeUpdate:[SessionController creationString]]; NSLog(@"User version is %i", userVersion); NSString *query = [NSString stringWithFormat:@"PRAGMA USER_VERSION = %i", userVersion]; [_db executeQuery:query]; 我得到的输出是: 2014-01-16 22:16:25.438 MyApp[2810:1c103] User version is 2 2014-01-16 22:16:25.439 MyApp[2810:1c103] Query is PRAGMA USER_VERSION = 2 2014-01-16 22:18:09.272 MyApp[2810:1c103] Database copied and created […]

以编程方式创build和呈现模态视图控制器

我正在试图以编程方式声明从使用故事板启动的视图控制器的模式视图控制器。 我希望能看到一个空白的视图,但是我只能看到第一个控制器的webview。 – (void)viewDidLoad { [super viewDidLoad]; NSString *fullURL = @"http://google.com"; NSURL *url = [NSURL URLWithString:fullURL]; NSURLRequest *requestObj = [NSURLRequest requestWithURL:url]; _viewWeb.delegate=self; [_viewWeb loadRequest:requestObj]; modalViewController=[[UIViewController alloc] init]; [self presentViewController:modalViewController animated:YES completion:nil]; }

从Cordova Capture获取audio数据的base64

我正在使用ngCordova Capture通过录制audio来写这段代码,并通过REST发送base64。 我可以使捕获audio工作,但一旦它返回audioURI,我不能从base64的文件系统获取数据。 我的代码如下: $cordovaCapture.captureAudio(options).then(function(audioURI) { $scope.post.tracId = $scope.tracId; $scope.post.type = 'audio'; console.log('audioURI:'); console.log(audioURI); var path = audioURI[0].localURL; console.log('path:'); console.log(path); window.resolveLocalFileSystemURL(path, function(fileObj) { var reader = new FileReader(); console.log('fileObj:'); console.log(fileObj); reader.onloadend = function (event) { console.log('reader.result:'); console.log(reader.result); console.log('event.result:'); console.log(event.result); } reader.onload = function(event2) { console.log('event2.result:'); console.log(event2.target.result); }; reader.readAsDataURL(fileObj); console.log(fileObj.filesystem.root.nativeURL + ' ' + fileObj.name); $cordovaFile.readAsDataURL(fileObj.filesystem.root.nativeURL, […]

如何在iOS的CollectionView的页脚中添加加载指标

当数据加载到下一页时,如何在集合视图的页脚中添加加载指示器..? 我想要加载指标在收集视图的页脚与上面的图像相同。 但我无法做到这一点。 那么有没有可能? 否则,我必须使用tableview创build这种types的列表视图。 因为我们可以轻松地将这些东西pipe理成tableview。 任何帮助,将不胜感激。

在UITableView中的自定义原型单元格中,UITextField值将replace为其他原型单元格

我采取了一个UITableView和里面,我已经使用了2个prototype单元格,现在在这些原型单元格中,我已经采取了1个UITextField 。 现在,当我运行应用程序,并在第一个原型单元格中input值,然后滚动UITableView ,然后第一个原型单元格的文本字段值来最后原型单元格的文本字段值。 所以它每次我滚动或滚动。 有时它变成空白。 这是我的代码 – (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { if(indexPath.row==0) { Client_MobileCell *cell = [tableView dequeueReusableCellWithIdentifier:cellIdentifier_MobileCell forIndexPath:indexPath]; cell.lblTitle.text = [arrTitle objectAtIndex:indexPath.row]; cell.txtMobile.placeholder = [arrPlaceholder objectAtIndex:indexPath.row]; // cell.txtMobile.tag = indexPath.row+100; return cell; } else { // Client_Common_Cell *cell = (Client_Common_Cell *)[tableView dequeueReusableCellWithIdentifier:cellIdentifier_CommonCell forIndexPath:indexPath]; Client_Common_Cell *cell = (Client_Common_Cell *)[tableView dequeueReusableCellWithIdentifier:cellIdentifier_CommonCell]; // cell.txtCommon.tag […]

商店数据库在iOS的不同位置有什么不同?

我正在使用SQLite.swift。 在文档中,数据库的path是: let path = NSSearchPathForDirectoriesInDomains( .DocumentDirectory, .UserDomainMask, true ).first! 但我想导入和使用现有的数据库,所以我已经拖动我的现有数据库到我的键盘扩展文件夹,并创build与path的连接是: let path = NSBundle.mainBundle().pathForResource("db", ofType:"sqlite3") 因此,我注意到第一种方式,数据库将存储在/Users/*/Library/Developer/CoreSimulator/Devices/8B1DB861-AA3F-446F-A559-D4727CDB9285/data/Containers/Data/PluginKitPlugin/0BC647E4-26F3-4A1F-8271-CC73C96FD197/Documents 第二种方式,数据库将被存储在应用程序中。 /Users/*/Library/Developer/CoreSimulator/Devices/8B1DB861-AA3F-446F-A559-D4727CDB9285/data/Containers/Bundle/Application/E5D9514C-859A-4D4D-A771-A8CE9CDCD3E7/AppName.app/PlugIns/AppNameExt.appex 这两个地方有什么不同? 第二种方式可能会增加应用程序的大小,因为它包含数据库? 如果我想存档/提交我的应用程序到现有的数据库的AppStore,这是唯一的方法?

为什么我不能closures或closuresUIWebView中的Javascript警报?

情况:我通过UIWebView方法stringByEvaluatingJavaScriptFromString:调用一个Javascript alert stringByEvaluatingJavaScriptFromString:像这样… [myWebView stringByEvaluatingJavaScriptFromString:@"alert('FOOBAR');"]; 问题: iOS按预期显示“FOOBAR”的提醒,但点击“closures”button不会解除提醒。 为什么我不能closuresJavascript警报? 我如何把它closures?

UITableViewCell分配问题 – 单元格不是零

– (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { static NSString *CellIdentifier = @"Cell2"; UILabel *titleLabel; UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier]; if (cell == nil) { cell = [[UITableViewCell alloc]initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellIdentifier]; titleLabel = [[UILabel alloc]initWithFrame:CGRectMake(5, 5, 300, 20)]; [cell.contentView addSubview:titleLabel]; titleLabel.tag = 0011; } else { titleLabel = (UILabel *)[cell.contentView viewWithTag:0011]; } // Configure the cell… NSMutableString […]

当单元格dynamicresize时如何获得UITableView的高度?

我有一个UITableViewdynamic大小的单元格。 这意味着我已经设置: tableView.estimatedRowHeight = 50.0 tableView.rowHeight = UITableViewAutomaticDimension 现在我想要获得整个表格视图的高度。 我试图通过tableView.contentSize.height得到它,但只返回估计的行高,而不是表视图的实际dynamic高度。 我如何获得整个表视图的dynamic高度?