小编Ale*_*nko的帖子

如何用C++流输出小数点后的3位数?

给定一个浮点类型的变量,如何在小数点后输出3位数,在C++中使用iostream?

c++ floating-point iostream

14
推荐指数
3
解决办法
4万
查看次数

如何使用背景隐藏数字键盘?

我使用本书学习iOS SDK ,在4章中,当它告诉你如何用背景音标隐藏数字键盘时我遇到了问题.我这样做的作者说,但什么也没发生.我怎么能这样做?什么书的作者说:

1)在ViewController.h中创建新方法backgroundTap

- (IBAction)touchBackground:(id)sender;
Run Code Online (Sandbox Code Playgroud)

2)在ViewController.m中添加方法

-(void)touchBackground:(id)sender{
[nameField resignFirstResponder];
[numberField resignFirstResponder];}
Run Code Online (Sandbox Code Playgroud)

3)从UIView到UIControl,在Interface Builder中更改View对象的类标识(我在Xcode 4中了解它的控件)

4)使用文件所有者连接事件列表中的TouchDown方法并检查方法backgroundTap.

这是我的代码示例

PS我很抱歉我的英语,我把书中的所有信息翻译成英文,因为我有俄语翻译.

xcode ios numpad

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

为什么我需要在iOs中使用[super%methodname%]?

我是Objective-C的新手,不明白为什么我们需要使用[super dealloc],[super viewDidLoad][super viewWillAppear:animated].当我创建示例代码应用程序时,我看到这样的事情:

- (void)viewWillAppear:(BOOL)animated
{
[super viewWillAppear:animated];
}

- (void)viewDidAppear:(BOOL)animated
{
[super viewDidAppear:animated];
}

- (void)viewWillDisappear:(BOOL)animated
{
[super viewWillDisappear:animated];
}

 - (void)viewDidDisappear:(BOOL)animated
{
    [super viewDidDisappear:animated];
}
Run Code Online (Sandbox Code Playgroud)

实际上Xcode 4总是为每个自动生成的方法添加超级方法.为什么?

或者当我使用dealloc方法时.为什么我需要在最后添加[super dealloc]?

- (void)dealloc
{
 [nameField release];
 [numberField release];
 [sliderLabel release];
 [super dealloc];
}
Run Code Online (Sandbox Code Playgroud)

PS现在我研究"开始iPhone 4开发".并且没有找到关于此方法的任何参考:(

xcode objective-c ios

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

标签 统计

ios ×2

xcode ×2

c++ ×1

floating-point ×1

iostream ×1

numpad ×1

objective-c ×1