Search Results

Search found 6486 results on 260 pages for 'cocoa touch'.

Page 14/260 | < Previous Page | 10 11 12 13 14 15 16 17 18 19 20 21  | Next Page >

  • Android Swipe In Unity 3D World with AR

    - by Christian
    I am working on an AR application using Unity3D and the Vuforia SDK for Android. The way the application works is a when the designated image(a frame marker in our case) is recognized by the camera, a 3D island is rendered at that spot. Currently I am able to detect when/which objects are touched on the model by raycasting. I also am able to successfully detect a swipe using this code: if (Input.touchCount > 0) { Touch touch = Input.touches[0]; switch (touch.phase) { case TouchPhase.Began: couldBeSwipe = true; startPos = touch.position; startTime = Time.time; break; case TouchPhase.Moved: if (Mathf.Abs(touch.position.y - startPos.y) > comfortZoneY) { couldBeSwipe = false; } //track points here for raycast if it is swipe break; case TouchPhase.Stationary: couldBeSwipe = false; break; case TouchPhase.Ended: float swipeTime = Time.time - startTime; float swipeDist = (touch.position - startPos).magnitude; if (couldBeSwipe && (swipeTime < maxSwipeTime) && (swipeDist > minSwipeDist)) { // It's a swiiiiiiiiiiiipe! float swipeDirection = Mathf.Sign(touch.position.y - startPos.y); // Do something here in reaction to the swipe. swipeCounter.IncrementCounter(); } break; } touchInfo.SetTouchInfo (Time.time-startTime,(touch.position-startPos).magnitude,Mathf.Abs (touch.position.y-startPos.y)); } Thanks to andeeeee for the logic. But I want to have some interaction in the 3D world based on the swipe on the screen. I.E. If the user swipes over unoccluded enemies, they die. My first thought was to track all the points in the moved TouchPhase, and then if it is a swipe raycast into all those points and kill any enemy that is hit. Is there a better way to do this? What is the best approach? Thanks for the help!

    Read the article

  • trying to install ubuntu touch to nexus 4 - can't connect device (14.04 in virtual box on mac)

    - by Fiona Cox
    I'm trying to install Ubuntu touch to a nexus 4. I've followed all the steps so far, downloaded the packages and gotten the phone ready, but now I got to the step of connecting it to the computer [under 'Enable USB Debugging'], but it's not listed when I try $ adb devices (I tried the 'adb kill-server' command first too, but nothing is listed). I'm sure it's something simple I'm forgetting, but can anyone help please? I have debugging enabled. Running Trusty in VirtualBox on MacBook. Thanks!

    Read the article

  • Custom UITableViewCell won't redraw on setNeedsDisplay

    - by Andrew Portner
    I created a custom UITableViewCell class with a UIButton, a UIImage, and two UILabels. The button and the image are overlayed on top of each other, and only one is displayed at a time. The expected behavior is you touch on the button, the button disappears, and it displays the image. The UITableViewCells are set to be reused. Here's my code: Constructor: - (id)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier { if (self = [super initWithStyle:style reuseIdentifier:reuseIdentifier]) { unheartButton = [[UIButton buttonWithType:UIButtonTypeCustom] retain]; unheartButton.backgroundColor = [UIColor clearColor]; unheartButton.frame = CGRectMake(10, 13, 20, 18); [unheartButton addTarget:self action:@selector(onButtonClick:) forControlEvents:UIControlEventTouchUpInside]; [unheartButton setBackgroundImage:[UIImage imageNamed:@"redheart.png"] forState:UIControlStateNormal]; imageView = [[UIImageView alloc] init]; imageView.frame = CGRectMake(12, 13, 16, 16); NSMutableArray *array = [[NSMutableArray alloc] init]; for (int ndx = 1; ndx < 13; ndx++) { [array addObject:[UIImage imageNamed:[NSString stringWithFormat:@"icon-loading-%d (dragged).tiff", ndx]]]; } imageView.animationImages = array; imageView.animationDuration = 1; imageView.hidden = YES; [array release]; [self.contentView addSubview:imageView]; [self.contentView addSubview:unheartButton]; return self; } } Button click: - (IBAction) onButtonClick: (id) sender { unheartButton.hidden = YES; imageView.hidden = NO; [imageView startAnimating]; [self setNeedsDisplay]; [self.contentView setNeedsDisplay]; [self.unheartButton setNeedsDisplay]; [self.imageView setNeedsDisplay]; } I'm calling setNeedsDisplay on everything, but nothing seems to happen. If I scroll off the screen and back up, the button is hidden and now the loading icon is shown, but this only happens after a scroll. I'm not sure what I need to do to get the cell to repaint.

    Read the article

  • NSOperation for animation loop causes strange scrolling behaviour

    - by Tricky
    Hi, I've created an animation loop which I run as an operation in order to keep the rest of my interface responsive. Whilst almost there, there is still one remaining issue. My UIScrollViews don't seem to be reliably picking up when a user touch ends. What this means is, for example, if a user drags down on a scroll view, when they lift their fingers the scrollview doesn't bounce back into place and the scrollbar remains visible. As if the finger hasn't left the screen. It takes another tap on the scrollview for it to snap to its correct position and the scrollbar to fade away... Here's the loop I created in a subclassed NSOperation: (void)main { NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init]; NSRunLoop *runLoop = [NSRunLoop currentRunLoop]; _displayLink = [[CADisplayLink displayLinkWithTarget: self selector: @selector(animationLoop:)] retain]; [_displayLink setFrameInterval: 1.0f]; [_displayLink addToRunLoop:[NSRunLoop currentRunLoop] forMode: NSRunLoopCommonModes]; while (![self isCancelled]) { NSAutoreleasePool *loopPool = [[NSAutoreleasePool alloc] init]; [runLoop runMode:NSDefaultRunLoopMode beforeDate:[NSDate distantFuture]]; [loopPool drain]; } [_displayLink invalidate]; [pool release]; } DOes anyone have any idea what might be going on here, and even better how to fix it... Thanks!

    Read the article

  • No Microphone error on iPod Touch

    - by Bob Vork
    I've build an iPhone app that should work on an iPod Touch as well, but I'm getting reports that the app is not working on iPod touches. It's displaying an error message saying there's no mic available on the device. The thing is, the app does nothing whatsoever with audio, and I can't find anything related in the project settings. The other problem is I don't have an iPod Touch available to test this myself. Are some people running an old firmware version? Am I compiling the wrong firmware version? To my surprise I couldn't find anything about this on SO or Google… Any help is appreciated

    Read the article

  • touchesEnded not being called??? or randomly being called

    - by Rob
    If I lift my finger up off the first touch, then it will recognize the next touch just fine. It's only when I hold my first touch down continuously and then try and touch a different area with a different finger at the same time. It will then incorrectly register that second touch as being from the first touch again. Update It has something to do with touchesEnded not being called until the very LAST touch has ended (it doesn't care if you already had 5 other touches end before you finally let go of the last one... it calls them all to end once the very last touch ends) - (void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event { UITouch* touch = [touches anyObject]; NSString* filename = [listOfStuff objectAtIndex:[touch view].tag]; // do something with the filename now } - (void)touchesEnded:(NSSet *)touches withEvent:(UIEvent *)event { ITouch* touch = [touches anyObject]; NSString* buttonPressed = [listOfStuff objectAtIndex:[touch view].tag]; // do something with this info now }

    Read the article

  • iPhone: Activate UISlider and set its value to the location of the current touch programatically

    - by carloe
    Is it possible to set an UISlider as first responder and set its current value to the location of the current touch programatically? The way my app is set up I have a UIView container that takes up the whole screen. Inside the container I have another UIView offscreen at the bottom edge (I'll call this bottomBar). Inside the bottomBar there is a UISlider element. Right now, when the user swipes along the bottom edge of the screen the bottomBar the slider it contains slide up. What I am trying to achieve is to activate the UISlider, and set the position of the slider (the value) to the position of the users touch. Is this possible? Could someone please point me in the right direction?

    Read the article

  • How to get a continuous Touch Event?

    - by daliz
    My class extends View and I need to get continuous touch events on it. If I use: public boolean onTouchEvent(MotionEvent me) { if(me.getAction()==MotionEvent.ACTION_DOWN) { myAction(); } return true; } ... the touch event is captured once. What if I need to get continuous touches without moving the finger? Please, tell me I don't need to use threads or timers. My app is already too much heavy. Thanks.

    Read the article

  • WPF Manipulation and Touch events not firing, but mouse events do?

    - by Smetad Anarkist
    I have a Samsung LD220Z multi touch monitor, and when I'm experimenting with some WPF and touch features the touch events arent firing. The mouse down event seems to be firing however. Does this mean that I have to take into account that not all touch screen behave the same, and how do I get the touch inputs on my screen? I've tried the Windows 7 Touch pack that microsoft released. And the multi touch features seems to work there. Any suggestion on how to proceed with this?

    Read the article

  • Touch Screen Product Catalog for Retail Store

    - by Patrick
    I am a UI/UX designer and I would like to create kiosk type of app that would be a product catalog (help/suggestor) for customers in a retail store using a touch screen monitor (and computer). Something as simple as this: http://www.youtube.com/watch?v=aoH0u6YTTK4 This is what I would like it to do: 1st Screen (Main Menu): Pick a type of category (For example: Dog, Cat, Small Animal) 2nd Screen pick a sub-category of a main category (For example: Puppy, Adult, Senior - DOG) 3rd Screen pick a sub-category of previous sub-category (For example: Food, Healthy, Toys) Then it will display a list of all products with a picture, small description, and price. Thats it. So the point of the kiosk is to help customers find certain products that match their pet criteria. (Dog Puppy Healthy Dog Food) I am wondering what is the best solution: RIA (Flex/Air or Silveright) or flash/action script. I am not sure what is the best technology to use for the following benefits: user-experience (smoothness of touch screen actions) and fast development.

    Read the article

  • Few iPhone noob questions

    - by mshsayem
    Why should I declare local variables as 'static' inside a method? Like: static NSString *cellIdentifier = @"Cell"; Is it a performance advantage? (I know what 'static' does; in C context) What does this syntax mean?[someObj release], someObj = nil; Two statements? Why should I assign nil again? Is not 'release' enough? Should I do it for all objects I allocate/own? Or for just view objects? Why does everyone copy NSString, but retains other objects (in property declaration)? Yes, NSStrings can be changed, but other objects can be changed also, right? Then why 'copy' for just NSString, not for all? Is it just a defensive convention? Shouldn't I release constant NSString? Like here:NSString *CellIdentifier = @"Cell"; Why not? Does the compiler allocate/deallocate it for me? In some tutorial application I observed these (Built with IB): Properties(IBOutlet, with same ivar name): window, someLabel, someTextField, etc etc... In the dealloc method, although the window ivar was released, others were not. My question is: WHY? Shouldn't I release other ivars(labels, textField) as well? Why not? Say, I have 3 cascaded drop-down lists. I mean, based on what is selected on the first list, 2nd list is populated and based on what is selected on the second list, 3rd list is populated. What UI components can reflect this best? How is drop-down list presented in iPhone UI? Tableview with UIPicker? When should I update the 2nd, 3rd list? Or just three labels which have touch events? Can you give me some good example tutorials about Core-Data? (Not just simple data fetching and storing on 2/3 tables with 1/2 relationship) How can I know whether my app is leaking memory? Any tools?

    Read the article

  • Oracle 'In Touch' PartnerCast - July 1, 2014

    - by Cinzia Mascanzoni
    27 May 2014 'In Touch' Webcast for Oracle EMEA Partners Invitation Stay Connected Oracle Media Network   OPN on PartnerCast   Oracle 'In Touch' PartnerCast (July 1, 2014)Be prepared for a year of growth Register Now! Dear partner, We would like to invite you to join David Callaghan, Senior Vice President Oracle EMEA Alliances and Channels, and his studio guests for the next broadcast of the Oracle ‘In Touch’ PartnerCast on Tuesday 1st July 2014 from 10:30am UK / 11:30am CET. In this cast, David’s studio guests and his regional reporters will be looking at your priorities as EMEA partners and how best to grow with Oracle. We also look forward to the broadcast covering topics on the following: Highlights of FY14 Strategic themes for FY15 HCM, CRM and ERP Oracle on Oracle Exclusive for ‘In Touch’ David Callaghan questions Rich Geraffo, Senior Vice President, Global Alliances & Channels, on how the FY15 partner Global kick off relates to EMEA. Plus David provides your chance to hear from some of the newly appointed Worldwide A&C Leadership team as he discusses with Bruce Chumley VP Oracle Channel Distribution Sales & Troy Richardson VP Oracle Strategic Alliances; their core focus and strategy of growth and what they intend on bringing to the table in their new role. Register Now! With lots of studio guests joining David, why not get in touch on Twitter using the hashtag #OracleInTouch or by emailing [email protected] to get your questions featured in the cast! To find out more information and to watch previous episodes on-demand, please visit our webpage here. Best regards, Oracle EMEA Alliances & Channels Oracle 'In Touch' PartnerCast: be prepared for a year of growth July 01, 2014 10:30am UK / 11:30am CET Duration: 45 mins. Host David Callaghan Senior VP Oracle EMEA Alliances & Channels Studio Guests Alistair Hopkins VP Sales & Strategy, Technology Solutions, Oracle EMEA Alliances & Channels More to be announced shortly Features Contributors Rich Geraffo Senior Vice President, Oracle Worldwide Alliances & Channels Bruce Chumley Vice President Channel Distribution Sales, Oracle WW Alliances & Channels Steve Biondi VP Channel Distribution Sales, Oracle WW Alliances & Channels Regional Reporters Silvia Kaske VP Oracle A&C WCE North Will O'Brien VP Oracle A&C UK/IE Eric Fontaine VP Oracle A&C WCE South Janusz Naklicki VP Oracle A&C ECEMEA

    Read the article

  • Me on Windows 7 Touch (and I mention Silverlight Hack)

    At the MPV Summit 2010 I was asked to talk a little bit about Windows 7 touch and so I talk abit about this touch tag Kiosk technology and our experience at Wirestone working with Windows 7 Touch, WPF and Silverlight. Anyway its pretty cool:http://www.vimeo.com/10357419...Did you know that DotNetSlackers also publishes .net articles written by top known .net Authors? We already have over 80 articles in several categories including Silverlight. Take a look: here.

    Read the article

  • security policy error iphone ipod touch issue

    - by Joey
    I'm getting an "Error from Debugger: Error launching remote program: security policy error" when I try to run my app on my ipod touch. The provisions look in order, and the app builds to my iphone 3gs just fine. The app used to build just fine to my ipod touch, so I'm flustered what could have changed and wondering if anyone has any thoughts on what might be causing this issue. The build logs are below. Mon Mar 15 14:25:54 unknown com.apple.debugserver-43[449] : Connecting to com.apple.debugserver service... Mon Mar 15 14:25:55 unknown SpringBoard[24] : Unable to launch com.yourcompany.Unearthed because it has an invalid code signature, inadequate entitlements or its profile has not been explicitly trusted by the user. Mon Mar 15 14:25:55 unknown com.apple.debugserver-43[449] : error: unable to launch the application with CFBundleIdentifier 'com.yourcompany.Unearthed' sbs_error = 9 Mon Mar 15 14:25:55 unknown com.apple.debugserver-43[449] : 1 [01c1/0903]: RNBRunLoopLaunchInferior DNBProcessLaunch() returned error: '' Mon Mar 15 14:25:55 unknown com.apple.debugserver-43[449] : error: failed to launch process (null): security policy error Mon Mar 15 14:26:03 unknown MobileSafari[72] : void SendDelegateMessage(NSInvocation*): delegate (webView:decidePolicyForNavigationAction:request:frame:decisionListener:) failed to return after waiting 10 seconds. main run loop mode: UITrackingRunLoopMode

    Read the article

  • iPad start in Landscape receive only touch within 768x768

    - by user1307179
    It works perfect fine when starting in portrait and also works when you rotate from portrait to landscape and back. It does not work when starting in landscape. But then it works when you rotate from landscape to portrait and back. In landscape starting mode, the screen does not respond with any touch where screen coordinateX greater than 768. What happens in code is, I use status bar orientation to determine original orientation and rotate each view manually. The views display correctly but does not receive touch properly. Then my root view controller will get called when ipad start rotating with: - (void)willRotateToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation duration:(NSTimeInterval)duration which will rotate every subviews. Root controller: - (void)loadView { self.view = [[UIView alloc]init ]; //initialize child views [self willRotateToInterfaceOrientation:0 duration:0]; } - (void)willRotateToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation duration:(NSTimeInterval)duration { if ([model isLandscape]) { self.view.frame = CGRectMake(0, 0, 1024, 768-80); } else { self.view.frame = CGRectMake(0, 0, 768, 1024-80); } //rotate child views } My code [model isLandscape] works so I don't need to provide details as to how it works but here are the code anyway: - (bool)isLandscape { if (orientation == UIInterfaceOrientationLandscapeLeft || orientation == UIInterfaceOrientationLandscapeRight) return true; else return false; } -(id) init { [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(orientationChanged:) name:UIDeviceOrientationDidChangeNotification object:nil]; } - (void)orientationChanged:(NSNotification *)notification { UIInterfaceOrientation curOrientation = [[UIDevice currentDevice] orientation]; if (curOrientation == UIDeviceOrientationPortrait || curOrientation == UIDeviceOrientationPortraitUpsideDown || curOrientation == UIDeviceOrientationLandscapeLeft || curOrientation == UIDeviceOrientationLandscapeRight) { orientation = curOrientation; ((AppDelegate*)([UIApplication sharedApplication].delegate)).savedOrientationForRestart = orientation; NSLog(@"changed"); } } -(void)validateOrientation { //first time when initializing orientation UIInterfaceOrientation curOrientation = [[UIDevice currentDevice] orientation]; if (curOrientation != UIDeviceOrientationPortrait && curOrientation != UIDeviceOrientationPortraitUpsideDown && curOrientation != UIDeviceOrientationLandscapeLeft && curOrientation != UIDeviceOrientationLandscapeRight) { orientation = [[UIApplication sharedApplication] statusBarOrientation]; } }

    Read the article

  • Touch gestures in IE not working without explorer.exe being run once

    - by Michael
    Edit: Rephrasing my question: Upon further troubleshooting, I can conclude that: Touch gestures (dragging, pinch to zoom, touch-and-hold right click) in Internet Explorer start to work when: The system has been running for ~2 minutes. This coincides with the delayed start of services. Explorer.exe is being run, then killed. I assume Explorer.exe starts some services? The services with delayed start are as follows: Security Center Software Protection Windows Defender, Search and Update Windows Font Cache Service Microsoft .NET Framework NGEN v4.0.30319_X64 and X86 I see no connection between these services and touch gestures, but just in case, I manually tried starting these services, but without luck. What else happens delayed after system boot, which also happens when explorer is started? Old question: Details: Internet Explorer 9 and Windows 7 Professional, running on a HP TouchSmart (touch screen PC). It is going to be a kiosk PC (running a custom GUI for displaying websites). Scenario 1: When running Internet Explorer as a normal program in Windows 7, touch functions work perfectly. I can scroll the website by dragging it with my finger, I can pinch zoom and I can touch-and-hold right click. I now change the default shell in Windows to Internet Explorer (ie. IE starts instead of explorer.exe). Internet Explorer of course starts up when logging in. However, touch functions are reduced to basic clicking (no dragging, no pinch zooming, no touch-and-hold right click). Then I manually start explorer.exe, and the touch functions work again! And here is the weird part: When I kill explorer.exe, the touch functions keeps working - even if I close IE and start a new instance. Scenario 2: The exact same, but instead of changing the default shell to Internet Explorer, I change it to my own program, which uses an embedded Internet Explorer ("WebBrowser"). Same thing happens. What I've tried: Autorun programs: When explorer.exe launches, it launches all the autorun programs. There are no relevant programs being run by explorer, but just in case, I have manually started all the autorun programs, so that it is identical (but without explorer.exe) to a normal login. It still does not work (until I launch explorer.exe). Specifically TabTip.exe, TabTip32.exe and wisptis.exe are all running. All services are also started. To sum it up Running explorer.exe once changes something in the touch capabilities of Internet Explorer. It doesn't matter if explorer.exe is running - as long as it has been run once. Does anyone know what causes this behavior? Or how I can circumvent it neatly?

    Read the article

  • adding UIImageView to UIScrollView throws exception cocoa touch for iPad

    - by Brodie4598
    I am a noob at OBJ-C :) I am trying to add a UIImageView to a UIScrollView to display a large image in my iPad app. I have followed the tutorial here exactly: http://howtomakeiphoneapps.com/2009/12/how-to-use-uiscrollview-in-your-iphone-app/ The only difference is that in my App the View is in a seperate tab and I am using a different image. here is my code: - (void)viewDidLoad { [super viewDidLoad]; UIImageView *tempImageView = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"Cheyenne81"]]; self.imageView = tempImageView; [tempImageView release]; scrollView.contentSize = CGSizeMake(imageView.frame.size.width, imageView.frame.size.height); scrollView.maximumZoomScale = 4.0; scrollView.minimumZoomScale = 0.75; scrollView.clipsToBounds = YES; scrollView.delegate = self; [scrollView addSubview:imageView]; } - (UIView *)viewForZoomingInScrollView:(UIScrollView *)scrollView{ return imageView; } and: @interface UseScrollViewViewController : UIViewController<UIScrollViewDelegate>{ IBOutlet UIScrollView *scrollView; UIImageView *imageView; } @property (nonatomic, retain) UIScrollView *scrollView; @property (nonatomic, retain) UIImageView *imageView; @end I then create a UIScrollView in Interface Builder and link it to the scrollView outlet. Thats when I get the problem. When I run the program it crashes instantly. If I run it without linking the scrollView to the outlet, it will run (allbeit with a blnk screen). The following is the error I get in the console: 2010-03-27 20:18:13.467 UseScrollViewViewController[7421:207] * Terminating app due to uncaught exception 'NSUnknownKeyException', reason: '[ setValue:forUndefinedKey:]: this class is not key value coding-compliant for the key scrollView.'

    Read the article

  • Managing subviews in Cocoa Touch

    - by brainfsck
    Hi, I'm developing an iPhone app. I need to create a Quiz application that has different Question views embedded in it (see my similar question). Different types of Question will have different behavior, so I plan to create a controller class for each type of Question. The MultipleChoiceQuestionController would set up a question and 3-4 buttons for the user to select an answer. Similarly, the IdentifyPictureQuestionController would load an image and present a text box to the user. However, the docs say that a UIViewController should only be used for views that take up the entire application window. How else can I create a class to manage events in my subviews? Thanks,

    Read the article

  • Cocoa structs and NSMutableArray

    - by Circle
    I have an NSMutableArray that I'm trying to store and access some structs. How do I do this? 'addObject' gives me an error saying "Incompatible type for argument 1 of addObject". Here is an example ('in' is a NSFileHandle, 'array' is the NSMutableArray): //Write points for(int i=0; i<5; i++) { struct Point p; buff = [in readDataOfLength:1]; [buff getBytes:&(p.x) length:sizeof(p.x)]; [array addObject:p]; } //Read points for(int i=0; i<5; i++) { struct Point p = [array objectAtIndex:i]; NSLog(@"%i", p.x); }

    Read the article

  • NSData-AES Class Encryption/Decryption in Cocoa

    - by David Schiefer
    hi, I am attempting to encrypt/decrypt a plain text file in my text editor. encrypting seems to work fine, but the decrypting does not work, the text comes up encrypted. I am certain i've decrypted the text using the word i encrypted it with - could someone look through the snippet below and help me out? Thanks :) Encrypting: NSAlert *alert = [NSAlert alertWithMessageText:@"Encryption" defaultButton:@"Set" alternateButton:@"Cancel" otherButton:nil informativeTextWithFormat:@"Please enter a password to encrypt your file with:"]; [alert setIcon:[NSImage imageNamed:@"License.png"]]; NSSecureTextField *input = [[NSSecureTextField alloc] initWithFrame:NSMakeRect(0, 0, 300, 24)]; [alert setAccessoryView:input]; NSInteger button = [alert runModal]; if (button == NSAlertDefaultReturn) { [[NSUserDefaults standardUserDefaults] setObject:[input stringValue] forKey:@"password"]; NSData *data; [self setString:[textView textStorage]]; NSMutableDictionary *dict = [NSDictionary dictionaryWithObject:NSPlainTextDocumentType forKey:NSDocumentTypeDocumentAttribute]; [textView breakUndoCoalescing]; data = [[self string] dataFromRange:NSMakeRange(0, [[self string] length]) documentAttributes:dict error:outError]; NSData*encrypt = [data AESEncryptWithPassphrase:[input stringValue]]; [encrypt writeToFile:[absoluteURL path] atomically:YES]; Decrypting: NSAlert *alert = [NSAlert alertWithMessageText:@"Decryption" defaultButton:@"Open" alternateButton:@"Cancel" otherButton:nil informativeTextWithFormat:@"This file has been protected with a password.To view its contents,enter the password below:"]; [alert setIcon:[NSImage imageNamed:@"License.png"]]; NSSecureTextField *input = [[NSSecureTextField alloc] initWithFrame:NSMakeRect(0, 0, 300, 24)]; [alert setAccessoryView:input]; NSInteger button = [alert runModal]; if (button == NSAlertDefaultReturn) { NSLog(@"Entered Password - attempting to decrypt."); NSMutableDictionary *dict = [NSDictionary dictionaryWithObject:NSPlainTextDocumentType forKey:NSDocumentTypeDocumentOption]; NSData*decrypted = [[NSData dataWithContentsOfFile:[self fileName]] AESDecryptWithPassphrase:[input stringValue]]; mString = [[NSAttributedString alloc] initWithData:decrypted options:dict documentAttributes:NULL error:outError];

    Read the article

  • Cocoa contentsOfDirectoryAtPath: method failing with error for certain users - Mac OS X

    - by Patrick
    Here's a snippet of the code: // Get into the data folder of it keychainPath = [keychainPath stringByAppendingPathComponent:@"data/default"]; DLog(@"Keychain data path: %@", keychainPath); // Define Filemanager NSFileManager *fm = [NSFileManager defaultManager]; // Catch any errors NSError *dataError = nil; // get all the files in the directory NSArray *dataFiles = [fm contentsOfDirectoryAtPath:keychainPath error:&dataError]; if(!dataFiles) NSLog(@"Error: %@",dataError); Now this works perfectly fine for most people, but a few have reported problems, with the 'dataError' object giving: Error: Error Domain=NSCocoaErrorDomain Code=260 UserInfo=0x14d1fa10 "The folder “default” doesn’t exist." Underlying Error=(Error Domain=NSOSStatusErrorDomain Code=-43 "The operation couldn’t be completed. (OSStatus error -43.)" (File not found)) The people having this problem have said that the file / folder 'default' DOES exist exactly where is should be, so I have no idea why this isn't working. Any help would be appreciated!

    Read the article

< Previous Page | 10 11 12 13 14 15 16 17 18 19 20 21  | Next Page >