basically im making a springboard tweak and ive got a textfield with keyboard, when i click done on the keyboard i would like the keyboard to dismiss, ive tried
- (BOOL)textFieldShouldReturn:(UITextField *)textField {
[textField resignFirstResponder];
return YES;
}
-but i just get loads of errors when trying to compile ;L, any help would be appreciated lots
Here's the error
'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/l开发者_运维问答ib/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
first set the delegate of textfield
in viewDidLoad
like this..
self.textfield.delegate=self;
and then use this method.
-(BOOL)textFieldShouldReturn:(UITextField *)textField
{
[textField resignFirstResponder];
return YES;
}
- (BOOL)textFieldShouldReturn:(UITextField *)textField {
[textField resignFirstResponder];
return YES;
}
This should do it if you have set the delegate
for the textField
in the view controller.
精彩评论