Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 3 years ago.
Improve this question
I've heard varying things about whether or not creating a Subclass of UIWebView is allowable. Can someone link me to any documentation that clarifies this one way or another?
There are mixed messages coming from Apple on this.
The docs do say not to subclass as BoltClock noted. However, one of the presentations from WWDC 2011, Rich Text Editing in Safari on iOS, suggests subclassing. It appears to be the only way to add custom UIMenuItems.
From the slides:
// For your UIWebView subclass:
- (void)bold:(id)sender {
[self stringByEvaluatingJavaScript:#”document.execCommand(‘Bold’)];
}
- (BOOL)canPerformAction:(SEL)action withSender:(id)sender {
if (action == #selector(bold:))
return YES;
return [super canPerformAction:action withSender:sender];
}
I need functionality other than Copy and Paste in my app so I'll be subclassing.
Under Subclassing Notes of the UIWebView reference, all it says is:
Subclassing Notes
The UIWebView class should not be subclassed.
It doesn't say why. I would guess that it's to maintain the integrity of the underlying WebKit control or something, I dunno.
Related
Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 8 years ago.
Improve this question
Good night!
Should I use the method - (void) dealloc in file ViewController.m for outlets (where #synthesize is announced at the beginning of the file) that do not have properties retained?
In ARC, you do not need to implement dealloc other than to release resources managed outside of ARC (retained properties are managed by ARC). If you have a property that managed outside of ARC (say a malloced object), you need to free it in the dealloc method (preferably by setting it to nil and handling the freeing in the setter).
If you do implement dealloc, do not call super as you do when not using ARC.
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Questions asking for code must demonstrate a minimal understanding of the problem being solved. Include attempted solutions, why they didn't work, and the expected results. See also: Stack Overflow question checklist
Closed 9 years ago.
Improve this question
I want to have the ability to allow the user to fill out a profile, almost like the notes app and then when they are done it adds it to the UITableViewCell and displays certain parts of what they filled out on the Cell..Then they can obviously repeat this action..
I am not sure where to look for a tutorial on this or what this may be called, anyone have any suggestions?
Five simple steps :
1)Design how form is gonna look like and your tableview.
2)Make the form using a sample UIviewcontroller layout your components using xib or
storyboard
3) Embed your UIViewcontroller designed in step 2 into a UINavigationViewController
This helps you to transition from your form to UITableView
4) Design your UITableViewController and put a back button on UINavigationBar to allow user to go to previous view controller.
5) Connect UIViewController to UITableViewController
-(void)submitButtonPressed:(id)sender{
UITableViewController *tvc = [[UITableViewController alloc] initWithNib:#"your view controller name"];
// pass data to UITableViewController
tvc.userdata = self.userdata;
[self.navigationController pushviewController:tvc];
}
Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 8 years ago.
Improve this question
WARNING: Using legacy cell layout due to delegate implementation of tableView:accessoryTypeForRowWithIndexPath: in <Settings: 0x250c60>. Please remove your implementation of this method and set the cell properties accessoryType and/or editingAccessoryType to move to the new cell layout behavior.
Here,
accessoryTypeForRowWithIndexPath is deprecated in iPhone OS 3.0.
Instead set like this.
cell.accessoryType = UITableViewCellAccessoryDetailDisclosureButton;
Existed Answers - here
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question appears to be off-topic because it lacks sufficient information to diagnose the problem. Describe your problem in more detail or include a minimal example in the question itself.
Closed 9 years ago.
Improve this question
I am trying to use a delegate method in my simple iPhone application but I got an error.
If there are any examples code; pls send me a link or code.
When using delegates there are a few things to take care of.
For example, say you have a class MyController and you want it to be a UITextField's delegate. Put the delegate protocol name in the class's interface:
#interface MyController : NSObject <UITextFieldDelegate>
Then, implement the delegate methods in the UITextFieldDelegate docs (the docs say "All of the methods of this protocol are optional." so you can choose which you want):
#implementation MyController
...
- (BOOL)textFieldShouldReturn:(UITextField *)textField
// do something
}
...
#end
Then finally, set yourself as the delegate:
myTextField.delegate = self;
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 8 years ago.
Improve this question
Since there is no pre-existing component for creating a combobox (or select box) as seen on webpages through Safari, can someone provide an example or pre-existing 3rd party component of creating one?
I don't think this is hard to do.
In a view controller you have a UITextField and a UITableView. Assign the view controller to be the delegate of the both controls, plus the data source of the table.
Implement the UITextField delegate method textField:shouldChangeCharactersInRange:replacementString: in your controller. This intercepts the changes as they are being typed in your text field. In this method, iterate through your list of possible options and store the matches in an NSMutableArray instance variable on your view controller. Then call [myTableView reloadData].
Have your table cells generated from the array of matches you previously stored.
It should be pretty straightforward and shouldn't take much code at all beyond a few delegate methods to get working.