小编Ank*_*han的帖子

如何检查数组是否为空/空?

我有int没有元素的数组,我试图检查它是否为空.

例如,为什么下面代码中的if语句永远不会成立?

int[] k = new int[3];

if(k==null)
{
    System.out.println(k.length);
}
Run Code Online (Sandbox Code Playgroud)

java arrays

120
推荐指数
4
解决办法
54万
查看次数

后增量(i ++)和预增量(++ i)运算符如何在Java中工作?

你能解释一下这个Java代码的输出吗?

int a=5,i;

i=++a + ++a + a++;
i=a++ + ++a + ++a;
a=++a + ++a + a++;

System.out.println(a);
System.out.println(i);
Run Code Online (Sandbox Code Playgroud)

两种情况下的输出均为20

java pre-increment post-increment

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

Java中是否有类似sizeof的方法?

Java中是否有任何内置方法可以找到任何数据类型的大小?有没有办法找到大小?

java

72
推荐指数
6
解决办法
10万
查看次数

你可以以编程方式更改UITableView创建后的样式吗?

(这是以编程方式交换现有tableview的样式而不是以编程方式设置表视图样式)

我有一种情况,我在一个视图中使用分组表视图这个表是可编辑的,每当它进入可编辑视图时它就会被取代,所以我认为只要它进入编辑模式就将它的样式改为plain.

这可能吗?(提前致谢.)

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

static NSString *MyIdentifier = @"MyIdentifier";
MyIdentifier = [NSString stringWithFormat:@"Cell %d",indexPath.row];


 // MyIdentifier =@"tblCellView";
    NSString *offendersImagePath = [self applicationDocumentsDirectory];
    //NSLog(@"%@", dbPath);
    offendersImagePath=[offendersImagePath stringByAppendingPathComponent:@"Images"];


CustomCell *cell = (CustomCell *)[tableView dequeueReusableCellWithIdentifier:MyIdentifier];
if(cell == nil) {
    [[NSBundle mainBundle] loadNibNamed:@"CustomCell" owner:self options:nil];
    cell = aCustomCell;
    aCustomCell=nil;
}
Run Code Online (Sandbox Code Playgroud)

iphone uitableview

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

改变iPhone应用程序中的开关颜色

UISwitch在iOS 3中使用在我的应用程序中制作一个开关元素.它的默认颜色设置为蓝色,但我想将其颜色更改为棕色(除了一些讨厌的谣言之外,没有通过谷歌获得线索).

如何为UISwitchiOS 3中的元素选择不同的颜色?

iphone uiswitch

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

uiwebkit错误101

我有一个搜索框,其中包含希伯来语和英语的关键字,并在维基百科中搜索相应的关键字.

如果我输入英文,它运作良好,但当我输入希伯来语时,它显示此错误:

当我输入希伯来语关键字url看起来像

http://he.wikipedia.org/w/index.php?title=%D7%9E%D7%99%D7%95%D7%97%D7%93%3A%D7%97%D7%99%D7 %A4%D7%95%D7%A9&search =\u05db\u05db\u05db\u05db

当我输入英文关键字url看起来像

http://he.wikipedia.org/w/index.php?title=%D7%9E%D7%99%D7%95%D7%97%D7%93%3A%D7%97%D7%99%D7 %A4%D7%95%D7%A9和搜索= iPhone

哪个映射到:

Error Domain = WebKitErrorDomain Code = 101 UserInfo = 0xf6e950"无法完成操作.(WebKitErrorDomain错误101.)"

是否有任何编码技术应该用于编码URL ???

请赐教这个!!!!!!

提前致谢

iphone webkit

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

如何连接到另一台服务器上的数据库

我可以在服务器A上安装我的php脚本并连接到服务器B上的MySQL数据库吗?

如果是的话,怎么做?提前致谢

php mysql database amazon-web-services

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

适用于iPhone应用的移动OCR引擎

我正在开发一个应用程序,我必须使用OCR引擎,请你帮我选择最好的一个.我必须从图像中提取文本.

我听说过abby.它是最好的?????

建议是否有其他选择

Thnx提前

iphone ocr

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

无法在java中完成此任务

任何人都可以解释为什么会发生这种情况

int i=0;
i=i++;
i=i++;
i=i++;
System.out.println(i);
Run Code Online (Sandbox Code Playgroud)

它打印为零.

java

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

iphone:使用ASIFormDataRequest将图像上传到服务器

我必须将图像上传到服务器,我使用NSMutableURLRequest像这样编写代码

NSString *boundary = [NSString stringWithString:@"---------------------------14737809831466499882746641449"];
    NSString *contentType = [NSString stringWithFormat:@"multipart/form-data; boundary=%@",boundary];
    [request addValue:contentType forHTTPHeaderField: @"Content-Type"];
//  
//  /*
//   now lets create the body of the post
//   */
    NSMutableData *body = [NSMutableData data];
    [body appendData:[[NSString stringWithFormat:@"\r\n--%@\r\n",boundary] dataUsingEncoding:NSUTF8StringEncoding]];    
    [body appendData:[[NSString stringWithFormat:@"Content-Disposition: form-data; name=\"userfile\"; filename=\"ipodfile%@.jpg\"\r\n",self.fileID] dataUsingEncoding:NSUTF8StringEncoding]];
    [body appendData:[[NSString stringWithString:@"Content-Type: application/octet-stream\r\n\r\n"] dataUsingEncoding:NSUTF8StringEncoding]];
    [body appendData:[NSData dataWithData:imageData]];
    [body appendData:[[NSString stringWithFormat:@"\r\n--%@--\r\n",boundary] dataUsingEncoding:NSUTF8StringEncoding]];
Run Code Online (Sandbox Code Playgroud)

我想我的PHP脚本响应对应这个并且工作正常

我怎样才能在ASIFormDataRequest中复制上面的内容?

试图这样做

ASIFormDataRequest* request = [ASIFormDataRequest requestWithURL: 
                               [NSURL URLWithString:photoUploadURLString]]; 


NSString *boundary = [NSString stringWithString:@"---------------------------14737809831466499882746641449"];
    NSString *contentType = [NSString stringWithFormat:@"multipart/form-data; boundary=%@",boundary];
    [request …
Run Code Online (Sandbox Code Playgroud)

iphone asihttprequest

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