Where I am currently trying to paste the cursor, I am trying to do what it says: -
The main deal is that I can not just go to text box 1.text (etc) because the text file is in the midst of a custom cell. I just want to add some text where the cursor is (when I have a keyboard Press the custom key on).
- I want to paste the decimal in the text box ...
The error I get is:
< P> Note: In Has the access to the Textfield Tag (if he helps?)2010-05- 15 22: 37: 20.797 page control [37 9 62: 207] * - [MyDetailController Paste:]: Example sent to unknown selector: 0x1973d10 2010-05-15 22: 37: 20.797 PageControl [37 9 62: 207 ] * Due to the exception of an exception exception, 'NSINID IDA Agreement Exception' is terminated, the reason: '*** - [MyDetailController Paste:]: Example sent to unknown selector: 0x1973d10'
I'm a little bit early in the objective-c, but still not great, my code is currently down, and
All thanks.
MyDetailController.h
@interface MyDetailController: UITableViewController & lt; UITextFieldDelegate, UINavigationControllerDelegate & gt; {// ... (here in Lotus)} @ and @ Interface UIResponder (UIResponderInsertTextAdditions) - (zero) insertText: (NSString *) text; @end
MyDetailController.m
@implementation MyDetailController // .... (lots of here) - (Zero) addDecimal: (NSOtification *) Notification {// Textfield Accepted in Decryptidemount.text = [savedAmount.text stringByAppendingString: @ "."]; NSLog (@ "pressed decimal"); NSLog (@ "tagclit:% d", tagclosed); Switch (tagclosed) {Case 7: //savedAmount.text = [Saved Amount. Text stringBapping string: @ "."]; break; Case 8: //goalAmount.text = [TargetAvalence. Text stringBapping string: @ "."]; break; Case 9: //IncrementAmount.Text = [Incremental Value Text stringBapping: @ "."]; break; Case 10: //IncrementAmount.text = [Incremental Value. Text stringBegining string: @ "."]; break; } [Self contained text: @ "."]; } - (zero) textFieldDidBeginEditing: (UITextField *) textfield {// UITextField * theCell = (UITextField *) sender; Tagclactic = textfile Tag; NSLog (@ "TextFile changed .claim:% d", tagclit); } @end @implementation UIResponder (UIResponderInsertTextAdditions) - (Zero) insertText: (NSString *) Text {// Get a response to the system pasteboard because it will only use // selector (paste :) UIPTboard * Normal pasteboard = [ UIPistboard general pasteboard]; // Save the copy of the item of the system pasteboard // so we can restore them later NSArray * items = [general pasteboard.implete copy]; // Set the contents of System Pasteboard // that we want to insert. GeneralPasteboard.string = text; // Tell this reply to paste the contents of // system pasteboard at current cursor location. [Self Paste: Self]; // System Pasteboard Restore your original items General pasteboard.itm = items; // free item array that we previously copied [item release]; } @end
UIViewController is a UIResponder ... But this is not a UISpender, which should include the inserted text: message. You want to call diet text: self on UITextField If you take a look at UIResponder.h, then you will see the following note next to Paste:
// These methods have not been implemented in NSObject
This means To call them on any UIResponder, they can safely call sub-classes such as UITFIFFED and UITEXviewView that actually apply them. It was really a weird design decision on the part of the apple.
Comments
Post a Comment