iOS

[ iOS ] Entry Point (initial view controller)

Forest Yun 2024. 12. 25. 22:02
728x90

 

 

Entry Point

Entry Point๋Š” ์ง„์ž…์ ์ด๋ผ๋Š” ๋œป์œผ๋กœ, ํ•œ ์Šคํ† ๋ฆฌ๋ณด๋“œ์—์„œ ์‹œ์ž‘ scene์ด ๋˜๋Š” view controller๋ฅผ ์„ค์ •ํ•  ๋•Œ ์‚ฌ์šฉํ•ฉ๋‹ˆ๋‹ค. ์ฆ‰, ์—ฌ๋Ÿฌ view controller ์ค‘์—์„œ initial view controller๋ฅผ ์„ค์ •ํ•˜๋Š” ๊ฒƒ์ž…๋‹ˆ๋‹ค.
์•ฑ์€ ์—ฌ๋Ÿฌ ์Šคํ† ๋ฆฌ๋ณด๋“œ๋ฅผ ๊ฐ€์งˆ ์ˆ˜ ์žˆ๋Š”๋ฐ, ๊ฐ ์Šคํ† ๋ฆฌ๋ณด๋“œ๋Š” ์‹œ์ž‘ ํ™”๋ฉด์ด ๋  view controller๊ฐ€ ์ง€์ •๋˜์–ด ์žˆ์–ด์•ผ ํ•ฉ๋‹ˆ๋‹ค. ๊ทธ๋ ‡์ง€ ์•Š์œผ๋ฉด ์•ฑ ์‹คํ–‰ ์‹œ ์˜ค๋ฅ˜๊ฐ€ ๋ฐœ์ƒํ•ฉ๋‹ˆ๋‹ค.



EntryPoint ๋ฏธ์„ค์ • ์˜ค๋ฅ˜

Failed to instantiate the default view controller for UIMainStoryboardFile 'Main' - perhaps the designated entry point is not set? 
UIMainStoryboardFile์ธ ‘Main’์—์„œ ๊ธฐ๋ณธ view controller๋ฅผ ์ธ์Šคํ„ด์Šคํ™”ํ•˜๋Š” ๋ฐ ์‹คํŒจํ–ˆ์Šต๋‹ˆ๋‹ค. - ์•„๋งˆ๋„ ์ง„์ž…์ ์ด ์„ค์ •๋˜์ง€ ์•Š์•˜์„ ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค.

 

์Šคํ† ๋ฆฌ๋ณด๋“œ๋ฅผ ํ†ตํ•ด view controller๋ฅผ ์ •์˜ํ•˜๊ณ , ์•ฑ์ด ์‹คํ–‰๋  ๋•Œ ํ•ด๋‹น view controller๋ฅผ ํ™”๋ฉด์— ํ‘œ์‹œํ•˜๊ธฐ ์œ„ํ•ด ๊ฐ์ฒด๋กœ ์ƒ์„ฑํ•ด์•ผํ•ฉ๋‹ˆ๋‹ค. ํ•˜์ง€๋งŒ initial view controller value๋กœ ์•„๋ฌด ๊ฒƒ๋„ ์„ค์ •ํ•˜์ง€ ์•Š์œผ๋ฉด, ์‹ค์ œ ํ™”๋ฉด์— ๋„์šธ view controller๋ฅผ ์ฐพ์ง€ ๋ชปํ•ด ๋ฉ”๋ชจ๋ฆฌ์— ๋กœ๋“œํ•  ์ˆ˜ ์—†์–ด ๋นŒ๋“œ๋ฅผ ์‹คํŒจํ•˜๊ฒŒ ๋ฉ๋‹ˆ๋‹ค. ์ฆ‰ ์ธ์Šคํ„ด์Šคํ™”(instantiate)์— ์‹คํŒจํ–ˆ๊ธฐ ๋•Œ๋ฌธ์— ์œ„์™€ ๊ฐ™์€ ์˜ค๋ฅ˜ ๋ฉ”์‹œ์ง€๊ฐ€ ์ „๋‹ฌ๋˜๊ฒŒ ๋ฉ๋‹ˆ๋‹ค.

 

 

 

EntryPoint ์ง€์ •ํ•˜๊ธฐ

ํŠน์ • view controller๋ฅผ initial view controller value๋กœ ํ• ๋‹นํ•˜๋Š” ๋ฐฉ๋ฒ•์€ ์ด ๋‘ ๊ฐ€์ง€๊ฐ€ ์žˆ์Šต๋‹ˆ๋‹ค.

  • ์ฒซ ๋ฒˆ์งธ ๋ฐฉ๋ฒ•์€ ์Šคํ† ๋ฆฌ๋ณด๋“œ์—์„œ view controller์— ๋ถ™์–ด์žˆ๋Š” ์ž‘์€ ๊ฐ€๋กœ ํ™”์‚ดํ‘œ๋ฅผ ์ด๋™ํ•˜๋Š” ๋ฐฉ๋ฒ•์ด ์žˆ๊ณ ,
  • ๋‘ ๋ฒˆ์งธ ๋ฐฉ๋ฒ•์€ ์›ํ•˜๋Š” view controller์˜ ์†์„ฑ ์ธ์ŠคํŽ™ํ„ฐ(Attributes Inspector)์—์„œ Is Initial Controller ์ฒดํฌ๋ฐ•์Šค๋ฅผ ์„ ํƒํ•ด ์Šคํ† ๋ฆฌ๋ณด๋“œ์˜ Entry Point๋กœ์„œ scene์„ ์„ค์ •ํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค.

์†์„ฑ ์ธ์ŠคํŽ™ํ„ฐ๋ฅผ ํ†ตํ•ด EntryPoint, ์ฆ‰ initial view cantroller๋ฅผ ์ง€์ •ํ•˜๋Š” ์ฒดํฌ๋ฐ•์Šค ์•ˆ๋‚ด ์‚ฌ์ง„
์†์„ฑ ์ธ์ŠคํŽ™ํ„ฐ๋ฅผ ํ†ตํ•ด initial view controller๋ฅผ ์„ค์ •ํ•˜๋Š” ๋ฐฉ๋ฒ•

 

 

 

 

Create a list view | Apple Developer Document
728x90