小编Aru*_*Das的帖子

在iOS上的Safari的共享扩展中获取SLComposeServiceViewController中的URL

这个问题之前可能已经以不同的形式提出过,但我正在尝试稍微深入一点地理解共享扩展,因此,这个问题比之前提出的问题版本更详细.

在编写Share扩展时,我们可以继承SLComposeServiceViewController并获取viewDidLoad()和didSelectPost()事件等,但VC上的唯一属性是contentText和textView以及根据Apple文档的占位符属性

https://developer.apple.com/library/prerelease/ios/documentation/Social/Reference/SLComposeServiceViewController_Class/

鉴于这种情况,执行以下操作的最佳方式是什么:

首先,使用网站的URL填充显示的VC

其次,访问URL以传递给sharedDefaults,如下所示

let shareDefaults = NSUserDefaults(suiteName: "groupName")
shareDefaults?.setObject(self.contentText, forKey: "stringKey")
shareDefaults?.synchronize() 
Run Code Online (Sandbox Code Playgroud)

以便能够保存它以便以后从应用程序访问.

任何有关获取URL的帮助将不胜感激.

objective-c ios swift xcode7

6
推荐指数
1
解决办法
3422
查看次数

ad-hoc 和 softAP WiFi 网络之间的根本区别是什么?

ad-hoc 和 softAP WiFi 网络之间的根本区别是什么?

android

5
推荐指数
1
解决办法
5301
查看次数

AndroidStudio / Gradle找不到javax.persistence包

尝试执行以下教程时:

https://cloud.google.com/developers/articles/how-to-build-mobile-app-with-app-engine-backend-tutorial/

使用Android Studio,我创建了一个Android Studio项目,并添加了具有以下内容的CheckIn.java类:

import java.util.Date;
import com.google.appengine.api.datastore.Key;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;

@Entity
public class CheckIn {
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
private java.security.Key key;
private String placeId;
private String userEmail;
private Date checkinDate;

public java.security.Key getKey() {
    return key;
}

public String getPlaceId() {
    return placeId;
}
public void setPlaceId(String placeId) {
    this.placeId = placeId;
}

public String getUserEmail() {
    return userEmail;
}
public void setUserEmail(String userEmail) {
    this.userEmail = userEmail;
}

public Date getCheckinDate() …
Run Code Online (Sandbox Code Playgroud)

android gradle google-cloud-endpoints android-studio android-gradle-plugin

5
推荐指数
1
解决办法
6014
查看次数

对实体"f"的引用必须以";"结尾 分隔符

我的res/raw文件夹中有以下xml文件 -

RSS的标题http://urlofthething.com

    <item>
        <title>Title</title>
        <description>The description goes here</description>
        <link>http://someurl.someurl.com/data/Content/1771370477</link>
        <guid>15626277</guid>
        <pubDate>28 Jan 2011 19:07:00 +0000</pubDate>
        <media:group>
            <media:content medium="video" duration="273"
                url="http://something.someurl.com/access/choice/u/0/1/15626277?rtspdirect=true&f=001110786488&stylesheet=mobile">

            </media:content>
        </media:group>
    </item>

    <item>
        <title>Title</title>
        <description>The description goes here</description>
        <link>http://someurl.someurl.com/data/Content/1771370477</link>
        <guid>15626277</guid>
        <pubDate>28 Jan 2011 19:07:00 +0000</pubDate>
        <media:group>
            <media:content medium="video" duration="273"
                url="http://something.someurl.com/access/choice/u/0/1/15626277?rtspdirect=true&f=001110786488&stylesheet=mobile">

            </media:content>
        </media:group>
    </item>
</channel>
Run Code Online (Sandbox Code Playgroud)

我正在使用

InputStream ins = getResources().openRawResource(R.raw.myxmlfile);
Run Code Online (Sandbox Code Playgroud)

阅读文件.

但是就行了 -

url="http://something.someurl.com/access/choice/u/0/1/15626277?rtspdirect=true&f=001110786488&stylesheet=mobile">
Run Code Online (Sandbox Code Playgroud)

我收到以下错误 -

The reference to entity "f" must end with the ';' delimiter
Run Code Online (Sandbox Code Playgroud)

android

4
推荐指数
1
解决办法
7700
查看次数

在运行Playbook OS 2.0的Blackberry Playbook上开发,调试和运行Android应用程序的快速方法

有没有人想出一个策略,使用eclipse插件和命令行脚本在运行Playbook OS 2.0的Blackberry Playbook上快速调试和运行Android应用程序?

android blackberry-playbook

4
推荐指数
1
解决办法
1199
查看次数

无法在任何来源中找到json-1.8.1(Bundler :: GemNotFound)

我正在运行以下堆栈:

  • ruby 2.1.1p76(2014-02-24修订版45161)[x86_64-linux]
  • RubyGems 2.2.2
  • Rails 4.1.0
  • Bundler版本1.6.2

在ubuntu上运行apache

我收到以下错误:

无法在任何来源中找到json-1.8.1(Bundler :: GemNotFound)

当我寻找json如下:

$ gem list | grep json

json (1.8.1)
multi_json (1.9.2)
Run Code Online (Sandbox Code Playgroud)

它存在但由于某种原因,来自Passenger的消息如下:

Ruby(Rack)应用程序无法启动

错误消息:无法在任何源代码中找到json-1.8.1(Bundler :: GemNotFound)异常类:PhusionPassenger :: UnknownError

ruby json ruby-on-rails

4
推荐指数
2
解决办法
7726
查看次数

src/main/webapp/WEB-INF文件夹未显示在Android Studio中

在Android Studio中生成Cloud Endpoints项目时,包含html的src/main/webapp文件夹不会显示在Android Studio中.有没有一种特殊的方法来显示src/main/webapp文件?

android google-cloud-endpoints android-studio

4
推荐指数
1
解决办法
592
查看次数

在哪个线程上处理和执行像 AJAX 请求这样的异步请求

由于浏览器中的 Javascript 引擎只有 1 个线程,因此当我们使用 jquery 创建 XHR 请求时,就像这样

$.ajax({
  url: "http://test.com/test.html",
  context: document.body
}).done(function() {
  $( this ).addClass( "done" );
});
Run Code Online (Sandbox Code Playgroud)

对远程服务器的 HTTP 请求发生在哪个线程上,通知主线程请求已完成的线程是什么?

javascript jquery multithreading

4
推荐指数
1
解决办法
1602
查看次数

以编程方式定位UITableViewCell的内容时使用什么代替UITextAlignmentRight

在苹果自己的文档中,

https://developer.apple.com/library/ios/documentation/UserExperience/Conceptual/TableView_iPhone/TableViewCells/TableViewCells.html

建议您在该页面的以下代码段中使用UITextAlignmentRight:

Listing 5-7  Adding subviews to a cell’s content view
#define MAINLABEL_TAG 1
#define SECONDLABEL_TAG 2
#define PHOTO_TAG 3

- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {

    static NSString *CellIdentifier = @"ImageOnRightCell";

    UILabel *mainLabel, *secondLabel;
    UIImageView *photo;
    UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier];
    if (cell == nil) {
        cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellIdentifier];
        cell.accessoryType = UITableViewCellAccessoryDetailDisclosureButton;

        mainLabel = [[UILabel alloc] initWithFrame:CGRectMake(0.0, 0.0, 220.0, 15.0)];
        mainLabel.tag = MAINLABEL_TAG;
        mainLabel.font = [UIFont systemFontOfSize:14.0];
        mainLabel.textAlignment = UITextAlignmentRight;
        mainLabel.textColor = [UIColor blackColor];
        mainLabel.autoresizingMask …
Run Code Online (Sandbox Code Playgroud)

ios ios9

2
推荐指数
1
解决办法
459
查看次数

具有 SSL 配置的 Apache 不适用于 Django 应用程序的 WSGI 配置

这是 github 上以下问题的后续:

https://github.com/certbot/certbot/issues/1820

https://github.com/certbot/certbot/issues/2546

Letsencrypt无法处理apache的WSGI配置

我正在使用以下配置运行 apache2

<VirtualHost *:80>
        # The ServerName directive sets the request scheme, hostname and port that
        # the server uses to identify itself. This is used when creating
        # redirection URLs. In the context of virtual hosts, the ServerName
        # specifies what hostname must appear in the request's Host: header to
        # match this virtual host. For the default virtual host (this file) this
        # value is not decisive as it is used …
Run Code Online (Sandbox Code Playgroud)

django ssl apache2 lets-encrypt certbot

2
推荐指数
1
解决办法
2893
查看次数