Re: Cocoa-dev Digest, Vol 9, Issue 28

  • Re: logged: auto malloc[27012]: attempted to remove unregistered weak referrer 0xblahblah
    multiple times. What is most interesting is that it only happens when
    selecting multiple items by dragging.  I first noticed it in this code:

    - (IBAction) showOpenPanel: (id) sender
    {
      BOOL reloadNeeded = NO;
      BOOL showWarning = NO;

      NSOpenPanel *panel = [NSOpenPanel openPanel];
      CFArrayRef types = CGImageSourceCopyTypeIdentifiers();
      CFMakeCollectable(types);
      [panel setAllowedFileTypes: (NSArray*) types];
      [panel setAllowsMultipleSelection: YES];
      [panel setCanChooseFiles: YES];
      [panel setCanChooseDirectories: NO];
      NSInteger result = [panel runModal];
      if (result == NSOKButton) {
      // this may take a while, let the user know we're busy
      [self showProgressIndicator];
      NSArray *urls = [panel URLs];
      for (NSURL *url in urls) {
          NSString *path = [url path];
          if (! [self isDuplicatePath: path]) {
          [imageInfos addObject: [ImageInfo imageInfoWithPath: path]];
          reloadNeeded = YES;
          } else
          showWarning = YES;
      }
      [self hideProgressIndicator];

      if (reloadNeeded)
          [tableView reloadData];
      if (showWarning) {
          NSAlert *alert = [[NSAlert alloc] init];
          [alert addButtonWithTitle: NSLocalizedString(@"CLOSE", @"Close")];
          [alert setMessageText: NSLocalizedString(@"WARN_TITLE", @"Files not opened")];
          [alert setInformativeText: NSLocalizedString(@"WARN_DESC", @"Files not opened")];
          [alert runModal];
      }
      }
    }

    In the open panel I can click, move the mouse, then shift-click and all is OK.

    Ling Peng

    在 2012年1月19日,18:40,<cocoa-dev-request...> 写道:

    > logged: auto malloc[27012]: attempted to remove unregistered weak referrer 0xblahblah
    > multiple times. What is most interesting is that it only happens when
    > selecting multiple items by dragging.  I first noticed it in this code:
    >
    > - (IBAction) showOpenPanel: (id) sender
    > {
    > BOOL reloadNeeded = NO;
    > BOOL showWarning = NO;
    >
    > NSOpenPanel *panel = [NSOpenPanel openPanel];
    > CFArrayRef types = CGImageSourceCopyTypeIdentifiers();
    > CFMakeCollectable(types);
    > [panel setAllowedFileTypes: (NSArray*) types];
    > [panel setAllowsMultipleSelection: YES];
    > [panel setCanChooseFiles: YES];
    > [panel setCanChooseDirectories: NO];
    > NSInteger result = [panel runModal];
    > if (result == NSOKButton) {
    > // this may take a while, let the user know we're busy
    > [self showProgressIndicator];
    > NSArray *urls = [panel URLs];
    > for (NSURL *url in urls) {
    > NSString *path = [url path];
    > if (! [self isDuplicatePath: path]) {
    > [imageInfos addObject: [ImageInfo imageInfoWithPath: path]];
    > reloadNeeded = YES;
    > } else
    > showWarning = YES;
    > }
    > [self hideProgressIndicator];
    >
    > if (reloadNeeded)
    > [tableView reloadData];
    > if (showWarning) {
    > NSAlert *alert = [[NSAlert alloc] init];
    > [alert addButtonWithTitle: NSLocalizedString(@"CLOSE", @"Close")];
    > [alert setMessageText: NSLocalizedString(@"WARN_TITLE", @"Files not opened")];
    > [alert setInformativeText: NSLocalizedString(@"WARN_DESC", @"Files not opened")];
    > [alert runModal];
    > }
    > }
    > }
    >
    > In the open panel I can click, move the mouse, then shift-click and all is OK.
previous month january 2012 next month
MTWTFSS
            1
2 3 4 5 6 7 8
9 10 11 12 13 14 15
16 17 18 19 20 21 22
23 24 25 26 27 28 29
30 31          
Go to today