为什么这个iPhone应用程序的“报价”按钮不是替换文本视图的lorem ipsum? [英] Why is this iPhone app's "quote" button not replacing the Text View's lorem ipsum?

查看:145
本文介绍了为什么这个iPhone应用程序的“报价”按钮不是替换文本视图的lorem ipsum?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在通过iPhone程序员介绍教程,在 http://www.raywenderlich.com/21320/objectively-speaking-a-crash-course-in-objective-c-ios6 ,我目前的项目是 http://JonathansCorner.com/project/Quotes.tgz 。本教程的重点是提供一个iPhone应用程序,当您点击一个按钮时,它随机显示文本视图中的几个引号之一。稍后,本教程将通过定义属性和存储和检索XML来进一步推动,但我是第一个让她的Rip!,它提供了在模拟器中运行该应用程序的第一个尝试,其中有一些增量的功能,这应该是当你点击一个按钮,随机拉出的报价出现。文本应该是只读的,只要使用键盘进行编辑。

I am working through the "iPhone introduction for programmers" tutorial at http://www.raywenderlich.com/21320/objectively-speaking-a-crash-course-in-objective-c-ios6, and my present project is at http://JonathansCorner.com/project/Quotes.tgz. The tutorial's focus is on providing an iPhone app that randomly displays one of several quotes in a Text View when you click on a Button. Later on the tutorial pushes further by defining properties and storing and retrieving XML, but I'm at the first "Let Her Rip!", which offers the first attempt running the app within the simulator with some increment of functionality, which should be that when you click a button, a randomly pulled quote appears. The text should be read-only as far as editing with the keyboard is concerned.

我目前观察到的行为是模拟器显示文本视图的本机lorem ipsum。它在单击按钮后继续这样做,当您单击文本视图时,它会拉起键盘并进行编辑。我检查了我的接线,我没有看到我没有复制教程共享的地方。 (本教程引用了一个ViewController。[h | m];这是一个问题,在创建项目之前的所有前提都有一个前缀,例如CJSHViewController.h?)它的行为就像人们期望从教程开始到这一点,但不要接线事件处理或关闭文本视图的编辑模式。

The behavior I am presently observing is that the simulator displays the Text View's native lorem ipsum. It continues to do so after clicking the button, and when you click on the Text View, it pulls up the keyboard and edits it. I've checked my wiring, and I don't see where I failed to duplicate what the tutorial shares. (The tutorial references a ViewController.[h|m]; is it a problem that I have a prefix before everything that takes a prefix when creating the project, e.g. CJSHViewController.h?) It behaves like one would expect from following the tutorial up to that point but not wiring event handling up or turning off edit mode for the Text View.

欢迎任何帮助或nit嘴。 (我是一个刚开始在iOS中的程序员,所以如果有程序员新的iOS开发错误,我可能已经做了至少一个。)

Any help or nitpicks would be welcome. (I am a programmer just beginning in iOS, so if there are "programmers new to iOS development" errors, I may have made at least one.)

谢谢,

推荐答案

您在文本视图中为更改文本而编写的功能正常工作。问题是你的IBOutlets。您从未将文本视图的出口链接到文本视图,因此当您将文本分配给它时,它没有去哪里。

The function you wrote for changing the text in the text view is working perfectly. The problem is with your IBOutlets. You never linked the outlet for the text view to the text view and consequently when you assign new text to it, it has no where to go.

这篇关于为什么这个iPhone应用程序的“报价”按钮不是替换文本视图的lorem ipsum?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆