小编kle*_*vre的帖子

无法使用Xcode 4提交Subversion

我想知道当我尝试提交文件时如何解决这个问题:

工作副本"PROJECT-NAME"无法提交文件.

dyld:惰性符号绑定失败:未找到符号:_apr_stat $ INODE64引
自:/ usr/bin/svn
预期:/usr/lib/libapr-1.0.dylib

dyld:未找到符号:_apr_stat $ INODE64引自:/ usr/bin/svn预期在:/usr/lib/libapr-1.0.dylib

我可以列出,结账,但我无法使用Xcode.我可以使用版本或命令行来提交.但我希望能够使用Xcode.

所以我尝试使用shell中的命令将动态库libapr-1.0更改为更新的库:

sudo install_name_tool -change /usr/lib/libapr-1.0.dylib /usr/lib/libapr-1.0.3.8.dylib /usr/bin/svn
Run Code Online (Sandbox Code Playgroud)

看来Xcode将不再列出,所以我该怎么办?有什么建议吗?

svn iphone xcode ipad xcode4

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

防止edittext为空

我有以下代码,我想用它来确保我的edittext不会为空.因此,如果第一个绘制的0(零)被移除,它必须在焦点改变时恢复为0,这是到目前为止的应用程序:

package your.test.two;

import android.app.Activity;
import android.os.Bundle;
import android.view.View;
import android.widget.EditText;

public class TesttwoActivity extends Activity {
    /** Called when the activity is first created. */
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.main);
        EditText edtxt = (EditText)findViewById(R.id.editText1);
        // if I don't add the following the app crashes (obviously):
        edtxt.setText("0");
        edtxt.setOnFocusChangeListener(new View.OnFocusChangeListener() {

            public void onFocusChange(View v, boolean hasFocus) {
                // TODO Auto-generated method stub
                update();   
            }
        });
    }

    public void update() {
        EditText edittxt = (EditText)findViewById(R.id.editText1);
        Integer i = …
Run Code Online (Sandbox Code Playgroud)

android integer android-edittext

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

如何使用std :: mem_fun传递参数

我想知道是否有办法使用std :: mem_fun传递参数?我想确切地说,我可以拥有尽可能多的参数和许多成员函数.
问题是我的标准很旧而且我正在寻找一个完整的标准方式,因此即使我知道我可以轻松地做到这一点,也不允许提升作为答案= /

以下是我想如何使用它的一个小例子:

#include <list>
#include <algorithm>

// Class declaration
//
struct Interface {
   virtual void run() = 0;
   virtual void do_something(int) = 0;
   virtual void do_func(int, int) = 0;
};

struct A : public Interface {
   void run() { cout << "Class A : run" << endl; }
   void do_something(int foo) { cout << "Class A : " << foo << endl; }
   void do_func(int foo, int bar) { cout << "Class A : " << …
Run Code Online (Sandbox Code Playgroud)

c++ algorithm foreach

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

从NSString获取ivar或财产

我们可以得到一个ivarpropertyNSString像我们可以得到一个classNSString使用功能NSClassFromNSString()

iphone objective-c ipad ios

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

如何将水平 UICollectionView 的第一个和最后一个单元格居中?

我试图将水平集合视图的第一个和最后一个单元格居中。

到目前为止,我发现的唯一方法是在我的UICollectionView. 由于显而易见的原因,这种方法完全是一个坏主意,但我现在没有找到更好的方法。并且因为使用 iPhone 6 和 iPhone 6+,我的视图布局完全被破坏了......(facepalm)

为了说明我的需要,我需要显示如下内容:

|        x x x x x|  where the first x represent my first cell

and

|x x x x x        |  where the last x represent my last cell
Run Code Online (Sandbox Code Playgroud)


我认为使用UICollectionViewFlowLayout子类是处理contentInset东西的正确方法,但我对这些组件完全是新手。
关于如何实现这一目标的任何链接或建议?

iphone objective-c ios uicollectionview

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

没有openGL和cocos2d实现粒子系统的最简单方法是什么

一切都在问题中,我已经和cocos2d一起工作了,说它是一个很棒的图书馆,但今天我只想在一个完整的UIKit项目中使用粒子系统.不幸的是,只要我知道,我必须用OpenGL实现一个.有什么建议 ?

iphone opengl-es objective-c particles cocos2d-iphone

3
推荐指数
1
解决办法
4956
查看次数

擦除UIImageView的矩形

我想知道,我怎么能擦除一个自定义矩形(例如,用UIViewin IB或其他东西)UIImageView来显示另一个UIImageView位于下面的.


在此输入图像描述

我没有设法在论坛中使用一些回复...

iphone objective-c uiimageview ipad ios

3
推荐指数
1
解决办法
1745
查看次数

我可以将哪些配置文件与CoreBluetooth一起使用?

我在寻找有关的信息CoreBluetooth,我看到iPhone4s/5支持蓝牙4.0蓝牙LE.
另外,根据本说明,我可以使用这些配置文件:

  1. 免提配置文件(HFP 1.6)
  2. 电话簿访问配置文件(PBAP)
  3. 高级音频分发配置文件(A2DP)
  4. 音频/视频远程控制配置文件(AVRCP 1.4)
  5. 个人区域网络配置文件(PAN)
  6. 人机接口设备配置文件(HID)
  7. 消息访问配置文件(MAP)

我可以使用它来CoreBluetooth访问它们吗?如果可以,我怎样才能访问它们?

iphone objective-c ipad ios core-bluetooth

3
推荐指数
1
解决办法
3856
查看次数

如何绘制NSView的子视图

我试图在我的顶部绘制NSView有一些子视图.实际上我正在尝试重现Interface Builder的连接线样式.这是我目前使用的代码:

- (void)drawRect:(CGRect)dirtyRect 
{
    // Background color
    [[NSColor whiteColor] setFill];
    NSRectFill(dirtyRect);

    // Draw line
    if(_connecting)
    {
        CGContextRef c = [[NSGraphicsContext currentContext] graphicsPort];
        [[NSColor redColor] setStroke];

        CGContextMoveToPoint(c, _start.x, _start.y);
        CGContextAddLineToPoint(c, _end.x, _end.y);        
        CGContextSetLineWidth(c, LINE_WIDTH); 
        CGContextClosePath(c);
        CGContextStrokePath(c);
    }
}
Run Code Online (Sandbox Code Playgroud)

第一部分是给我上色NSView(如果你知道另一种方式,请告诉我'因为我来自iPhone开发,我想念backgroundColor属性UIView)

然后,如果检测到连接,我用2 NSPoint秒绘制它.这段代码有效,但我没有得到它来绘制子视图,只在第一个NSView.

cocoa objective-c subview nsview drawrect

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

片段可以通过其父活动实现两个接口吗?

为了在片段之间进行通信,我们使用父活动实现的接口模式...就像在文档中一样,例如,片段可以在其与活动的附件上获取父接口。

public class HeadlinesFragment extends ListFragment {
    OnHeadlineSelectedListener mCallback;

    // Container Activity must implement this interface
    public interface OnHeadlineSelectedListener {
        public void onArticleSelected(int position);
    }

    @Override
    public void onAttach(Activity activity) {
        super.onAttach(activity);

        // This makes sure that the container activity has implemented
        // the callback interface. If not, it throws an exception
        try {
            mCallback = (OnHeadlineSelectedListener) activity;
        } catch (ClassCastException e) {
            throw new ClassCastException(activity.toString()
                    + " must implement OnHeadlineSelectedListener");
        }
    }

...
}
Run Code Online (Sandbox Code Playgroud)

但是例如说父活动实现了另一个接口

public interface OnThreadCliked{
    void …
Run Code Online (Sandbox Code Playgroud)

android interface android-fragments

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

如何使用std :: for_each?

是否可以使用std :: for_each或其他类似的东西?

#include <list>
#include <algorithm>

// Class declaration
//
struct Interface
{
   virtual void run() = 0;
};

struct A : public Interface
{
   void run() { std::cout << "I run class A" << std::endl; }
};

struct B : public Interface
{
   void run() { std::cout << "I run class B" << std::endl; }
};

// Main
//
int main()
{
   // Create A and B
   A a;
   B b;

   // Insert it inside a list
   std::list<Interface …
Run Code Online (Sandbox Code Playgroud)

c++ algorithm foreach

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

如何在c ++中epur一个std :: string?

我会知道在没有使用boost的情况下使用std :: string的最佳方法和最简单的方法.

例如,如何转换此字符串

"  a   b          c  d     e '\t' f      '\t'g"
Run Code Online (Sandbox Code Playgroud)

"a b c d e f g"
Run Code Online (Sandbox Code Playgroud)

假设'\ t'是正常制表.

谢谢.

c++ string algorithm

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