小编She*_*lam的帖子

如何在Eclipse中获取"属性"选项卡?

我不小心关闭了Eclipse中的Properties选项卡.我需要这个来做一些布局编辑.我怎样才能找回来?

eclipse

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

优化自定义UITableViewCell创建

我有以下代码,只是创建一个自定义UITableViewCell.我正在创建一个动态行高,那贵吗?有什么方法可以优化吗?

我也在cellForRow中调整我的一个标签的框架.有没有办法优化它?

- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath
{
    MessageCell *cell = (MessageCell*)[self tableView:tableView cellForRowAtIndexPath:indexPath];
    return cell.bodyLabel.bounds.size.height + 30;
}
// Customize the appearance of table view cells.
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
    static NSString *CellIdentifier = @"MessageCell";

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

    cell.usernameLabel.text = [[items objectAtIndex:indexPath.row]valueForKey:@"user_login"];
    cell.bodyLabel.text = [[[items objectAtIndex:indexPath.row]valueForKey:@"body"]gtm_stringByUnescapingFromHTML];
    [Utils alignLabelWithTop:cell.bodyLabel];
    cell.dateLabel.text = [Utils toShortTimeIntervalStringFromStockTwits:[[items objectAtIndex:indexPath.row]valueForKey:@"created_at"]]; 
    [cell.avatarImageView reloadWithUrl:[[items objectAtIndex:indexPath.row]valueForKey:@"avatar_url"]];

    return cell;
}
Run Code Online (Sandbox Code Playgroud)

iphone objective-c uitableview ios

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

UIScrollView无法在IB中工作

我有一个UIScrollView里面包含一个UIView.

UIScrollView启用了分页,为320x500

UIView是320x480

我的UIView不会在模拟器或设备上滚动.我究竟做错了什么?

iphone xcode objective-c interface-builder uiscrollview

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

如何在UITableView的位置显示空视图?

我有一个UITableViewController.设置某个BOOL时,我想显示另一个视图而不是UITableView.我怎样才能做到这一点?我还需要能够将UITableView带回来.

iphone cocoa-touch objective-c uitableview uiview

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


jQuery单击事件覆盖彼此

我有以下jQuery:

$('.io-sidebar-section').click(function () {
      console.log('Section Clicked');
      $(this).next().fadeToggle('fast',function(){});
    });

    $('.io-sidebar-section-advanced-toggle').click(function(){
      $(this).parent().next().children('.io-sidebar-link-advanced').fadeToggle('fast',function(){});
    });
Run Code Online (Sandbox Code Playgroud)

高级切换在侧栏部分内.当我单击高级切换时,它会执行侧边栏部分单击.

我怎么能将这两个分开?

javascript jquery

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

Twitter应用程序 - OAuth还是经典登录?

我正在构建一个当前使用经典登录而不是OAuth的Twitter应用程序.Twitter是否有任何弃用此计划的计划?我选择不做OAuth,因为它仍然作为测试版进行试用.

twitter login oauth deprecated

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

如何管理多个异步NSURLConnection委托?

我有一个类,它创建多个异步连接,其中每个连接在委托方法中执行自己的逻辑.

因为委托本身就是类,所以如何在NSURLConnection委托方法中的逻辑中实现这种分离?

iphone cocoa cocoa-touch objective-c nsurlconnection

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

复制NSMutableArray时出现问题

我想将一个数组复制到另一个数组:

NSMutableArray *itemsCopy = [[NSMutableArray alloc] initWithArray:self.items copyItems:YES];
Run Code Online (Sandbox Code Playgroud)

但我得到错误:

*** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[Item copyWithZone:]: unrecognized selector sent to instance 0x5a74900'
*** Call stack at first throw:
(
    0   CoreFoundation                      0x025afc99 __exceptionPreprocess + 185
    1   libobjc.A.dylib                     0x026fd5de objc_exception_throw + 47
    2   CoreFoundation                      0x025b17ab -[NSObject(NSObject) doesNotRecognizeSelector:] + 187
    3   CoreFoundation                      0x02521496 ___forwarding___ + 966
    4   CoreFoundation                      0x02521052 _CF_forwarding_prep_0 + 50
    5   CoreFoundation                      0x025108fa -[NSObject(NSObject) copy] + 42
    6   CoreFoundation                      0x025ab732 -[NSArray initWithArray:range:copyItems:] + 290
    7   CoreFoundation …
Run Code Online (Sandbox Code Playgroud)

arrays iphone cocoa cocoa-touch objective-c

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

将NSString转换为NSInteger

如果我有:

NSString* number = @"2000";
Run Code Online (Sandbox Code Playgroud)

NSInteger integerNumber = [number integerValue];

等于2000的整数表示?

iphone cocoa cocoa-touch objective-c nsstring

0
推荐指数
2
解决办法
1195
查看次数