Result:
Apple iOS 5.1
Reference: http://stackoverflow.com/questions/1387440/how-to-join-nsarray-elements-into-an-nsstring
- (void)viewDidLoad {
[self.textField becomeFirstResponder];
[super viewDidLoad];
}
- (void)enableKeyboard {
[self.textField becomeFirstResponder];
}
- (void)viewDidLoad {
[self performSelector:@selector(enableKeyboard) withObject:nil afterDelay:.3];
[super viewDidLoad];
}
-(void) instanceMethod:(NSString *)param; +(void) classMethod:(NSString *)param;
object.methodName(params);
@interface MyClass : NSObject {
}
@interface MyViewController : UIViewController {
}
[tfInput becomeFirstResponder];
[tfInput resignFirstResponder];
// 宣告array NSMutableArray *words = [NSMutableArray array]; // 宣告dictionary NSDictionary *dict = [NSDictionary dictionaryWithObjectsAndKeys: @"Title 01", @"title", @"Explain 01", @"explain", nil]; // 將dict新增至array裡 [words addObject:dict]; // print出dict中所有資料 for (id key in dict) NSLog(@"key: %@ value: %@", key, [dict objectForKey:key]); // print出Array中所有資料 for (NSInteger i=0; i < [words count]; i++) NSLog(@"%@", [words objectAtIndex:i]); // print Array有幾筆資料 NSLog(@"Words count : %i", [words count]);Result
[NSTimer
scheduledTimerWithTimeInterval:2
target:self
selector:@selector(doSomething)
userInfo:nil
repeats:NO];