• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: SKIndexAddDocument crashing
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: SKIndexAddDocument crashing


  • Subject: Re: SKIndexAddDocument crashing
  • From: Mike Abdullah <email@hidden>
  • Date: Wed, 06 Nov 2013 12:29:59 +0000

On 6 Nov 2013, at 02:18, Eric Gorr <email@hidden> wrote:

> I've got a functioning sample project at https://github.com/ericgorr/searchtest.git
>
> The relevant code is self contained in the applicationDidFinishLaunching method in ELIZAppDelegate.m...
>
>    NSBundle* mainBundle = [NSBundle mainBundle];
>
>    NSURL*      docURL              = [mainBundle URLForResource:@"message" withExtension:@"emlx"];
>    NSString*   homePath            = NSHomeDirectory();
>    NSURL*      homeURL             = [NSURL fileURLWithPath:homePath];
>    NSString*   searchIndexName     = @"index.idx";
>    NSURL*      indexURL            = [homeURL URLByAppendingPathComponent:searchIndexName];
>
>    SKIndexRef  searchIndexFile;
>
>    SKLoadDefaultExtractorPlugIns();
>
>    NSDictionary*   textAnalysisOptions = @{ (__bridge NSString*)kSKProximityIndexing : @YES };
>
>    [[NSFileManager defaultManager] removeItemAtURL:indexURL error:nil];
>
>    searchIndexFile = SKIndexCreateWithURL( (__bridge CFURLRef)indexURL,
>                                            (__bridge CFStringRef)searchIndexName,
>                                           kSKIndexInverted,
>                                           (__bridge CFDictionaryRef)textAnalysisOptions );
>
>    NSLog( @"Index Exists: %d", [[NSFileManager defaultManager] fileExistsAtPath:[indexURL path]] );
>    NSLog( @"Message Exists: %d", [[NSFileManager defaultManager] fileExistsAtPath:[docURL path]] );
>
>    CFURLRef        fullMessageURLRef           = (CFURLRef)CFBridgingRetain( docURL );
>    SKDocumentRef   doc                         = SKDocumentCreateWithURL ( fullMessageURLRef );
>
>    SKIndexAddDocument( searchIndexFile, doc, NULL, false );
>
>    NSLog( @"added" );
>
> Everything works up to the point where SKIndexAddDocument is called and then it crashes and I am not sure why...
>
> Built with Xcode Version 5.0.1 (5A2053) and running OS X 10.9.

First rule of crashes: include the stack trace for us, please.


_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden


  • Follow-Ups:
    • Re: SKIndexAddDocument crashing
      • From: Eric Gorr <email@hidden>
References: 
 >SKIndexAddDocument crashing (From: Eric Gorr <email@hidden>)

  • Prev by Date: Re: URLByResolvingBookmarkData: crashes on 10.8
  • Next by Date: Re: Mutually exclusive item filtering-comparing
  • Previous by thread: SKIndexAddDocument crashing
  • Next by thread: Re: SKIndexAddDocument crashing
  • Index(es):
    • Date
    • Thread