Lonestarbbqgrill - Đừng bỏ lỡ bản tin hot, tin công nghệ siêu hot ngay hôm nay
  • Home
  • Âm Nhạc
  • Điện Thoại
  • Công Nghệ
  • Phần Mềm
  • Tổng Hợp
  • Giáo Dục
  • Khác
    • Tin Hot
    • Ẩm Thực
    • Game
    • Giải Trí
    • Phim
No Result
View All Result
  • Home
  • Âm Nhạc
  • Điện Thoại
  • Công Nghệ
  • Phần Mềm
  • Tổng Hợp
  • Giáo Dục
  • Khác
    • Tin Hot
    • Ẩm Thực
    • Game
    • Giải Trí
    • Phim
No Result
View All Result
Lonestarbbqgrill - Đừng bỏ lỡ bản tin hot, tin công nghệ siêu hot ngay hôm nay
No Result
View All Result

1/3 – Create a ViewController Using the .XIB File in Xcode Using Interface Builder and Xcode 5

admin by admin
May 10, 2020
in Game
17
1/3 – Create a ViewController Using the .XIB File in Xcode Using Interface Builder and Xcode 5



1/3 – Create a ViewController Using the .XIB File in Xcode Using Interface Builder and Xcode 5

Learn how to make a new screen for your iPhone app using the .xib (nib) file in Xcode 5 and with a little bit of code. You’ll learn how to set it all up, and it won’t be a mystery that leaves you wondering why your app doesn’t work like you expect.

Code:

I’ll show you how to setup your ViewController code so that it is connected to the .xib file and how to avoid a crash (nib but the view outlet was not set). If you forget to set the view outlet you’ll never be able to load the new screen.

You can use this workflow anytime you want to create a new UI interface outside of the storyboard file from code. It’ll give you more control when you want to control the flow of data between your ViewControllers in your iPhone apps.

Part 1:
Part 2:
Part 3:

Click here to Subscribe to learn how to make iPhone apps.

Links:
Blog:
iPhone Courses:

Contact:
YouTube Channel:
Twitter:
Facebook:
Google+:
Paul’s iPhone Apps:

Nguồn: https://lonestarbbqgrill.com

Xem thêm bài viết khác: https://lonestarbbqgrill.com/game/

Xem thêm Bài Viết:

  • Trò chơi điện tử có tốt cho trẻ em không?
  • Cổng game bài đổi thưởng chơi bắn cá ăn tiền thật uy tín
  • Quay slot xin xăm – Hướng dẫn cách chơi và cách tải game Rikvip
  • Nên ghi lô đề ở đâu? Cách ghi lô đề dễ ăn tiền nhất
  • Sảnh Thabet thể thao chính thức mở cửa cho người Việt Chơi
Previous Post

Hard Reset HUAWEI GR5 2017 PRO

Next Post

TOP smartphone giá rẻ pin 5.000 mAh - 6.000 mAh, màn hình lớn, dùng lâu dài...

Next Post
TOP smartphone giá rẻ pin 5.000 mAh – 6.000 mAh, màn hình lớn, dùng lâu dài…

TOP smartphone giá rẻ pin 5.000 mAh - 6.000 mAh, màn hình lớn, dùng lâu dài...

Comments 17

  1. furkan demirezen says:
    3 years ago

    You saved my day brother. Greetings from Turkey..

    Reply
  2. Camilo José Ortegón Barajas says:
    3 years ago

    Thanks for that. It's kind of tricky and you made it easy 🙂

    Reply
  3. pritesh poddar says:
    3 years ago

    Thanks..It is great.

    Reply
  4. sulu says:
    3 years ago

    Thanks for this! Take my like!

    Reply
  5. Дима Малыш says:
    3 years ago

    Thanks for the tutorial! For me, it worked:
    MyViewController *mvc = [[MyViewController alloc] initWithNibName:@"XIBname" bundle:nil];
    [self presentViewController: mvc animated:YES completion:nil];

    Without initWithNibName:, a black screen was displayed.

    Reply
  6. Rodrigo Santos says:
    3 years ago

    I would like to return to my first view controller by a simple "back" button at the "myViewController.xib". Can you please tell me how should I do it? I imported the "ViewController.h" library to the "myViewController.m" file but when I click the button I get a black screen at the app. Can you help me with that?

    Here are some code that I tried to put inside "myViewController.m" file:

    – (IBAction)backButtonPressed:(UIButton *)sender {
    ViewController *returnViewController = [[ViewController alloc] init];

    [self presentViewController:returnViewController animated:YES completion:nil];

    NSLog(@"Showing the Main Menu again!");
    }

    Reply
  7. Pokemon Gone sad says:
    3 years ago

    Sorry this way doesnt work for xcode 6.1

    Reply
  8. Serj Miskiv says:
    3 years ago

    Thnx a lot, man! U save my life! I thought that this exeption will never be fixed ^)

    Reply
  9. deyvidyo says:
    3 years ago

    I don't understand why we need two ViewController files ? Can you please tell me? 
    Can't we just use ViewController instead of MyViewController?

    Reply
  10. Sahan Serasinghe says:
    3 years ago

    Sub'd! Very precise and easy-to-follow tutorial!

    Reply
  11. Michael Martin says:
    3 years ago

    Another Waste of Time Tutorial.  I followed you tutorial 3 separate times.  I did everything as you showed it. But WTF it no workie!!  So, You are just like 90% of the other guys out there who writes tutorials for Xcode that simply do not work.  HEY BUT THANKS FOR WAISTING MY TIME!

    Reply
  12. Ashok Bhintade says:
    3 years ago

    Thanks Man it really works for me….

    Reply
  13. Jon Gatewood says:
    3 years ago

    Ok so i tested this again with Pauls code only instead of making an empty view and adding the class files i just created the class files with the xib file attached. Ran it and everything worked like a charm no black screen. I don't know if it makes a difference that I'm pushing my view from a UITable but its working. 

    if (indexPath.row == 0) {
            TestViewController *testViewController =[[TestViewController alloc] init];
            [self presentViewController:testViewController animated:YES completion:nil];
            
        }

    Reply
  14. Jon Gatewood says:
    3 years ago

    this does not work for iOS 7 just brings up a black screen like Elrin said. 

    Reply
  15. Jeff Ski Kinsey says:
    3 years ago

    I tried this but with a Page-Based App and get an error on:

    MyViewController *MyViewController = [[MyViewController alloc] init];

    Error: No visible @interface for 'MyViewController' declares the selector alloc

    Any suggestions?

    Reply
  16. Eirin Cordoba says:
    3 years ago

     I am trying to submit my very first app and I got a rejection mostly due to when my app is played on iPad it goes black but with audio. Reasons
    2.2: Apps that exhibit bugs will be rejected
    2.2

    We found that your app exhibited one or more bugs, when reviewed on iPad running iOS 7.1 and iPhone 5s running iOS 7.1, on both Wi-Fi and cellular networks, which is not in compliance with the App Store Review Guidelines.

    Your app loads to a black screen with no content.

    I checked my architecture and build codes and all checked for latest iOS or iOS 7.1 So I am wondering is make sure the iPad version of  MainWindow xib has connections just like the iPhone version.
    i.e.: that the root (window, controller, or view) is connected the same way. But when I look on my storyboard or supporting files etc, but I have no xib file. As this is my very first app, my knowledge is limited. So if you can think of any ideas that can help me I would greatly appreciate it.
     Thank you and great tutorials.
    Eirin

    Reply
  17. Glenn Sidney says:
    3 years ago

    Following this example, and presenting it using modalPresentationStyle = UIModalPresentationFormSheet, it doesn't inherit the size of the popup container, but only ever has 320 width. If I do it with a controller from my storyboard using instantiateViewControllerWithIdentifier, it will properly size itself on iPhone or iPad. How can I make this custom controller respond to the width of the popup?

    Reply

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Tin mới nhất

  • All
  • Tin Hot
Game

Trò chơi điện tử có tốt cho trẻ em không?

by rdom
December 2, 2022
Xem bóng đá thả ga cùng Cakhia 10 link hấp dẫn nhất
Thể Thao

Xem bóng đá thả ga cùng Cakhia 10 link hấp dẫn nhất

by ML S
November 18, 2022
Tủ giữ nóng thực phẩm có những loại nào? Giá bao nhiêu?
Kinh Doanh

Tủ giữ nóng thực phẩm có những loại nào? Giá bao nhiêu?

by admin
September 17, 2022
Game bắn cá đổi thưởng đang được nhiều cược thủ yêu thích
Game

Cổng game bài đổi thưởng chơi bắn cá ăn tiền thật uy tín

by admin
September 16, 2022
  • Chính Sách Bảo Mật
  • Home
  • Liên Hệ

© 2022 JNews - Premium WordPress news & magazine theme by Jegtheme.

No Result
View All Result
  • Home
  • Âm Nhạc
  • Điện Thoại
  • Công Nghệ
  • Phần Mềm
  • Tổng Hợp
  • Giáo Dục
  • Khác
    • Tin Hot
    • Ẩm Thực
    • Game
    • Giải Trí
    • Phim

© 2022 JNews - Premium WordPress news & magazine theme by Jegtheme.