跳板解除键盘

时间:2011-07-25 10:31:54

标签: iphone mobile springboard

基本上我正在做一个跳板调整,我有一个带键盘的文本字段,当我在键盘上点击完成我希望键盘解雇,我试过

- (BOOL)textFieldShouldReturn:(UITextField *)textField {
[textField resignFirstResponder];
return YES;
}

- 但是我在尝试编译时遇到了很多错误; L,任何帮助都会被赞赏很多

这是错误

'Mahmood1s-Mac:sbhomesearch mahmood1$ makeBootstrapping CydiaSubstrate...
Compiling iPhoneOS CydiaSubstrate stub... default target? failed, forcing 2.0?
Compiling native CydiaSubstrate stub...
cp: /Users/mahmood1/sbhomesearch/theos/lib/libsubstrate.dylib: Permission denied
Generating substrate.h header...
/Users/mahmood1/sbhomesearch/theos/bin/bootstrap.sh: line 103:
/Users/mahmood1/sbhomesearch/theos/include/substrate.h: Permission denied
Making all for tweak SBHomeSearch...
Preprocessing Tweak.xm...
Compiling Tweak.xm...
Tweak.xm:5:23: error: substrate.h: No such file or directory
Tweak.xm: In function ‘void _logosLocalInit()’:
Tweak.xm:22: error: ‘MSHookMessageEx’ was not declared in this scope
make[2]: *** [obj/Tweak.xm.o] Error 1
make[1]: *** [internal-library-all_] Error 2
make: *** [SBHomeSearch.all.tweak.variables] Error 2

2 个答案:

答案 0 :(得分:0)

首先在textfield中设置viewDidLoad的代表,就像这样......

self.textfield.delegate=self;

然后使用此方法。

-(BOOL)textFieldShouldReturn:(UITextField *)textField
   {

    [textField resignFirstResponder];
    return YES;
   }

答案 1 :(得分:0)

- (BOOL)textFieldShouldReturn:(UITextField *)textField {
[textField resignFirstResponder];
return YES;
}

如果您在视图控制器中为delegate设置了textField,则应该这样做。