小编jim*_*bob的帖子

accessoryButtonTappedForRowWithIndexPath:没有被调用

我创建这是越来越使用数组填充的详细披露按钮....然而accessoryButtonTappedForRowWithIndexPath:功能不被称为我的课.这是一个TableviewDelegateTableviewDatasource委托.

- (void)tableView:(UITableView *)tableView accessoryButtonTappedForRowWithIndexPath:(NSIndexPath *)indexPath{
    NSLog(@"reaching accessoryButtonTappedForRowWithIndexPath:");
    [self performSegueWithIdentifier:@"modaltodetails" sender:[self.eventsTable cellForRowAtIndexPath:indexPath]];
}
Run Code Online (Sandbox Code Playgroud)

NSLog没有打印到控制台,这使我相信函数没有被调用...这当然是我选择一个单元格.下面的屏幕截图显示了我如何设置单元格.

在此输入图像描述

objective-c uitableview accessoryview ios

30
推荐指数
5
解决办法
3万
查看次数

tableView:numberOfRowsInSection:]:发送到实例的无法识别的选择器

我有一个奇怪的问题.我收到此错误:

 -[FourSquareCheckInViewController tableView:numberOfRowsInSection:]: unrecognized selector sent to instance 0x7aecc0
2012-09-14 19:18:39.039 [5869:707] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[FourSquareCheckInViewController tableView:numberOfRowsInSection:]: unrecognized selector sent to instance 0x7aecc0'
*** First throw call stack:
(0x3545e88f 0x37805259 0x35461a9b 0x35460a83 0x353bb650 0x32ee3693 0x32ee49ed 0x32ee493f 0x32ee451b 0x32ef17df 0x32ef16af 0x32e95f37 0x353bd1fb 0x3228daa5 0x3228d6bd 0x32291843 0x3229157f 0x322894b9 0x35432b1b 0x35430d57 0x354310b1 0x353b44a5 0x353b436d 0x37050439 0x32ec0cd5 0xb7ebb 0xb7e60)
terminate called throwing an exception(lldb) 
Run Code Online (Sandbox Code Playgroud)

好的,我确保将ViewController设置为dataSource和Delegate.我已将UITableViewDelegate和UITableViewDataSource添加到<> thingies中.

我在viewDidLoad方法中设置了tableView.delegate = self和tableView.dataSource = self.

这是我对viewDidLoad和viewDidAppear方法的实现:

- (void)viewWillAppear:(BOOL)animated{
    locationManager = [[CLLocationManager alloc] …
Run Code Online (Sandbox Code Playgroud)

xcode delegates uitableview ios

27
推荐指数
5
解决办法
5万
查看次数

如何从Eclipse中的Android项目中删除依赖项

当我突出显示我的项目时,转到属性,选择java构建路径,然后尝试从我的Android依赖项列表中删除Android依赖项,删除按钮是灰色的.如何删除该特定依赖项?

eclipse dependencies android libraries

15
推荐指数
2
解决办法
2万
查看次数

如何从NSDictionary中删除空值

我有一个JSON Feed:

{
            "count1" = 2;
            "count2" = 2;
            idval = 40;
            level = "<null>";
            "logo_url" = "/assets/logos/default_logo_medium.png";
            name = "Golf Club";
            "role_in_club" = Admin;
}
Run Code Online (Sandbox Code Playgroud)

问题是"<null>"我无法弄清楚如何在将NSDictionary保存到NSUserDefaults之前从NSDictionary中删除.

请帮我解决这个问题.谢谢!

null json nsdictionary ios

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

setCompoundDrawablesWithIntrinsicBounds(int,int,int,int)不起作用

我有一些EditText views我想在左边设置图像的地方,setCompoundDrawablesWithIntrinsicBounds似乎没有工作.图形似乎没有改变.

有谁知道为什么会这样?

以下是我设置drawables的方法:

        mFirstname.setCompoundDrawablesWithIntrinsicBounds(R.drawable.user_icon, 0, 0, 0);
        mLastname.setCompoundDrawablesWithIntrinsicBounds(R.drawable.user_icon, 0, 0, 0);
        mEmail.setCompoundDrawablesWithIntrinsicBounds(R.drawable.mailicon, 0, 0, 0);
        mPassword.setCompoundDrawablesWithIntrinsicBounds(R.drawable.lockicon, 0, 0, 0);
        mDateOfBirth.setCompoundDrawablesWithIntrinsicBounds(R.drawable.calico, 0, 0, 0);
        mCity.setCompoundDrawablesWithIntrinsicBounds(R.drawable.mailicon, 0, 0, 0);
        mStreet.setCompoundDrawablesWithIntrinsicBounds(R.drawable.mailicon, 0, 0, 0);
        mPostcode.setCompoundDrawablesWithIntrinsicBounds(R.drawable.mailicon, 0, 0, 0);
        mPhoneNumber.setCompoundDrawablesWithIntrinsicBounds(R.drawable.mailicon, 0, 0, 0);
Run Code Online (Sandbox Code Playgroud)

xml graphics android android-edittext android-drawable

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

Android 2.3.x javax.net.ssl.SSLHandshakeException:java.security.cert.CertPathValidatorException:找不到证书路径的信任锚

我只在(可能是一些)2.3.x设备上收到此错误.它适用于运行Android版本的任何其他设备.

这是我的HTTPRequestController:

public class HttpRequestController {

private final static String TAG = "HttpRequestController";

private static HttpRequestController instance;

public enum Method {
    PUT, POST, DELETE, GET
}

private HttpRequestController() {

}

public static HttpRequestController getInstance() {
    if (instance == null)
        instance = new HttpRequestController();

    return instance;
}

public String doRequest(String url, HashMap<Object, Object> data,
        Method method, String token) throws Exception {

    InputStream certificateInputStream = null;
    if (MyApplication.PRODUCTION) {
        certificateInputStream = MyApplication.context
                .getResources().openRawResource(R.raw.production_cert);
        LogUtils.log("using production SSL certificate");
    } else {
        certificateInputStream = …
Run Code Online (Sandbox Code Playgroud)

ssl android

8
推荐指数
1
解决办法
1万
查看次数

zipalign错误:系统找不到指定的文件

我输入:

C:\ Program Files(x86)\ Android\android-sdk\tools> zipalign [-f] [-v] B10816062011-unaligned.apk B10816062011-aligned.apk

它返回:

该系统找不到指定的文件.

它让我疯狂,因为我知道源文件是我试图指导的地方!

有谁知道或经历过这个问题?

android alignment apk

7
推荐指数
1
解决办法
5359
查看次数

如何检查dispatch_async块是否已经完成运行

所以基本上我需要能够在块运行完成后运行segue.我有一个块,它可以执行一些JSON操作,我需要知道它何时运行完毕.

我有一个名为json_queue的队列.

jsonQueue = dispatch_queue_create("com.jaboston.jsonQueue", NULL);
Run Code Online (Sandbox Code Playgroud)

然后我有一个使用以下语法的dispatch_async块:

  dispatch_async(jsonQueue, ^{
  [self doSomeJSON];
  [self performSegueWithIdentifier:@"modaltomenu" sender:self];
  });
Run Code Online (Sandbox Code Playgroud)

它不会让我执行这一行:"[self performSegueWithIdentifier:@"modaltomenu"sender:self];"

试图从主线程或Web线程以外的线程获取Web锁.这可能是从辅助线程调用UIKit的结果.现在崩溃......

我在哪里可以检查线程何时完成其脏工作,以便我可以调用segue?

谢谢你们可爱的人们.

PS:啤酒和ups,泰迪熊和鲜花给谁能帮助<3.

iphone xcode grand-central-dispatch ios

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

类不是视图android.support.v4.app.Fragment

我正在努力将这个片段添加到我的XML布局中.

在我的Activity XML布局中,我有以下内容:

        <LinearLayout
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            android:layout_weight="0.5"
            android:orientation="vertical" >

            <fragment
                android:id="@+id/fragment_invitefriendsprogress"
                android:name="tv.superawesome.club.android.ui.fragments.InviteFriendsProgressFragment"
                android:layout_width="match_parent"
                android:layout_height="match_parent"
                tools:layout="@layout/fragment_invitefriendsprogress" />

        </LinearLayout>
Run Code Online (Sandbox Code Playgroud)

我收到一个奇怪的错误:

XML file line #205: Class is not a View android.support.v4.app.Fragment
Run Code Online (Sandbox Code Playgroud)

第205行是:

<fragment
Run Code Online (Sandbox Code Playgroud)

我错过了什么吗?

这里是参考完整的XML布局代码:

<RelativeLayout
    android:id="@+id/bar"
    android:layout_width="match_parent"
    android:layout_height="60dp"
    android:layout_alignParentBottom="true"
    android:background="@drawable/actionbar" >

    <ImageView
        android:id="@+id/icon"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_centerVertical="true"
        android:layout_marginLeft="10dp"
        android:src="@drawable/small" />

    <ImageView
        android:id="@+id/star"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_alignParentRight="true"
        android:layout_centerVertical="true"
        android:layout_marginRight="10dp"
        android:src="@drawable/starpink" />

    <ImageView
        android:id="@+id/man"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_alignTop="@+id/star"
        android:layout_marginRight="25dp"
        android:layout_toLeftOf="@+id/star"
        android:src="@drawable/invitepink" />
</RelativeLayout>

<ScrollView
    android:id="@+id/scrollView1"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:layout_above="@+id/bar"
    android:layout_alignParentTop="true"
    android:background="@drawable/bg" >

    <LinearLayout
        android:layout_width="match_parent"
        android:layout_height="match_parent" >

        <RelativeLayout
            android:id="@+id/inwrapper" …
Run Code Online (Sandbox Code Playgroud)

android android-fragments

7
推荐指数
1
解决办法
5652
查看次数

无法撤消故事板更改xcode

有谁知道如何撤消对故事板所做的更改.每当我不小心删除一个元素时,我都无法将其恢复,它正在成为一个真正的时间.

谁知道?

xcode storyboard

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