Why is this iPhone app's "quote" button not replacing the Text View's lorem ipsum? - iphone

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.
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.
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.)
Thank you,

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.

Ok checked your project and found the error:
The problem is that quoteText is not referenced on the storyboard file so...
Go to your .storyboard file and drag the + symbol from the Connections Inspector to the view controller as shown on the screenshot when you click up a context menu should appear with the following options
quoteText
view
Of course you click on quoteText
Hope this helps

Related

NSTextView won't support redo and undo in Cocoa app

I searched this topic and never was able to find any answers to this.
When I make a new project in Xcode and I place a NSTextView as part of an
NSScrollView in my app, everything works fine as it should. The only thing is undo and redo won't work. It just does the funk noise
Copy, Cut, Paste all work as expected tho.
I get the same result if I do an app from scratch (no Storyboard) and code it in. Still undo and redo doesn't work?
Anyone knows what is the deal with this?
When you create a Cocoa app project that doesn't use the document architecture and add a text view, the text view does not allow undo initially.
Select the Allows Undo checkbox in the attributes inspector to turn on undo support.
One more thing. When you add a text view to a storyboard or xib file, the text view includes its own scroll view. You don't have to place the text view inside a scroll view.

segue code crashes after all tasks are done?

I am doing this for an online class. The code seems to be the same as the instructor’s, which is working in their video. Yet, every time I run it, it updates the text field in the second view controller, then crashes. All this app is supposed to do is take an input in the text box on the first screen and display it in the label on the second screen after the user presses the “button” button.
Here’s the link to the entire file (it’s a very simple program).
https://drive.google.com/open?id=1Cn2OD18vdy7OoQ6bRWjK-Fq2MPaMVc1v
You have attached something and removed it from viewcontroller. That's why storyboard was looking for reference of it. You have to remove that reference from storyboard also, Please have a look in this screenshot. Remove warning sign variable and run your application.

iOS - UIPickerView Dismiss with button or without a button?

Good Afternoon/Evening/Morning Folks,
I recently encountered a discussion with another developer on dismissing a UIPickerView. We work on a legacy enterprise application that had a lot of issues and was written very poorly (among other things). Since then, we revamped and fixed a lot of bugs with this program, strictly adhering to Apple's Human Interface Guidelines as much as possible while keeping to original requirements.
We seem to have a difference in opinion as Human Interface Guidelines do not really go into any detail about picker views. We implemented our new UIPickerView with a "Done," Button to confirm a selected value to be placed in a UITextField. Screen's input would be locked until they selected a value or clicked done.
Legacy application prior to our changes allowed users to utilize a done button but also by way of tapping a value selected in a picker. In addition, legacy application would also show selected UIPickerView value in UITextField prior to selection, wiping out original contents , if any was selected prior to opening a UIPickerView.
So, What is correct way to implement a UIPickerView per common practice or Strict Apple Documentation (if any exists). What is common practice?
Sorry, I cannot post any screen shots or code snippets due to business process reasons. I will do my best to explain if any questions arise.
Thanks,
We can figure this out through apps designed by Apple. Here are two examples
1. Contacts
Find a contact person in the Contacts app and set birthday. The picker shows up. While you are dragging the pickers, it does not set value to the text field. It happens only when you release the wheel. There is no Done button to hide the picker it self. To dismiss it, you can either click on the done button on navigation bar to end editing for the whole page, or click on another text field which pops a different keyboard.
2.Setting - Date&Time
Basically the same as Contacts app. Here you cannot even dismiss the picker.

Can't move focus from table view to adjoining button on tvOS

I have a single ViewController which contains a Table View on the left and a few labels on the right. Navigating through the table view entries works fine (up/down). Focus is no problem there. Even the related text in the labels is updated just fine using tableView:didUpdateFocusInContext.
The interface looks like this:
However, the button on the right ("Jetzt ansehen") never gets focus. When I use the debugger (as suggested in the official documentation), it doesn't include the button in the focusable area at all:
I really tried to solve this using UIFocusGuide, but I have no real idea how to accomplish that, yet.

UIButton doesn't display properly

I added a UIButton to a view in my application. Its a custom button, with two different images for its default and highlighted state. I have 2 other buttons on the view that are very similar but provide different functions.
However, my latest button won't display at all. I've clean the project as suggested in another question and it still won't display. Whats doubly weird though is that if I click the area of the view where the button should be, the IBAction is called and the UITextFields are cleared as if the button was there. Its as if the button is being created without its graphics being displayed.
Does anyone know what might be happening here? The button looks as it should in IB.
Thanks, Jack
Go to the Organizer window, select the Projects tab, select your project in the list and then delete the derived data folder by choosing "Delete…" in the window.
If that doesn't work, check if the images are included in the target. Select the image files and look in the info editor (the Files tab — the left one) if it's added to the target.
Hope that helps.