小编Lua*_*awi的帖子

Xcode:如何显示GPS强度值?

我试图获得GPS强度值,以显示信号是强还是弱.有谁知道如何获得价值.

提前致谢.

iphone xcode gps ios

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

如何创建最小8,最大16,字母,数字和无空格的正则表达式

我试图在iOS中检查带有正则表达式的文本,这是我的代码.我的正则表达式接受一个单词或数字,它应该是最小值8和最大值16,用数字或字母表示.

if (![self validate:txtPass.text regex:@"^[a-zA-Z0-9]+$"]){

   NSLOG(@"Check value");
}
Run Code Online (Sandbox Code Playgroud)

我的正则表达式应该改变什么?

regex

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

在一个UITableView问题中调用两个不同的自定义单元格

我创建了一个自定义单元格FeatureCell,它在行中有5个图像将在主视图中调用,但是当我调用它时,我得到空行.那么请问哪里可能是我的问题?

我已经搜索了自定义单元格,我使用了我在下面的代码中使用的方式但没有任何反应.

这是我的FeatureCell.h

@interface FeatureCell : UITableViewCell{

  IBOutlet UIImageView *img1;
  IBOutlet UIImageView *img2;
}

@property (nonatomic, retain) UIImageView *img1;
@property (nonatomic, retain) UIImageView *img2;
@end
Run Code Online (Sandbox Code Playgroud)

这是我的FeatureCell.m

@implementation FeatureCell

@synthesize img,img1,img2,img3,img4;
@end
Run Code Online (Sandbox Code Playgroud)

这是我的视图控制器.m

- (NSInteger) numberOfSectionsInTableView:(UITableView *)tableView{

return 2;
}

- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section{

if (section == 0) {
    return [objectCollection count];
}
else{
    return 1;
   }
}    

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

static NSString* cellIdentifier1 = @"FeatureCell";

FeatureCell *cell1 = (FeatureCell*)[tableView dequeueReusableCellWithIdentifier:cellIdentifier1];


if (cell1 == nil)
{
    NSArray …
Run Code Online (Sandbox Code Playgroud)

iphone uitableview custom-cell ios

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

大写所有字符串根据Locale - Swift

我试图根据'Locale'大写所有字符串,但它不起作用.

var text = "istanbul, izmir"

println(text.uppercaseStringWithLocale(NSLocale.currentLocale())) 
Run Code Online (Sandbox Code Playgroud)

在土耳其语中,我的大写是不是我.我的结果是伊斯坦布尔,IZMIR但它应该返回İSTANBUL,İZMİR.

请问我的问题在哪里?

ios nslocale swift

5
推荐指数
2
解决办法
3367
查看次数

带有IF语句问题的NSNumber

我正在从服务器加载数据,但我有一个问题,我返回的值是零(0),而我不能进去,如果.请问哪里会有问题?

-(void)method1
{
     NSNumber *value = [data objectForKey:@"samount"];
     NSLog(@"number is -%@-", value); //number is -0-
     if (value == 0)
     {
          NSLog(@" OK :) ");
     }
     else 
     {
          NSLog(@"  Bad :( ");
     }
}
Run Code Online (Sandbox Code Playgroud)

objective-c nsnumber ios

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

标签 统计

ios ×4

iphone ×2

custom-cell ×1

gps ×1

nslocale ×1

nsnumber ×1

objective-c ×1

regex ×1

swift ×1

uitableview ×1

xcode ×1