Search Results

Search found 14 results on 1 pages for 'uiresponder'.

Page 1/1 | 1 

  • Cannot find interface declaration for 'UIResponder'

    - by lfe-eo
    Hi all, I am running into this issue when trying to compile code for an iPhone app that I inherited from a previous developer. I've poked around on a couple forums and it seems like the culprit may be a circular #import somewhere. First - Is there any easy way to find if this is the case/find what files the loop is in? Second - Its definitely possible this isn't the problem. This is the full error (truncated file paths so its easier to view here): In file included from [...]/Frameworks/UIKit.framework/Headers/UIView.h:9, from [...]/Frameworks/UIKit.framework/Headers/UIActivityIndicatorView.h:8, from [...]/Frameworks/UIKit.framework/Headers/UIKit.h:11, from /Users/wbs/Documents/EINetIPhone/EINetIPhone_Prefix.pch:13: [...]/Frameworks/UIKit.framework/Headers/UIResponder.h:15: error: expected ')' before 'UIResponder' [...]/Frameworks/UIKit.framework/Headers/UIResponder.h:17: error: expected '{' before '-' token [...]/Frameworks/UIKit.framework/Headers/UIResponder.h:42: warning: '@end' must appear in an @implementation context [...]/Frameworks/UIKit.framework/Headers/UIResponder.h:51: error: expected ':' before ';' token [...]/Frameworks/UIKit.framework/Headers/UIResponder.h:58: error: cannot find interface declaration for 'UIResponder' As you can see, there are other errors alongside this one. These seem to be simple syntax errors, however, they appear in one of Apple's UIKit files (not my own) so I am seriously doubting that Apple's code is truly producing these errors. I'm stumped as to how to solve this issue. If anyone has any ideas of things I could try or ways/places I could get more info on the problem, I'd really appreciate it. I'm very new to Obj-C and iPhone coding.

    Read the article

  • UIResponder Delays

    - by Dylan Copeland
    I have a UIView subclass that overrides UIResponder's touchesMoved: message. I've noticed that when I swipe my finger very quickly across the UIView, my touchesMoved: message only gets called every so often and not constantly getting messaged. Any ideas? Thanks.

    Read the article

  • Example of UITextField ResignFirstResponder with Monotouch

    - by kentakhy
    I'm a newbie. I can't figure out how and where to call ResignFirstResponder to get rid of the keyboard when the user finished entering the text in an UITextField. I'm a bit confused by the UIResponder class. Mono documentation says: "To dismiss the keyboard, send the UIResponder.ResignFirstResponder message to the text field that is currently the first responder." How to do so? Can someone post a simple working example? There are many examples in Obj-C but none in C#. Many thanks.

    Read the article

  • Notifying view controller when subview touch events occur.

    - by Nebs
    I have a UIViewController whose view has a custom subview. This custom subview needs to track touch events and report swipe gestures. Currently I put touchesBegan, touchesMoved, touchesEnded and touchesCancelled in the subview class. With some extra logic I am able to get swipe gestures and call my handleRightSwipe and handleLeftSwipe methods. So now when I swipe within the subview it calls its local swipe handling methods. This all works fine. But what I really need is for the handleRightSwipe and handleLeftSwipe methods to be in the view controller. I could leave them in the subview class but then I'd have to bring in all the logic and data as well and that kind of breaks the MVC idea. So my question is is there a clean way to handle this? Essentially I want to keep my touch event methods in the subview so that they only trigger for that specific view. But I also want the view controller to be informed when these touch events (or in this case swipe gestures) occur. Any ideas? Thanks.

    Read the article

  • custom Copy Responder in iphone

    - by sagar
    Hello ! I have a webview in my application. I want to handle when user copies something from web view, my custom method - should be triggered. I have tried following. I have placed following method in myViewCtr.m file -(void)copy:(id)sender{ NSLog(@"hi ! Hello "); } But nothing working - What should I do to implement the same ? Thanks in advance for sharing your great knowledge. Sagar

    Read the article

  • touchesEnded:withEvent: from UIScrollView First Responder

    - by Matthew Mitchell
    I've made a UIScrollView the first responder. I need to maintain touch events to a touchesEnded:withEvent: method on a view behind it. I've tried using the nextResponder method and that failed. I've tried forwarding touchesEnded:withEvent to the view behind it and that fails. How do I get this to work? The UIScrollView wont work unless it is the first responder or gets events some other way. Thank you for any help. Shame Apple's documentation and APIs are terrible in areas.

    Read the article

  • iPhone first responders

    - by William Jockusch
    I am confused about the iPhone responder chain. Specifically, in the iPhone event handling guide http://developer.apple.com/iPhone/library/documentation/iPhone/Conceptual/iPhoneOSProgrammingGuide/EventHandling/EventHandling.html, we have the following: The first responder is the responder object in an application (usually a UIView object) that is designated to be the first recipient of events other than touch events. But UIView is a subclass of UIResponder. And the UIResponder class reference says this: - (BOOL)canBecomeFirstResponder Return Value YES if the receiver can become the first responder, NO otherwise. Discussion Returns NO by default. If a responder object returns YES from this method, it becomes the first responder and can receive touch events and action messages. Subclasses must override this method to be able to become first responder. I am confused by the apparent contradiction. Can anyone clear it up for me? For what it's worth, I did set up a simple view-based application, and call canBecomeFirstResponder and isFirstResponder on its view. Both returned NO.

    Read the article

  • iOS static Framework crash when animating view

    - by user1439216
    I'm encountering a difficult to debug issue with a static library project when attempting to animate a view. It works fine when debugging (and even when debugging in the release configuration), but throws an error archived as a release: Exception Type: EXC_CRASH (SIGSYS) Exception Codes: 0x00000000, 0x00000000 Crashed Thread: 0 Thread 0 name: Dispatch queue: com.apple.main-thread Thread 0 Crashed: 0 TestApp 0x000d04fc 0x91000 + 259324 1 UIKit 0x336d777e +[UIView(UIViewAnimationWithBlocks) animateWithDuration:animations:] + 42 2 TestApp 0x000d04de 0x91000 + 259294 3 TestApp 0x000d0678 0x91000 + 259704 4 Foundation 0x355f04f8 __57-[NSNotificationCenter addObserver:selector:name:object:]_block_invoke_0 + 12 5 CoreFoundation 0x35aae540 ___CFXNotificationPost_block_invoke_0 + 64 6 CoreFoundation 0x35a3a090 _CFXNotificationPost + 1400 7 Foundation 0x355643e4 -[NSNotificationCenter postNotificationName:object:userInfo:] + 60 8 UIKit 0x33599112 -[UIInputViewTransition postNotificationsForTransitionStart] + 846 9 UIKit 0x335988cc -[UIPeripheralHost(UIKitInternal) executeTransition:] + 880 10 UIKit 0x3351bb8c -[UIPeripheralHost(UIKitInternal) setInputViews:animationStyle:] + 304 11 UIKit 0x3351b260 -[UIPeripheralHost(UIKitInternal) _reloadInputViewsForResponder:] + 952 12 UIKit 0x3351ae54 -[UIResponder(UIResponderInputViewAdditions) reloadInputViews] + 160 13 UIKit 0x3351a990 -[UIResponder becomeFirstResponder] + 452 14 UIKit 0x336194a0 -[UITextInteractionAssistant setFirstResponderIfNecessary] + 168 15 UIKit 0x33618d6a -[UITextInteractionAssistant oneFingerTap:] + 1602 16 UIKit 0x33618630 _UIGestureRecognizerSendActions + 100 17 UIKit 0x335a8d5e -[UIGestureRecognizer _updateGestureWithEvent:] + 298 18 UIKit 0x337d9472 ___UIGestureRecognizerUpdate_block_invoke_0541 + 42 19 UIKit 0x33524f4e _UIGestureRecognizerApplyBlocksToArray + 170 20 UIKit 0x33523a9c _UIGestureRecognizerUpdate + 892 21 UIKit 0x335307e2 _UIGestureRecognizerUpdateGesturesFromSendEvent + 22 22 UIKit 0x33530620 -[UIWindow _sendGesturesForEvent:] + 768 23 UIKit 0x335301ee -[UIWindow sendEvent:] + 82 24 UIKit 0x3351668e -[UIApplication sendEvent:] + 350 25 UIKit 0x33515f34 _UIApplicationHandleEvent + 5820 26 GraphicsServices 0x376d5224 PurpleEventCallback + 876 27 CoreFoundation 0x35ab651c __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE1_PERFORM_FUNCTION__ + 32 28 CoreFoundation 0x35ab64be __CFRunLoopDoSource1 + 134 29 CoreFoundation 0x35ab530c __CFRunLoopRun + 1364 30 CoreFoundation 0x35a3849e CFRunLoopRunSpecific + 294 31 CoreFoundation 0x35a38366 CFRunLoopRunInMode + 98 32 GraphicsServices 0x376d4432 GSEventRunModal + 130 33 UIKit 0x33544cce UIApplicationMain + 1074 Thread 0 crashed with ARM Thread State: r0: 0x0000004e r1: 0x000d04f8 r2: 0x338fed47 r3: 0x3f523340 r4: 0x00000000 r5: 0x2fe8da00 r6: 0x00000001 r7: 0x2fe8d9d0 r8: 0x3f54cad0 r9: 0x00000000 r10: 0x3fd00000 r11: 0x3f523310 ip: 0x3f497048 sp: 0x2fe8d988 lr: 0x33539a41 pc: 0x000d04fc cpsr: 0x60000010 To give some background info: The static library is part of an 'iOS fake-framework', built using the templates from here: https://github.com/kstenerud/iOS-Universal-Framework The framework presents a registration UI as a modal view on top of whatever the client application is doing at the time. It pushes these views using a handle to a UIViewController provided by the client application. It doesn't do anything special, but here's the animation code: -(void)keyboardWillShowNotification:(NSNotification *)notification { double animationDuration = [[[notification userInfo] objectForKey:UIKeyboardAnimationDurationUserInfoKey] doubleValue]; dispatch_async(dispatch_get_main_queue(), ^(void) { [self animateViewsToState:kUMAnimationStateKeyboardVisible forIdiom:[UIDevice currentDevice].userInterfaceIdiom forDuration:animationDuration]; }); } -(void)animateViewsToState:(kUMAnimationState)state forIdiom:(UIUserInterfaceIdiom)idiom forDuration:(double)duration { float fieldOffset; if (idiom == UIUserInterfaceIdiomPhone) { if (state == kUMAnimationStateKeyboardVisible) { fieldOffset = -KEYBOARD_HEIGHT_IPHONE_PORTRAIT; } else { fieldOffset = KEYBOARD_HEIGHT_IPHONE_PORTRAIT; } } else { if (state == kUMAnimationStateKeyboardVisible) { fieldOffset = -IPAD_FIELD_OFFSET; } else { fieldOffset = IPAD_FIELD_OFFSET; } } [UIView animateWithDuration:duration animations:^(void) { mUserNameField.frame = CGRectOffset(mUserNameField.frame, 0, fieldOffset); mUserPasswordField.frame = CGRectOffset(mUserPasswordField.frame, 0, fieldOffset); }]; } Further printf-style debugging shows that it crashes whenever I do anything much with UIKit - specifically, it crashes when I replace -animateViewsToState with: if (0 == UIUserInterfaceIdiomPhone) { NSLog(@""); } and [[[[UIAlertView alloc] initWithTitle:@"test" message:@"123" delegate:nil cancelButtonTitle:@"OK" otherButtonTitles:nil] autorelease] show]; To me, this sounds like a linker problem, but I don't understand how such problems would only manifest here, and not beforehand. Any help would be greatly appreciated.

    Read the article

  • iphone sdk - problem pasting into current text location

    - by norskben
    Hi guys I'm trying to paste text right into where the cursor currently is. I have been trying to do what it says at: - http://dev.ragfield.com/2009/09/insert-text-at-current-cursor-location.html The main deal is that I can't just go textbox1.text (etc) because the textfield is in the middle of a custom cell. I want to just have some text added to where the cursor is (when I press a custom key on a keyboard). -I just want to paste a decimal into the textbox... The error I get is: 2010-05-15 22:37:20.797 PageControl[37962:207] * -[MyDetailController paste:]: unrecognized selector sent to instance 0x1973d10 2010-05-15 22:37:20.797 PageControl[37962:207] Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '** -[MyDetailController paste:]: unrecognized selector sent to instance 0x1973d10' Note: I have access to the textfield tag (if that helps?) I'm a little past the beginner stage in objective-c, but still not great. My code is currently below, and at https://gist.github.com/d634329e5ddf52945989 Thanks all. MyDetailController.h @interface MyDetailController : UITableViewController <UITextFieldDelegate,UINavigationControllerDelegate> { //...(lots in here) } @end @interface UIResponder(UIResponderInsertTextAdditions) - (void) insertText: (NSString*) text; @end MyDetailController.m @implementation MyDetailController //.... (lots in here) - (void)addDecimal:(NSNotification *)notification { // Apend the Decimal to the TextField. //savedAmount.text = [savedAmount.text stringByAppendingString:@"."]; NSLog(@"Decimal Pressed"); NSLog(@"tagClicked: %d",tagClicked); switch (tagClicked) { case 7: //savedAmount.text = [savedAmount.text stringByAppendingString:@"."]; break; case 8: //goalAmount.text = [goalAmount.text stringByAppendingString:@"."]; break; case 9: //incrementAmount.text = [incrementAmount.text stringByAppendingString:@"."]; break; case 10: //incrementAmount.text = [incrementAmount.text stringByAppendingString:@"."]; break; } [self insertText:@"."]; } -(void)textFieldDidBeginEditing:(UITextField *)textfield{ //UITextField *theCell = (UITextField *)sender; tagClicked = textfield.tag; NSLog(@"textfield changed. tagClicked: %d",tagClicked); } @end @implementation UIResponder(UIResponderInsertTextAdditions) - (void) insertText: (NSString*) text { // Get a refererence to the system pasteboard because that's // the only one @selector(paste:) will use. UIPasteboard* generalPasteboard = [UIPasteboard generalPasteboard]; // Save a copy of the system pasteboard's items // so we can restore them later. NSArray* items = [generalPasteboard.items copy]; // Set the contents of the system pasteboard // to the text we wish to insert. generalPasteboard.string = text; // Tell this responder to paste the contents of the // system pasteboard at the current cursor location. [self paste: self]; // Restore the system pasteboard to its original items. generalPasteboard.items = items; // Free the items array we copied earlier. [items release]; } @end

    Read the article

  • How do I create a UISplitView manually?

    - by Mark
    I have an app that is going to navigate to a UISplitView (inside another view altogether) like so: - (void) switchToMyDayView { NSLog(@"Show My Day Screen"); if (self.myDayController.view.superview == nil) { if (self.myDayController == nil) { MyDayController *myController = [[MyDayController alloc] initWithNibName:@"MyDay" bundle:nil]; self.myDayController = myController; [myController release]; } [homeScreenController.view removeFromSuperview]; [self.view insertSubview:self.myDayController.view atIndex:0]; } } Which is done on the main navigation screen Now, the MyDayController has a XIB called MyDay.xib which has these items: File's Owner: MyDayController First Responder: UIResponder Split View Controller ---->Navigation Controller ---->Navigation Bar ----> Table View Controller ----> Navigation Item ---->View Controller So, I need some more components here, I need a UITableViewController and a UISplitViewControllerDelegate correct? I was going to just implement these protocols in my MyDayController, is this sort of standard? So, after the code above, I get an error: -[UIViewController _loadViewFromNibNamed:bundle:] loaded the "MyDay" nib but the view outlet was not set. so, how can I fix it using the UISplitViewController? I know that the UISplitViewController has a view property, but I cannot use it/connect it up in IB can I? Thanks a lot Mark

    Read the article

  • Empty UIView with minimal drawRect: overhead

    - by Benjohn Barnes
    Hi, I have an application that has three nested views that are mechanically important, but have no visual elements: A vanila UIView that doesn't have any content of its own, and is simply used as a host for CALayers. A UIScrollView (that is queried for it's origin and used to position CALayers in 3d: I really only use this view to faithfully replicate the scroll view's "mechanics"), The scroll view's contents: a UIView subclass. It simply picks up touch events and passes them to a delegate - all that is important are its UIResponder machinery. The UIView hosting CALayers is a sibling of a UIImageView that is a background image over which the CALayers are drawn. I'd really like to ensure that none of these empty UIViews have any drawing or compositing overhead (in time, or storage) associated with them, or if that's not possible, to get this overhead as small as possible, and to understand it so that I can perhaps decide if I should try a different approach. In interface builder, I've set all of the views to not clear their context before drawing. I've not set them to be opaque though, because they definitely are not opaque - they are completely transparent. I've found that I need to give the scroll view contents a transparent clear colour (again in IB by setting the background colour's opacity to zero), and this suggests that it is being drawn, which I don't want. So, in short, I've not got much idea of what is and isn't getting drawn (anyone know of a tool like Quartz Debug for iPhone / simulator?), or how to go about stopping things from getting drawn. Advice would be very welcome! Thanks, Benjohn

    Read the article

  • Any point in subclassing UIButton to create a custom looking button?

    - by glitch
    I want to create a set of buttons that would work and feel very much like the Metro-style tiles that are available on Windows Phones. I would like to allow the user to tap them to access their underlying functionality (open a modal or something or that sort). I'm concerned that subclassing UIButton will not get me there. I need square corners and dynamic content inside the tiles themselves. The posts I've found around SO seem to suggest that subclassing a UIButton would not be a good idea for several reasons and that I should instead use UIView. That reply is from 2010, and I have no idea if in the 2+ years since then there have been considerable changes to how one would achieve that effect. Most users these days will have iOS 5.1+ if not 6.0 soon. Let's say I do go the UIView route. Should I implement UIResponder's touch events or should I instead go the UITapGestureRecognizer route? What's the better practice in 2012? Thank you!

    Read the article

  • CoreData: managedObjectContext not being created

    - by PruitIgoe
    I had to add core data to an existing project but I am having issues with the managedObjectContext... in prefix.pch I have this: #import <Availability.h> #ifndef __IPHONE_5_0 #warning "This project uses features only available in iOS SDK 5.0 and later." #endif #ifdef __OBJC__ #import <UIKit/UIKit.h> #import <Foundation/Foundation.h> #import <CoreData/CoreData.h> #endif ... in my appDelegate.h I have this: #import <UIKit/UIKit.h> #import "AppViewController.h" #import "DDLog.h" #import "DDASLLogger.h" #import "DDFileLogger.h" #import "DDTTYLogger.h" #import "KIP_LogManager.h" @interface AppDelegate : UIResponder <UIApplicationDelegate> { DDFileLogger* fileLogger; /*coredata*/ NSManagedObjectModel* managedObjectModel; NSManagedObjectContext* managedObjectContext; NSPersistentStoreCoordinator* persistentStoreCoordinator; } @property (strong, nonatomic) UIWindow *window; @property (strong, nonatomic) AppViewController* viewController; @property (readonly, strong, nonatomic) NSManagedObjectContext* managedObjectContext; @property (readonly, strong, nonatomic) NSManagedObjectModel* managedObjectModel; @property (readonly, strong, nonatomic) NSPersistentStoreCoordinator* persistentStoreCoordinator; - (void)setupLogging; - (NSString *)applicationDocumentsDirectory; in appDelegate.m this: @synthesize managedObjectContext = _managedObjectContext; @synthesize managedObjectModel = _managedObjectModel; @synthesize persistentStoreCoordinator = _persistentStoreCoordinator; ... - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { //establish lumberjack logging [self setupLogging]; DDLogVerbose(@"\n\n*********************\nNEW LOG SESSION\n**********************\n\n"); //set root view controller self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]]; self.viewController = [[AppViewController alloc] init]; self.window.rootViewController = self.viewController; self.viewController.managedObjectContext = _managedObjectContext; return YES; } ... #pragma mark - CoreData Stack - (NSManagedObjectContext *)managedObjectContext { if (_managedObjectContext != nil) { return _managedObjectContext; } NSPersistentStoreCoordinator *coordinator = [self persistentStoreCoordinator]; if (coordinator != nil) { _managedObjectContext = [[NSManagedObjectContext alloc] init]; [_managedObjectContext setPersistentStoreCoordinator:coordinator]; } return _managedObjectContext; } // Returns the managed object model for the application. // If the model doesn't already exist, it is created from the application's model. - (NSManagedObjectModel *)managedObjectModel { if (_managedObjectModel != nil) { return _managedObjectModel; } NSURL *modelURL = [[NSBundle mainBundle] URLForResource:@"SPI_PAC" withExtension:@"momd"]; _managedObjectModel = [[NSManagedObjectModel alloc] initWithContentsOfURL:modelURL]; return _managedObjectModel; } - (NSPersistentStoreCoordinator *)persistentStoreCoordinator { if (persistentStoreCoordinator != nil) { return persistentStoreCoordinator; } NSMutableString* strDocsDirector = [[NSMutableString alloc] initWithString:[self applicationDocumentsDirectory]]; [strDocsDirector appendString:@"/SPI_PAC.sqlite"]; NSURL* storeURL = [NSURL URLWithString:strDocsDirector]; NSError *error = nil; persistentStoreCoordinator = [[NSPersistentStoreCoordinator alloc] initWithManagedObjectModel:[self managedObjectModel]]; if(![persistentStoreCoordinator addPersistentStoreWithType:NSSQLiteStoreType configuration:nil URL:storeURL options:nil error:&error]) { /*Error for store creation should be handled in here*/ } return persistentStoreCoordinator; } - (NSString *)applicationDocumentsDirectory { return [NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES) lastObject]; } in the view controller, viewDidLoad I am logging the passed managedObjectContext and am getting null returned. Obviously I am missing something but not sure what? In viewcontroller.h I have: @property (nonatomic, retain) NSManagedObjectModel* managedObjectModel; @property (nonatomic, retain) NSManagedObjectContext* managedObjectContext; @property (nonatomic, retain) NSPersistentStoreCoordinator* persistentStoreCoordinator; and in the viewcontroller.m: @synthesize managedObjectContext = managedObjectContext; ... DDLogVerbose(@"%@", managedObjectContext);

    Read the article

1