小编sen*_*thu的帖子

正确的TableView中的indexPath.row选择有多个部分?

我有多个部分的tableview.每个部分有不同的行.当我在特定部分中选择特定行时,如何找到正确的indexPath.row?任何教程?

iphone

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

如何在IPhone SDK中计算cos,sin,tan?

你如何计算iPhone SDK中的cos,sin,tan三角函数?

我尝试了tan(45),但它返回了错误的输出?任何帮助?

iphone

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

UIBarbuttonItem不在工具栏的右侧?

我在我的视图控制器视图中有代码像这样加载..但UIBarButtonItem不在工具栏的右侧.它在左侧.任何帮助?如何给工具栏的标题?

UIToolbar *toolbar = [UIToolbar new];
toolbar.barStyle = UIBarStyleBlackTranslucent;

// create a bordered style button with custom title
UIBarButtonItem *playItem = [[[UIBarButtonItem alloc] initWithTitle:@"Play" 
            style:UIBarButtonItemStyleBordered  
            target:self
            action:@selector(flipToSchedules:)] autorelease];
self.navigationItem.rightBarButtonItem = playItem;
NSArray *items = [NSArray arrayWithObjects: playItem,  nil];
toolbar.items = items;

// size up the toolbar and set its frame
// please not that it will work only for views without Navigation toolbars. 
[toolbar sizeToFit];
CGFloat toolbarHeight = [toolbar frame].size.height;
CGRect mainViewBounds = self.view.bounds;

[toolbar setFrame:CGRectMake(0, 20, 
             CGRectGetWidth(mainViewBounds), toolbarHeight)];
[self.view …
Run Code Online (Sandbox Code Playgroud)

iphone

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

UITableview单元格值反复写入一次又一次的问题?

当我滚动时,我的tableview显示这样......你会帮助我做错了吗?请问有什么帮助吗?如果你看到那张图片,我选择的价值超过了写作........

http://www.freeimagehosting.net/image.php?fa76ce6c3b.jpg

代码是

  • (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] autorelease];
    cell.textLabel.font = [UIFont boldSystemFontOfSize:14.0];
    cell.accessoryType = UITableViewCellAccessoryDisclosureIndicator;
}




CGRect rectLbl2 = CGRectMake(75 ,1, 215, 32);
CGRect rectLbl3 = CGRectMake(75 ,28, 215, 30);
addLabel2= [[UILabel alloc] initWithFrame:rectLbl2];
addLabel3= [[UILabel alloc] initWithFrame:rectLbl3];



addLabel2.text = @"senthil";
[cell addSubview:addLabel2];
[addLabel2 release]; // for memory release


addLabel3.text= @"senthil";
[cell addSubview:addLabel3];
[addLabel3 release];


return cell;
Run Code Online (Sandbox Code Playgroud)

}

iphone

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

如何从NSDateComponents获得正确的秒数?

我从NSDateComponents获得第二名.但它返回长数,我怎么能得到正确的第二个......?例如55秒...(就像123232133那样)

     NSCalendar *sCalendar = [NSCalendar currentCalendar];


    unsigned int unitFlags = NSHourCalendarUnit | NSMinuteCalendarUnit |     
   NSDayCalendarUnit | NSMonthCalendarUnit;

 NSDateComponents *Info = [sCalendar components:unitFlags 
  fromDate:date1  toDate:date2  options:0];

   NSLog(@" %dsec ",[Info second]);
Run Code Online (Sandbox Code Playgroud)

它打印像2323324324 ....

iphone

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

接口方向委托方法之间有什么区别

任何人都可以分辨出willRotateToInterfaceOrientation,willAnimateRotationToInterfaceOrientation,didRotateFromInterfaceOrientation之间的差异,

iphone

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

如何使用双引号将NSString初始化为文本

我想初始化NSString是双haoutes的"hai"..它可能吗?有什么帮助吗?但是NSString*str = @"hai"; 我想在没有直接初始化的情况下将其转换为"hai"?有什么帮助吗?

cocoa-touch objective-c ios

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

双点内存分配

char**r; r =(char**)malloc(10);

上面的分配是否足够?我不需要为char循环分配for循环吗?任何可以解释哪一个是正确的?

c pointers

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

UIPinchGestureRecognizer问题

我正在使用UIPinchGestureRecognizer.can我写了两个用于捏合和捏合的动作..是否有任何特定的方法(委托)?我只写了一个当我捏入时被调用...

  UIPinchGestureRecognizer *pinchGesture = [[UIPinchGestureRecognizer alloc] initWithTarget:self action:@selector(handlePinchGesture:)];
[self.view addGestureRecognizer:pinchGesture]; 
[pinchGesture release];
Run Code Online (Sandbox Code Playgroud)

iphone ipad uigesturerecognizer

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

隐式声明函数NSMinX

错误"函数NSMinX的隐式声明"出现在我的项目中?

iphone ipad

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