小编Dim*_*mme的帖子

Objective-C中的矩阵

Objective-C中是否有Matrix支持类?按矩阵我的意思是2D阵列.

我现在所做的是使用2 NSArray秒,一个在另一个内.这很好用,但我的代码看起来很乱.

我也尝试在each-other(matrix[][])中使用C风格的数组,但这种方法不适合我的应用程序,因为我无法自动@synthesize@properties为它们指定.

我当然可以为此创建自己的类,但我想知道的是Objective-C是否已经为这种情况提供了一些东西.我做了一些谷歌研究,但没有找到任何东西.

objective-c matrix multidimensional-array

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

UITextField内部阴影

我想摆脱一个内心的阴影UITextField.

具有内部阴影的UITextField

我已经尝试将shadow-alpha设置为0但它不起作用:

name.layer.shadowOpacity = 0.0f;
Run Code Online (Sandbox Code Playgroud)

任何线索将不胜感激.

iphone cocoa-touch uitextfield ios

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

UITextField - 检测内置iPhone键盘上的输入?

[UITextFieldVariable成为FirstResponder]; 将键盘带到屏幕上.

如何检测用户键入键盘上的字母?每次按下按键我都想知道.

非常感谢提前!

iphone keyboard uitextfield ios

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

C#中LinkedList的大小

我正在将一个Java程序移植到C#.

在Java中获取LinkedList<T>我所做的大小:

int size = list.size();

但是,我在C#中找不到类似的方法.我知道链表的重点不是知道它的大小,但由于我将它用于缓冲区,所以在列表内部有一个计数器来返回它的大小是个好主意.

c# size linked-list

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

Ruby on Rails和MongoDB

我有一个新的Ruby on Rails安装,我可以看到默认的开始页面.

我按照本指南将MongoDB安装到Rails.

现在我在运行时遇到此错误rake test:

**Notice: C extension not loaded. This is required for optimum MongoDB Ruby driver performance.
  You can install the extension as follows:
  gem install bson_ext

  If you continue to receive this message after installing, make sure that the
  bson_ext gem is in your load path and that the bson_ext and mongo gems are of the same version.
Run Code Online (Sandbox Code Playgroud)

我已经安装了bson_ext gem,这意味着现在bson_ext不在我的加载路径中或者gems不是同一个版本.

负载路径在哪里?我该怎么改变它?如何检查宝石是否是同一版本?

ruby rubygems ruby-on-rails mongodb mongodb-ruby

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

UITmageView在UITableViewCell中

我正在尝试在UITableViewCell中显示UIImageView.

- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath我有内部方法:

- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
    static NSString *CellIdentifier = @"Cell";

    UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier];
    if (cell == nil) {
        cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellIdentifier];
    }


    CGSize cellSize = cell.frame.size;
    CGFloat cellWidth = cellSize.width;
    CGFloat cellHeight = cellSize.height;

    CGRect imageFrame = CGRectMake(0, 0, 70, cellHeight);
    UIImageView * image = [[UIImageView alloc] initWithFrame:imageFrame];
    [image setImage:[UIImage imageWithContentsOfFile:@"cyan.jpg"]];

    CGRect nameFrame = CGRectMake(80, 0, cellWidth-80, cellHeight/2);
    UILabel * nameLabel = [[UILabel alloc] initWithFrame:nameFrame]; …
Run Code Online (Sandbox Code Playgroud)

cocoa-touch objective-c uitableview uiimageview

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