星期四, 12月 29, 2016

[Objective-C] 剛轉入寫iOS Objective的一些簡單筆記~

記錄一下菜到不行的初學者(我本人XD)Objective-C 寫的筆記

變數宣告strong跟weak


用segue轉到另一個view如何退上去的方法

[self dismissViewControllerAnimated:true completion:nil];


用Navigation控制轉viewController

By using below line we can go to parent view controller

[self.navigationController popViewControllerAnimated:YES];


By using below line we can move to main/root view controller

[self.navigationController popToRootViewControllerAnimated:YES];


By using below line we can move to any view controller

[self.navigationController popToViewController:viewControllerObject animated:YES];


UIthread不同步的處理方法


dispatch_async(dispatch_get_main_queue(), ^{

[self.accessTokenText setText:userAccessToken];

[self.refreshTokenText setText:userRefreshToken];

});
                                                          

UIAlertView iOS9 停用後請改用UIAlertController

UIAlertController *alertController = [UIAlertController alertControllerWithTitle:@"Title" message:@"Message" preferredStyle:UIAlertControllerStyleAlert]; UIAlertAction* ok = [UIAlertAction actionWithTitle:@"OK" style:UIAlertActionStyleDefault handler:nil]; [alertController addAction:ok]; [self presentViewController:alertController animated:YES completion:nil];


沒有留言:

張貼留言

留個話吧:)

其他你感興趣的文章

Related Posts with Thumbnails