Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8589659
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T23:06:35+00:00 2026-06-11T23:06:35+00:00

I have problem with Objective-Zip. It throw exeption when validate my zip. I checked

  • 0

I have problem with Objective-Zip. It throw exeption when validate my zip. I checked file it’s fine, no problems with unzip/zip. What’s more I try zip my files with system default archiver and other.

I use ZipFile *unzipFile= [[ZipFile alloc] initWithFileName:@"textPack.zip" mode:ZipFileModeUnzip];

Validate method

- (id) initWithFileName:(NSString *)fileName mode:(ZipFileMode)mode {
    if (self= [super init]) {
        _fileName= [fileName retain];
        _mode= mode;

        switch (mode) {
            case ZipFileModeUnzip:
                _unzFile= unzOpen([_fileName cStringUsingEncoding:NSUTF8StringEncoding]);
                if (_unzFile == NULL) {
                    NSString *reason= [NSString stringWithFormat:@"Can't open '%@'", _fileName];
                    @throw [[[ZipException alloc] initWithReason:reason] autorelease];
                }
                break;

            case ZipFileModeCreate:
                _zipFile= zipOpen([_fileName cStringUsingEncoding:NSUTF8StringEncoding], APPEND_STATUS_CREATE);
                if (_zipFile == NULL) {
                    NSString *reason= [NSString stringWithFormat:@"Can't open '%@'", _fileName];
                    @throw [[[ZipException alloc] initWithReason:reason] autorelease];
                }
                break;

            case ZipFileModeAppend:
                _zipFile= zipOpen([_fileName cStringUsingEncoding:NSUTF8StringEncoding], APPEND_STATUS_ADDINZIP);
                if (_zipFile == NULL) {
                    NSString *reason= [NSString stringWithFormat:@"Can't open '%@'", _fileName];
                    @throw [[[ZipException alloc] initWithReason:reason] autorelease];
                }
                break;

            default: {
                NSString *reason= [NSString stringWithFormat:@"Unknown mode %d", _mode];
                @throw [[[ZipException alloc] initWithReason:reason] autorelease];
            }
        }
    }

    return self;
}

Any advice?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-11T23:06:36+00:00Added an answer on June 11, 2026 at 11:06 pm
    ZipFile *unzipFile= [[ZipFile alloc] initWithFileName:@"textPack.zip" mode:ZipFileModeUnzip];
    

    Won’t work because @”textPack.zip” is no valid file.
    The “FileName” has to include the path. I think they used a misleading name here.

    Use this if your file is from the main bundle:

    NSString *path=[[NSBundle mainBundle] pathForResource:@"textPack" ofType:@"zip"];
    ZipFile *unzipFile= [[ZipFile alloc] initWithFileName:path mode:ZipFileModeUnzip];
    

    Hope this helps

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a peculiar problem. I created a normal Objective C class called SampleTable.
I have an Objective-C audio app based on audio unit and my problem is
I have problem developing with live555. I already build the lib-files and example projects
im new with objective-c. I have problem with memory leaking when developing iphone app.
I have another odd problem with Objective C inheritance. I have a protocol called
I have a problem with the Objective c mutithreaded method. [self performSelectorOnMainThread:@selector(displayThread2Counts:) withObject:myNumber waitUntilDone:NO];
I have the following problem in objective C: In a larger context I would
I have a problem finding out if two PolyLines intersect. Well the main objective
I have a problem in getting focus to a window in my Objective C
I'm pretty new to Objective C and iPhone development and have hit a problem

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.