开发者

Ultra simple iPhone App Doesnt Display a Label - why?

I have just done a tutorial for a Hello World iPhone App.

It doesn't work :-(

Here's what I did:

  • Create a view based application called HelloWorld
  • Drag a Label onto HelloWorldViewConroiller.xib that says "Hello World"
  • Click Build and Run

According to the book I am reading, I should see the label's text on screen. Instead I see a gray screen with nothing.

What am I missing?

Note: I tri开发者_开发问答ed this using a Window based application and that didn't work either - blank screen.


What an idiot - you need to save the View first. Pressing Build and Run does not actually save the View. I am coming from a Visual Studio environment where such things don't happen.


Hi Build and run will only use saved files to guild and display your programe. However IB (the program in which you drag and connect your label) is/was separate from XCode and it gets confused about what is and what isn't saved already.

-make sure to save your interface in IB before you run
-make sure that your label has text in it
-make sure you are editing the write file (close IB and open your .xib file again)

do not worry, everybody was there at some point

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜