I have an app that fetches facebook and twitter posts. When fetched, some posts have special chars like:
👫❤ http://t.co/FONMMA39UR
I display it inside a UILabel. Sometimes it works, sometimes it doesn't. The Label is inside a TableViewCell and I noticed that after refreshing the TableView, the icons shown.
Could anyone give the the solution?
As #samfisher say that it'll always display if valid unicode character found in the string you are putting in UILabel and you said that after refreshing the TableView, the icons shown. So my suggest is to refresh the tableview forcefully by using [yourTableView reloadData]; It'll work.
Related
I looked some tutorials on youtube on how to add/delete rows, though none of them show how to make it so that new added text redirects to a new page.
All they show is how to add the row and delete it.
Let's say, the first page you open is blank and has only an ADD button, once you add the text you want, it would add itself in the row. However you will be able to click on the row you just added and it would bring you to another page, where you can add more things, etc, etc.
Here is a quick paint image on what exactly I mean.
image
by using UItableView you can have rows. UItableView has delegate method tableView didSelectRowAt. In the method you can handle page transitions when a row is selected.
Some useful links for how to create UItableView
UITableView – Tutorial
UITableView Tutorial with Custom Cells
I am using OHAttributedLabel to create a text link inside my UITableViewCell. However, when I am tapping this link, I am having hard time getting the tap through, it seems like I have to hold my finger a lot longer to get OHAttributedLabel to realize that I want to tap the link.
I do not have this problem outside UITableViews, everything works perfectly. Curiously, this same error happens also in tableViewFooter and header. I have set userInteractionEnabled = YES for the label, and NO for the cell. What could I be doing wrong here?
I have created a UITableView that is of type UITableViewStyleGrouped. I have then created several different sections with a few rows in each. Within each of these rows I have created a custom UITableViewCell that contains a UITextField. I also have one UITableViewCell that contains a UITextView.
I have also implemented a UIToolbar that appears on top of the UIKeyboard that allows the user to move through the UITextField's by pressing previous or next.
The issue I'm having is two-fold:
I need the UITableView to scroll so that when the next UITextField (or UITextView) becomes the first responder it is visible (even with the keyboard being displayed).
When a UITextField (or UITextView) is selected (without using the previous and next buttons) is should adjust so that the field is visible above the keyboard.
I have looked around at lots of different tutorials however none of them have resolved my issue. Any help you could offer would be hugely appreciated.
ADDITIONAL INFO:
I'm 100% certain that my app used to do all of the above automatically, however I seems to have stopped doing it now and I don't understand why. Is there a reason why this may of happened? Is there some function or something that I may have changed that would destroy this behaviour?
Probably no use to original poster now, but those having an issue like this where it once did work and then stopped...
check you don't have a:
- (void)viewWillAppear:(BOOL)animated
in your UITableViewController subclass!!!
using viewWillAppear in a UITableViewController breaks the "automagic tableView scrolling up when keyboard appears" behaviour.
I only found this by comparing laboriously an old version of a project where it did work with my latest source where it had stopped working.
Check out TaggedLocations sample code from apple. It does the same thing without any extra manipulation.
The key is that your viewcontrollers are following the standard. i.e you are NOT having container viewcontrollers such as UINavigationController within UIViewController.
You have to update tableview Frame yourself programatically...
and i am 100% sure that if you are 100% certain that your app used to do all of the above automatically ...than it is not your app.
Check the docs..here is the link
https://developer.apple.com/library/ios/#documentation/StringsTextFonts/Conceptual/TextAndWebiPhoneOS/ManageTextFieldTextViews/ManageTextFieldTextViews.html#//apple_ref/doc/uid/TP40009542-CH10-SW1
You will have to register for keyboard notifications..and then update your tableview frame.
And for next and previous.. you have to programmatically check which textfield became active..and then set the frame accordingly.
The Facebook app for the iPhone has a great username/password setup where it almost looks like it is a uitableview with UITextField's inside the two rows, is this how it is done? Or would it be something different to this altogether?
If it is a tableview, how can I access the textfields inside the tableview once the user hits the Login button? Is there a quick way to iterate over the cells in a tableview?
A simple one, I know, but I didnt want to implement an elaborate tableview if I didnt need to...
The source: https://github.com/c99koder/lastfm-iphone
Edited: It's possible you customize the UITableViewCell and put a UITextField inside. However, there is an even easy way to achieve this, since the login / signup page would almost always be static. See below.
LastFM for iPhone used a similar login / signup page design. And they open-sourced their code. Take a look at the nib file and you will know how LastFM did this. :-)
Screenshot 1: original
Screenshot 2: after I removed some of the background png files.
Create a tableview controller and go to the xib file -> attributes inspector->tableview and select "group styled" instead of plain. Then u can customize the tableview cells in the code by adding the textfields for username and password. Then create a new UIView and set the view to the tableview's footer view for the login button.
For more explanation regarding the same, go through the answer for this question.
Table view in iPhone in grouped style
It looks like it's not using a UITableView at all (otherwise, you'd be able to scroll the page up and down). It's just two UITextFields over custom backgrounds (or with custom backgrounds).
Now, if you wanted to use a UITableView, what you could do is store as variables the UITextFields within the UITableViewCells. Then, when the person clicks a login button, you just get the text value from the UITextFields.
But, again, if you wanted to emulate the Facebook look, you don't need to bother with the UITableView.
Hope this helps!
Alright, now that I understand your question (thanks #Jonathan!), yes it does look like it is a tableview using custom UITableViewCells with a UITextField.
After creating the custom cell with a UITextField you can assign your view controller as the UITextField delegate and access the values at various points through the delegate methods:
– textFieldShouldBeginEditing:
– textFieldDidBeginEditing:
– textFieldShouldEndEditing:
– textFieldDidEndEditing:
As an example, in your textFieldShouldReturn:, you can grab a reference to the indexPath of that cell with :
NSIndexPath *indexPath = [self.loginTable indexPathForCell:(MemberLoginCell*)[[textField superview] superview]];
And then to the cell with:
MemberLoginCell *cell = (MemberLoginCell*)[self.loginTable cellForRowAtIndexPath:indexPath];
Or simply grab the textField.text value and assign it to an NSString that can be passed to your LOGIN method as required.
I know there's already an accepted answer, but I created a facebook-type login page, using a UITableView. The code is here on github
I am needing to alert something for an answer for a trivia game iOS app I am writing. I have an alert view that pops up and shows a scrollable uitextview...is Apple going to ding me for that? What are my options for showing large amounts of text in my alert?
Thanks!!
I think that showing UITextView is ok. Moreover it seems that Apple actually does the same thing - if you try to display very long text in UIAlertView then it will be displayed in scrollable UITextView automatically
P.S. and it also uses UITableView instead of buttons if you set too many button names.