小编Ham*_*aal的帖子

将NSInteger对象添加到NSMutableArray

我有一个NSMutableArray

@interface DetailViewController : UIViewController <UITableViewDelegate, UITableViewDataSource> {

NSMutableArray *reponses;
}
@property (nonatomic, retain) NSMutableArray *reponses;

@end
Run Code Online (Sandbox Code Playgroud)

我正在尝试添加我的数组NSInteger对象:

@synthesize reponses;



NSInteger val2 = [indexPath row];
[reponses addObject:[NSNumber numberWithInteger:val2]];
NSLog(@"the array is %@ and the value is %i",reponses, val2);
Run Code Online (Sandbox Code Playgroud)

如果没有将对象添加到数组中它将无法工作,这是控制台显示的内容:

the array is (null) and the value is 2
Run Code Online (Sandbox Code Playgroud)

iphone cocoa-touch objective-c nsmutablearray nsinteger

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

在基于导航控制器的应用的最终视图中隐藏或禁用后退按钮

我正在创建一个基于导航的应用程序,我想知道如何在我的上一个视图中禁用或隐藏后面的按钮.

cocoa-touch objective-c uinavigationbar uinavigationcontroller ios

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